SQLite Forum

A question about the "type" field in the result of PRAGMA table_xinfo for the generated column.
Login
My testcase is:

~~~~~
  .mode box
  CREATE TABLE t1(a INT, b INT GENERATED ALWAYS AS (a+2));
  PRAGMA table_xinfo=t1;
~~~~~

Which generates this output:

~~~~~
  ┌─────┬──────┬──────────────────────┬─────────┬────────────┬────┬────────┐
  │ cid │ name │         type         │ notnull │ dflt_value │ pk │ hidden │
  ├─────┼──────┼──────────────────────┼─────────┼────────────┼────┼────────┤
  │ 0   │ a    │ INT                  │ 0       │            │ 0  │ 0      │
  │ 1   │ b    │ INT GENERATED ALWAYS │ 0       │            │ 0  │ 2      │
  └─────┴──────┴──────────────────────┴─────────┴────────────┴────┴────────┘
~~~~~

This is a cosmetic problem.  It will not cause incorrect answers.  It is
also a problem that is deep down inside the [Lemon parser generator][1], and will
be tricky to fix.  It boils down to an unavoidable grammar ambiguity that
Lemon is resolving the wrong way.  As the result is harmless, the fix has
a low priority.

[1]: https://www.sqlite.org/lemon.html