pragma statement not parsing argument as 'numeric-literal'

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

pragma statement not parsing argument as 'numeric-literal'

john brzustowski
Hi folks,
The syntax diagram for the PRAGMA statement here:

reaches the "numeric-literal" production for its argument, but the
parser doesn't seem to do so:

   sqlite> PRAGMA busy_timeout=3e+5;

   ## platform / version:

   $ uname --all
   Linux sgdata 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u2 (2016-10-19) x86_64 GNU/Linux
   $ sqlite3 --version
   3.16.2 2017-01-06 16:32:41 a65a62893ca8319e89e48b8a38cf8a59c69a8209

So a user who isn't being careful enough (i.e. me) and supplies a
calculated milliseconds value that happens to be formatted in
exponential notation as above is getting a 3 millisecond (not 5
minute) busy_timeout.  And that same careless user is likely
(i.e. was) not checking what the PRAGMA statement prints.

I'm only reporting this because it (i.e. user carelessness) turned out
to be the cause of a long-sought bug in some of my own code.
Hopefully, just this report might save someone else similar grief.

Key phrases:
interprocess database-locking, pragma busy_timeout, database is locked


John B.
sqlite-users mailing list
[hidden email]