SQLite Forum

use of "notnull" and "unique" in column names
Login
Do you mind clarifying exactly which version of SQLite is doing this?

I cannot reproduce the problem on my side - here is the same query you mentioned, first with the good quoted column name and second with the unquoted column name.

The second one fails as it should, but it does so immediately and with a sane error and error report - nothing about being "out of memory":

```
  -- SQLite version 3.35.4  [ Release: 2021-04-02 ]  on  SQLitespeed version 2.1.3.11.
  -- ================================================================================================

SELECT cid, name, type, "notnull", dflt_value, pk
  FROM pragma_table_info('language_list');

  -- cid|name           |type     |notnull|dflt_value       | pk
  -- ---|---------------|---------|-------|-----------------|---
  --  0 |id             |INTEGER  |   0   |NULL             | 1 
  --  1 |iso639_1_code  |TEXT     |   1   |NULL             | 0 
  --  2 |language_key   |TEXT     |   1   |NULL             | 0 
  --  3 |change_cookie  |INT      |   1   |0                | 0 
  --  4 |language       |TEXT     |   1   |NULL             | 0 
  --  5 |native_name    |TEXT     |   1   |NULL             | 0 
  --  6 |added          |NUMERIC  |   1   |datetime('now')  | 0 



SELECT cid, name, type, notnull, dflt_value, pk
  FROM pragma_table_info('language_list');

  -- ------------------------------------------------------------------------------------------------

  -- 2022-01-14 16:26:21.790  |  [Info]       Script failed - Rolling back...
  -- 2022-01-14 16:26:21.790  |  [Success]    Transaction Rolled back.
  -- 2022-01-14 16:26:21.790  |  [ERROR]      Failed to complete: 
  -- -------  DB-Engine Logs (Contains logged information from all DB connections during run)  ------
  -- [2022-01-14 16:26:21.744] APPLICATION : Script D:\Documents\SQLiteAutoScript.sql started at 16:26:21.744 on 14 January.
  -- [2022-01-14 16:26:21.789] ERROR (1)   : near "notnull": syntax error in "SELECT cid, name, type, notnull, dflt_value, pk
  FROM pragma_table_info('language_list');"
  -- [2022-01-14 16:26:21.789] QUERY       : Failed Query: SELECT cid, name, type, notnull, dflt_value, pk    FROM pragma_table_info('language_list');  
  -- [2022-01-14 16:26:21.789] INTERFACE   : DB Error: near "notnull": syntax error
  -- ================================================================================================

```