SQLite User Forum

Is this silent failure expected behavior?
Login

Is this silent failure expected behavior?

(1) By Jeffrey Friedl (jfriedl) on 2022-03-15 09:32:57 [source]

% echo "SELECT 'Hello world;" | sqlite3

%

Notice that the trailing single quote of the string literal is missing, so the SQL is ill-formed.

I hoped for an error message, but nothing was output. (I struggled with forum formatting, so it may look like a blank line was output, but there are no bytes of output.)

(2) By Larry Brasfield (larrybr) on 2022-03-15 09:55:09 in reply to 1 [link] [source]

It appears you have identified a regression. Past versions of the CLI shell have issued an error message and returned a non-zero exit status given that input. The current trunk tip does neither. I will investigate this.

(3) By Jeffrey Friedl (jfriedl) on 2022-03-15 14:10:28 in reply to 2 [link] [source]

Very kind, thank you.

(4) By Larry Brasfield (larrybr) on 2022-03-15 18:10:24 in reply to 3 [link] [source]

This has been fixed on trunk. Thanks for reporting this.

That regression was introduced when I eliminated an O(n^2) performance problem with SQL which spans an absurd number of input lines. It has been undocumented behavior that the shell will treat EOF as "submit any collected but unprocessed input as SQL", but that was happening before as a side-effect of the way input accumulation was processed. Now (with that fix), it does so explicitly.