SQLite Forum

pragma table_info Bug
Login
hello,
I have these problems on bases which are more than 10 years old.
I have never created a table using square brackets, my creation process is automated, however I see that in the schema of some of my tables there are square brackets and the problem must be there.
In my programs I have a check of the zones of the tables using table_info until version 3.36.0 I had no problem. as of 3.37 I have seen it still for the same databases.
example I found this table where I have a description with and without  brackets on the same table, which I don't understand how it is possible by my creation process.

sqlite> .schema cbreleve
CREATE TABLE [CBRELEVE] (
  [Clt] VARCHAR(6) NOT NULL,
  [Typ] [UNSIGNED WORD](1) NOT NULL,
  [Date] DATETEXT NOT NULL,
  [nSeq] [INTEGER UNSIGNED] NOT NULL,
  [Nf] [DOUBLE PRECISION],
  [Nom] VARCHAR(35),
  [RegClt] VARCHAR(4),
  [Tra] [UNSIGNED WORD](1),
  [PiedHtMon0] [DOUBLE PRECISION],
  [PiedHtInd0] [UNSIGNED WORD](1),
  [PiedHtMon1] [DOUBLE PRECISION],
  [PiedHtInd1] [UNSIGNED WORD](1),
  [PiedHtMon2] [DOUBLE PRECISION],
  [PiedHtInd2] [UNSIGNED WORD](1),
  [PiedHtMon3] [DOUBLE PRECISION],
  [PiedHtInd3] [UNSIGNED WORD](1),
  [PiedHtMon4] [DOUBLE PRECISION],
  [PiedHtInd4] [UNSIGNED WORD](1),
  [PiedHtMon5] [DOUBLE PRECISION],
  [PiedHtInd5] [UNSIGNED WORD](1),
  [PiedHtMon6] [DOUBLE PRECISION],
  [PiedHtInd6] [UNSIGNED WORD](1),
  [PiedHtMon7] [DOUBLE PRECISION],
  [PiedHtInd7] [UNSIGNED WORD](1),
  [PiedHtMon8] [DOUBLE PRECISION],
  [PiedHtInd8] [UNSIGNED WORD](1),
  [PiedHtMon9] [DOUBLE PRECISION],
  [PiedHtInd9] [UNSIGNED WORD](1),
  [PiedHtMon10] [DOUBLE PRECISION],
  [PiedHtInd10] [UNSIGNED WORD](1),
  [PiedHtMon11] [DOUBLE PRECISION],
  [PiedHtInd11] [UNSIGNED WORD](1),
  [dPiedTpf] [DOUBLE PRECISION],
  [dPiedMht] [DOUBLE PRECISION],
  [dPiedRem0] [DOUBLE PRECISION],
  [dPiedRem1] [DOUBLE PRECISION],
  [dPiedTx0] [DOUBLE PRECISION],
  [dPiedTx1] [DOUBLE PRECISION],
  [dPiedPnt] [DOUBLE PRECISION],
  [dPiedTva] [DOUBLE PRECISION],
  [dPiedTTC] [DOUBLE PRECISION], dPiedTaxe0 DOUBLE PRECISION DEFAULT '0', dPiedT
axe1 DOUBLE PRECISION DEFAULT '0', dPiedTaxe2 DOUBLE PRECISION DEFAULT '0', dPie
dTaxe3 DOUBLE PRECISION DEFAULT '0', dPiedTaxe4 DOUBLE PRECISION DEFAULT '0', dP
iedTaxe5 DOUBLE PRECISION DEFAULT '0', dPiedTaxe6 DOUBLE PRECISION DEFAULT '0',
dPiedTaxe7 DOUBLE PRECISION DEFAULT '0', PiedTaxeInd0 UNSIGNED WORD(1) DEFAULT '
 ', PiedTaxeInd1 UNSIGNED WORD(1) DEFAULT ' ', PiedTaxeInd2 UNSIGNED WORD(1) DEF
AULT ' ', PiedTaxeInd3 UNSIGNED WORD(1) DEFAULT ' ', PiedTaxeInd4 UNSIGNED WORD(
1) DEFAULT ' ', PiedTaxeInd5 UNSIGNED WORD(1) DEFAULT ' ', PiedTaxeInd6 UNSIGNED
 WORD(1) DEFAULT ' ', PiedTaxeInd7 UNSIGNED WORD(1) DEFAULT ' ',
  CONSTRAINT [sqlite_autoindex_CBRELEVE_1] PRIMARY KEY ([Clt], [Typ], [Date], [n
Seq]));

and if I ask for a table_info on this table I get:

sqlite> pragma table_info(cbreleve);
┌─────┬──────────────┬──────────────────┬─────────┬────────────┬────┐
│ cid │     name     │       type       │ notnull │ dflt_value │ pk │
├─────┼──────────────┼──────────────────┼─────────┼────────────┼────┤
│ 0   │ Clt          │ VARCHAR(6)       │ 1       │            │ 1  │
│ 1   │ Typ          │ UNSIGNED WORD](1 │ 1       │            │ 2  │
│ 2   │ Date         │ DATETEXT         │ 1       │            │ 3  │
│ 3   │ nSeq         │ INTEGER UNSIGNED │ 1       │            │ 4  │
│ 4   │ Nf           │ DOUBLE PRECISION │ 0       │            │ 0  │
│ 5   │ Nom          │ VARCHAR(35)      │ 0       │            │ 0  │
│ 6   │ RegClt       │ VARCHAR(4)       │ 0       │            │ 0  │
│ 7   │ Tra          │ UNSIGNED WORD](1 │ 0       │            │ 0  │
│ 8   │ PiedHtMon0   │ DOUBLE PRECISION │ 0       │            │ 0  │
│ 9   │ PiedHtInd0   │ UNSIGNED WORD](1 │ 0       │            │ 0  │
│ 10  │ PiedHtMon1   │ DOUBLE PRECISION │ 0       │            │ 0  │
│ 11  │ PiedHtInd1   │ UNSIGNED WORD](1 │ 0       │            │ 0  │
│ 12  │ PiedHtMon2   │ DOUBLE PRECISION │ 0       │            │ 0  │
│ 13  │ PiedHtInd2   │ UNSIGNED WORD](1 │ 0       │            │ 0  │
│ 14  │ PiedHtMon3   │ DOUBLE PRECISION │ 0       │            │ 0  │
│ 15  │ PiedHtInd3   │ UNSIGNED WORD](1 │ 0       │            │ 0  │
│ 16  │ PiedHtMon4   │ DOUBLE PRECISION │ 0       │            │ 0  │
│ 17  │ PiedHtInd4   │ UNSIGNED WORD](1 │ 0       │            │ 0  │
│ 18  │ PiedHtMon5   │ DOUBLE PRECISION │ 0       │            │ 0  │
│ 19  │ PiedHtInd5   │ UNSIGNED WORD](1 │ 0       │            │ 0  │
│ 20  │ PiedHtMon6   │ DOUBLE PRECISION │ 0       │            │ 0  │
│ 21  │ PiedHtInd6   │ UNSIGNED WORD](1 │ 0       │            │ 0  │
│ 22  │ PiedHtMon7   │ DOUBLE PRECISION │ 0       │            │ 0  │
│ 23  │ PiedHtInd7   │ UNSIGNED WORD](1 │ 0       │            │ 0  │
│ 24  │ PiedHtMon8   │ DOUBLE PRECISION │ 0       │            │ 0  │
│ 25  │ PiedHtInd8   │ UNSIGNED WORD](1 │ 0       │            │ 0  │
│ 26  │ PiedHtMon9   │ DOUBLE PRECISION │ 0       │            │ 0  │
│ 27  │ PiedHtInd9   │ UNSIGNED WORD](1 │ 0       │            │ 0  │
│ 28  │ PiedHtMon10  │ DOUBLE PRECISION │ 0       │            │ 0  │
│ 29  │ PiedHtInd10  │ UNSIGNED WORD](1 │ 0       │            │ 0  │
│ 30  │ PiedHtMon11  │ DOUBLE PRECISION │ 0       │            │ 0  │
│ 31  │ PiedHtInd11  │ UNSIGNED WORD](1 │ 0       │            │ 0  │
│ 32  │ dPiedTpf     │ DOUBLE PRECISION │ 0       │            │ 0  │
│ 33  │ dPiedMht     │ DOUBLE PRECISION │ 0       │            │ 0  │
│ 34  │ dPiedRem0    │ DOUBLE PRECISION │ 0       │            │ 0  │
│ 35  │ dPiedRem1    │ DOUBLE PRECISION │ 0       │            │ 0  │
│ 36  │ dPiedTx0     │ DOUBLE PRECISION │ 0       │            │ 0  │
│ 37  │ dPiedTx1     │ DOUBLE PRECISION │ 0       │            │ 0  │
│ 38  │ dPiedPnt     │ DOUBLE PRECISION │ 0       │            │ 0  │
│ 39  │ dPiedTva     │ DOUBLE PRECISION │ 0       │            │ 0  │
│ 40  │ dPiedTTC     │ DOUBLE PRECISION │ 0       │            │ 0  │
│ 41  │ dPiedTaxe0   │ DOUBLE PRECISION │ 0       │ '0'        │ 0  │
│ 42  │ dPiedTaxe1   │ DOUBLE PRECISION │ 0       │ '0'        │ 0  │
│ 43  │ dPiedTaxe2   │ DOUBLE PRECISION │ 0       │ '0'        │ 0  │
│ 44  │ dPiedTaxe3   │ DOUBLE PRECISION │ 0       │ '0'        │ 0  │
│ 45  │ dPiedTaxe4   │ DOUBLE PRECISION │ 0       │ '0'        │ 0  │
│ 46  │ dPiedTaxe5   │ DOUBLE PRECISION │ 0       │ '0'        │ 0  │
│ 47  │ dPiedTaxe6   │ DOUBLE PRECISION │ 0       │ '0'        │ 0  │
│ 48  │ dPiedTaxe7   │ DOUBLE PRECISION │ 0       │ '0'        │ 0  │
│ 49  │ PiedTaxeInd0 │ UNSIGNED WORD(1) │ 0       │ ' '        │ 0  │
│ 50  │ PiedTaxeInd1 │ UNSIGNED WORD(1) │ 0       │ ' '        │ 0  │
│ 51  │ PiedTaxeInd2 │ UNSIGNED WORD(1) │ 0       │ ' '        │ 0  │
│ 52  │ PiedTaxeInd3 │ UNSIGNED WORD(1) │ 0       │ ' '        │ 0  │
│ 53  │ PiedTaxeInd4 │ UNSIGNED WORD(1) │ 0       │ ' '        │ 0  │
│ 54  │ PiedTaxeInd5 │ UNSIGNED WORD(1) │ 0       │ ' '        │ 0  │
│ 55  │ PiedTaxeInd6 │ UNSIGNED WORD(1) │ 0       │ ' '        │ 0  │
│ 56  │ PiedTaxeInd7 │ UNSIGNED WORD(1) │ 0       │ ' '        │ 0  │
└─────┴──────────────┴──────────────────┴─────────┴────────────┴────┘
I can't explain where the brackets come from in my table schema, I would like to do a table_info with a version of sqlite3.exe older than version 3.37.0 to see the difference. in the end, I managed to adapt my code to check the areas of tables.