________________________________
From: Ryan Johnson <[email protected]>
To: [email protected]
Sent: Monday, January 28, 2013 12:54 PM
Subject: Re: [sqlite] SQLite3 Bug Report: The shell accepts some dot commands
ending in semicolons while rejecting others.
On 28/01/2013 12:08 PM, Larry Brasfield wrote:
> Nathan Chung wrote:
>> *Summary:
>> The SQLite3 shell accepts some dot commands ending in semicolons while
>> rejecting others without displaying proper error messages. The
>> behavior of the dot commands could be more consistent. Examples
>> include "header off;" and "header on;". The shell accepts "header
>> off;" while rejecting "header on;" without a proper error message.
>
> 7. There may be other dot commands displaying other inconsistent
>> behaviors. I have only verified the issue with "header on;" and
>> "header off;".
>
> The code for the shell command decoder is not written to perform as you
> expect. It is very simple, (which is also a virtue), and >focused on
> accepting correctly composed commands. The shell is considered to be a tool
> for easily performing basic operations >upon a SQLite database, in the hands
> of more software-savvy people than those who would be lost without detailed
> and >"consistent" error reporting. I dare say that said code, if modified to
> meet your expectations, would be less suited to its purpose, >harder to
> maintain and understand, and would divert effort from SQLite itself. I say
> this as one who has found reason to modify >that code and who is glad that
> part of the task consumed little time.
>".header on;" -- does nothing
>".header off;" -- disables headers
>I'm with OP on this one. The error message doesn't need to be "helpful" -- in
>fact I'm fine if it accepts semicolons, given that >most things you type in
>the shell require them. Turning apparently-successful commands into no-ops is
>never a good idea, though.
>My guess is that it's trivial to fix, especially if the decision is to allow
>semicolons and other trailing garbage (though `.header foo' >would still
>silently "succeed"). Probably a one-liner along the lines of
>s/strcmp/strncmp/, or some such.
>$0.02
>Ryan
Actually, it looks like anything except ".header on" will turn headers off.
That includes ".header on;" (with semicolon - it doesn't do nothing, it turns
the headers off) or ".header off;" (with or without semincolon.) or ".header ;"
(with a space and semicolon but no text.)
I could only get it to return error text with .header or .header; (no space
before semicolon.)
.explain behaves the same way. "on;" is treated the same as "off" or "foo".
(At least with version 3.7.0 which is what I had handy to test with.)
David
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users