SQLite Forum

[bug?] Unexpected CLI shell comment handling
In recent versions of SQLite, I noticed single line comments in the sqlite3 command line tool behave weird.


knu@f7p3:~ $ sqlite3 test.db # a database with one table, t1
SQLite version 3.37.0 2021-10-01 21:01:07
Enter ".help" for usage hints.
sqlite> .tables
sqlite> -- .tables
   ...> ;
sqlite> SELECT name FROM sqlite_schema;
sqlite> -- SELECT name FROM sqlite_schema;
   ...> ;

Observed behavior: Line starting with -- requires continuation, and a ';' to complete.

Expected behavior: No continuation prompt.

Same behavior when processing redirected scripts with single line comments, as in:

sqlite3 test.db <script.sql

I didn't bisect it, but it must be a recent change, because I recompile from trunk almost weekly and just over a week ago one of my scripts suddenly failed by this peculiarity. 

Kind regards,
Kees Nuyt