sqlite3 seems to ignore garbage at the end of some statements.
(1.1) Originally by L Carl (lcarlp) with edits by Richard Hipp (drh) on 2020-05-07 17:22:38 from 1.0 [source]
I ran across this by accident:
sqlite> select count(*) from (select * from log); 14479 sqlite> select count(*) from (select * from log)xxxxx; 14479 sqlite> .version SQLite 3.31.1 2020-01-27 19:55:54 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837bb4d6 zlib version 1.2.11 clang-11.0.0 sqlite>
I expected the xxxxx to throw an error. Based on discussions I’ve found, it’s possible this is a well known problem with SQLite, but I’m new here, and this seems like incorrect behavior to me, albeit not tragic. (I know my query is senseless. My original was more complicated.)
The 'xxxxx' is a "table-alias". You can see it at the bottom of the "table-or-subquery" syntax diagram shown below, right after the optional AS keyword.