Jose Isaias Cabrera, on Friday, May 17, 2019 08:28 AM, wrote...
>J. King, on Friday, May 17, 2019 07:19 AM, wrote...
>>Perhaps I should have been clearer that this is a regression?
>>
I know, overkill, but here is another look at it,
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 t0
...> (
...> a text,
...> b text default 'bye'
...> /* comment */
...> );
sqlite> create table t1
...> (
...> a text default 'hi', -- this is a comment for a
...> b text default 'bye', /* this is a comment for b */
...> c int default 0
...> /* this is a comment for c */
...> );
sqlite>
sqlite> create table t2
...> (
...> a text default 'hi', /* this is a comment for c */
...> b text default 'bye', /* this is a comment for b */
...> c INTEGER default 0
...> -- this is a comment for c
...> );
sqlite> .schema
CREATE TABLE t0
(
a text,
b text default 'bye'
/* comment */
);
CREATE TABLE t1
(
a text default 'hi', -- this is a comment for a
b text default 'bye', /* this is a comment for b */
c int default 0
/* this is a comment for c */
);
CREATE TABLE t2
(
a text default 'hi', /* this is a comment for c */
b text default 'bye', /* this is a comment for b */
c INTEGER default 0
-- this is a comment for c
);
sqlite> insert into t0 (a) values ('Hi');
sqlite> select * from t0;
Hi|bye
sqlite> insert into t1 (a) values ('Hi');
sqlite> select * from t1;
Hi|bye|0
sqlite> insert into t2 (a) values ('Hi');
sqlite> select * from t2;
Hi|bye|0
sqlite>
sqlite> select dflt_value from pragma_table_info('t1') where name = 'a';
'hi'
sqlite> select dflt_value from pragma_table_info('t1') where name = 'b';
'bye'
sqlite> select dflt_value from pragma_table_info('t1') where name = 'c';
0
/* this is a comment for c */
sqlite> select dflt_value from pragma_table_info('t2') where name = 'a';
'hi'
sqlite> select dflt_value from pragma_table_info('t2') where name = 'b';
'bye'
sqlite> select dflt_value from pragma_table_info('t2') where name = 'c';
0
-- this is a comment for c
sqlite>
Just found it interesting that in t1 and t2, column c, even though it is an
INT, or INTEGER with default 0, and a new line, it still shows the comment.
Yes, I know that they are all treated as text. :-) Thanks.
josé
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users