SQLite 3.24.0 regression from enhanced "ALTER TABLE true/false DEFAULT" on TEXT field

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

SQLite 3.24.0 regression from enhanced "ALTER TABLE true/false DEFAULT" on TEXT field

chrisMCL
From "Enhance ALTER TABLE<https://www.sqlite.org/draft/lang_altertable.html> so that it recognizes "true" and "false" as valid arguments to DEFAULT" introduced in 3.24.0

A TEXT field can no longer have "true"/"false" default values.
The smart DEFAULT conversion should not be triggered if the hint is TEXT.

Although SQLite is typeless, table datatype hint could be use in this use scenario.

Steps to reproduce
sqlite> CREATE TABLE "Table_1" ([ID] TEXT DEFAULT "false", [Field_1] TEXT NULL);
sqlite> insert into "Table_1" (Field_1) VALUES ("test");
sqlite> select * from Table_1;
0|test

Expected result
false|test

Christian Nols
Software Engineer
________________________________
[hidden email]
Tel : + 32 2 724 35 19

MCL
NYSDAM Building
avenue Reine Astrid 92, 3rd floor
1310 La Hulpe- Belgium
BCE registered number 2.087.817.310
Tel : + 32 2 724 35 00 - Fax : + 32 2 724 35 04
www.mcl-collection.com<http://www.mcl-collection.com/>

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: [EXTERNAL] SQLite 3.24.0 regression from enhanced "ALTER TABLE true/false DEFAULT" on TEXT field

Hick Gunter
Please retry with correct string quoting, i.e. single quotes. Double quotes are reserved for identifiers and interpreted as strings only if there is no such identifier.

"false" (double quotes) is an identifier, 'false' (single quotes) is a string.

-----Urspr√ľngliche Nachricht-----
Von: sqlite-users [mailto:[hidden email]] Im Auftrag von Christian Nols
Gesendet: Freitag, 11. Jänner 2019 13:03
An: [hidden email]
Cc: Mcl development <[hidden email]>
Betreff: [EXTERNAL] [sqlite] SQLite 3.24.0 regression from enhanced "ALTER TABLE true/false DEFAULT" on TEXT field

From "Enhance ALTER TABLE<https://www.sqlite.org/draft/lang_altertable.html> so that it recognizes "true" and "false" as valid arguments to DEFAULT" introduced in 3.24.0

A TEXT field can no longer have "true"/"false" default values.
The smart DEFAULT conversion should not be triggered if the hint is TEXT.

Although SQLite is typeless, table datatype hint could be use in this use scenario.

Steps to reproduce
sqlite> CREATE TABLE "Table_1" ([ID] TEXT DEFAULT "false", [Field_1]
sqlite> TEXT NULL); insert into "Table_1" (Field_1) VALUES ("test");
sqlite> select * from Table_1;
0|test

Expected result
false|test

Christian Nols
Software Engineer
________________________________
[hidden email]
Tel : + 32 2 724 35 19

MCL
NYSDAM Building
avenue Reine Astrid 92, 3rd floor
1310 La Hulpe- Belgium
BCE registered number 2.087.817.310
Tel : + 32 2 724 35 00 - Fax : + 32 2 724 35 04 www.mcl-collection.com<http://www.mcl-collection.com/>

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___________________________________________
 Gunter Hick | Software Engineer | Scientific Games International GmbH | Klitschgasse 2-4, A-1130 Vienna | FN 157284 a, HG Wien, DVR: 0430013 | (O) +43 1 80100 - 0

May be privileged. May be confidential. Please delete if not the addressee.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQLite 3.24.0 regression from enhanced "ALTER TABLE true/false DEFAULT" on TEXT field

J. King-3
In reply to this post by chrisMCL
On January 11, 2019 7:03:03 AM EST, Christian Nols <[hidden email]> wrote:

>From "Enhance ALTER
>TABLE<https://www.sqlite.org/draft/lang_altertable.html> so that it
>recognizes "true" and "false" as valid arguments to DEFAULT" introduced
>in 3.24.0
>
>A TEXT field can no longer have "true"/"false" default values.
>The smart DEFAULT conversion should not be triggered if the hint is
>TEXT.
>
>Although SQLite is typeless, table datatype hint could be use in this
>use scenario.
>
>Steps to reproduce
>sqlite> CREATE TABLE "Table_1" ([ID] TEXT DEFAULT "false", [Field_1]
>TEXT NULL);
>sqlite> insert into "Table_1" (Field_1) VALUES ("test");
>sqlite> select * from Table_1;
>0|test
>
>Expected result
>false|test
>
>Christian Nols
>Software Engineer
>________________________________
>[hidden email]
>Tel : + 32 2 724 35 19
>
>MCL
>NYSDAM Building
>avenue Reine Astrid 92, 3rd floor
>1310 La Hulpe- Belgium
>BCE registered number 2.087.817.310
>Tel : + 32 2 724 35 00 - Fax : + 32 2 724 35 04
>www.mcl-collection.com<http://www.mcl-collection.com/>
>
>_______________________________________________
>sqlite-users mailing list
>[hidden email]
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

The default should be defined as string 'true', not identifier "true".
--
J. King
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQLite 3.24.0 regression from enhanced "ALTER TABLE true/false DEFAULT" on TEXT field

chrisMCL
Thanks !



--
Sent from: http://sqlite.1065341.n5.nabble.com/
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users