3.17.0 (bug?): ".mode" command ignoring ".separator" when -init used

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

3.17.0 (bug?): ".mode" command ignoring ".separator" when -init used

Dâniel Fraga
        3.17.0 release brings the following change:

In the command-line shell, enhance the ".mode" command so that it
restores the default column and row separators for modes "line",
"list", "column", and "tcl".

        ***

        I use the sqlite command-line shell with the option -init
pointing to a file with the following line:

.separator ,

        The problem is that with version 3.17.0 the .mode line
completely ignore the ".separator ," inside the "-init" file.

        The solution was to provide the ".separator ," again after
".mode line", but it seems redundant, since I already had specified it
in the "-init" file.

        Is this a bug or this is the expected behaviour since 3.17.0?

        Thanks!

--


_______________________________________________
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: 3.17.0 (bug?): ".mode" command ignoring ".separator" when -init used

Dâniel Fraga
On Tue, 14 Feb 2017 02:16:50 -0200
Dâniel Fraga <[hidden email]> wrote:

> The solution was to provide the ".separator ," again after
> ".mode line", but it seems redundant, since I already had specified it
> in the "-init" file.

        Sorry, I mean ".mode list", although it should affect ".mode
line" too, according to the changelog.

--


_______________________________________________
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: 3.17.0 (bug?): ".mode" command ignoring ".separator" when -init used

Richard Hipp-3
In reply to this post by Dâniel Fraga
On 2/13/17, Dâniel Fraga <[hidden email]> wrote:
>
> The problem is that with version 3.17.0 the .mode line
> completely ignore the ".separator ," inside the "-init" file.
>

It does not ignore it, it overwrites it.  The ".mode" command now
always also sets the ".separator" (to the default separator value) for
those modes where the separator is used.  This was added to work
around the unexpected behavior described by
http://stackoverflow.com/questions/41730574/sqlite-output-mode

--
D. Richard Hipp
[hidden email]
_______________________________________________
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: 3.17.0 (bug?): ".mode" command ignoring ".separator" when -init used

Dâniel Fraga
On Tue, 14 Feb 2017 07:57:17 -0500
Richard Hipp <[hidden email]> wrote:

> It does not ignore it, it overwrites it.  The ".mode" command now
> always also sets the ".separator" (to the default separator value) for
> those modes where the separator is used.  This was added to work
> around the unexpected behavior described by
> http://stackoverflow.com/questions/41730574/sqlite-output-mode
       
        Ok, but in the stackoverflow example, the user didn't set
".separator", so I understand it was a bug.

        In my case, I'm explicitly setting the .separator to ",", so it
shouldn't be overwritten. Otherwise, every time I use .mode, I'll have
to set the .separator afterward?

        A better solution would be to overwrite the separator *just* if
the user didn't set the separator, otherwise there's no reason anymore
to set the separator in the -init file, since we'll have to set the
separator every single time we use .mode.

--



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