Unexpected echo when setting locking_mode

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Unexpected echo when setting locking_mode

Yannick Duchêne
Hello there,

I believe I found a tiny bug, nothing bad, but may pollute some output.

Using SQLite version 3.20.1, if I do this:

    PRAGMA locking_mode=exclusive;

It writes an unexpected reply:

    exclusive

It do as if I was requesting the actual value, as in this:

    PRAGMA locking_mode;

If I do this, for an example other pragma:

    PRAGMA auto_vacuum=none;

It works as expected, there is no unexpected output.

--
Yannick Duchêne
_______________________________________________
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: Unexpected echo when setting locking_mode

Kees Nuyt
On Sat, 18 Nov 2017 22:53:26 +0100, Yannick Duchêne
<[hidden email]> wrote:

>I believe I found a tiny bug, nothing bad, but may pollute some output.
>
>Using SQLite version 3.20.1, if I do this:
>
>    PRAGMA locking_mode=exclusive;
>
>It writes an unexpected reply:
>
>    exclusive

The same happens for
        pragma journal_mode=wal;

, although it's less intrusive than locking_mode , because
journal_mode will typically only be issued at database creation.
--
Regards,
Kees Nuyt

_______________________________________________
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: Unexpected echo when setting locking_mode

Simon Slavin-3


On 19 Nov 2017, at 2:01am, Kees Nuyt <[hidden email]> wrote:

> The same happens for
> pragma journal_mode=wal;

Perhaps the PRAGMAs should be reviewed for consistency: that all PRAGMAs which change values should output their new value.

This might provide a useful piece of diagnostic information for some users.  For example suppose someone changes the page_size using this:

        PRAGMA page_size = 16384;

They change page_size to 16384 but they don’t know that that works only for an empty database, or after a VACUUM.  The PRAGMA outputs 4096 and, although they don’t yet know why, they do at least know that their change didn’t work properly.

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