J. King, on Friday, May 17, 2019 07:19 AM, wrote...
>Perhaps I should have been clearer that this is a regression?
>
>SQLite version 3.13.0 2016-05-18 10:57:30
>Enter ".help" for usage hints.
>Connected to a transient in-memory database.
>Use ".open FILENAME" to reopen on a persistent database.
>sqlite> create table t(a text default '' /* comment */ );
>sqlite> pragma table_info(t);
>0|a|text|0|''|0
I am not disagreeing with you about the bug. That is a bug. The default value
should be an empty string (''). But, it does works on the original intension,
SQLite version 3.28.0 2019-04-16 19:49:53
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> create table t(a text, b text default '' /* comment */ );
sqlite> insert into t (a) values ('hi');
sqlite> select * from t;
hi|
and further more,
sqlite> insert into t (a,b) values ('hi');
Error: 1 values for 2 columns
sqlite> create table t0(a text, b text default 'bye' /* comment */ );
sqlite> insert into t0 (a) values ('hi');
sqlite> select * from t0;
hi|bye
But you are right, it should not display,
sqlite> select dflt_value from pragma_table_info('t') where name = 'b';
'' /* comment */
and furthermore,
sqlite> select dflt_value from pragma_table_info('t0') where name = 'b';
'bye' /* comment */
Thanks.
josé
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users