SQLite in Fedora 39 is strict about using double quotes

Problem

You might have scripts that use the sqlite3 command line tool which use double-quotes (") around string literals. For example, something like:

echo 'select * from checkins where dataset="fedora";' |  sqlite3 bronto.db

This worked fine in Fedora Linux 38 and earlier, but in Fedora Linux 39, you’ll get

Parse error near line 1: no such column: fedora
  select * from checkins where dataset="fedora";
                         error here ---^

This might also affect software which uses SQLite as a library.

Cause

This is an intentional upstream change in SQLite 3.41.0. From the changelog:

The double-quoted string misfeature is now disabled by default for CLI builds. Legacy use cases can reenable the misfeature at run-time using the “.dbconfig dqs_dml on” and “.dbconfig dqs_ddl on” commands.

More details can be found on the SQLite “quirks” page: Double-quoted String Literals Are Accepted.

Temporary workarounds

  • Add .dbconfig dqs_dml on to ~/.sqliterc or to some other init script.
  • Or, run that command directly at the beginning of your sqlite script.

Solution

Fix your script to use single-quotes and double-quotes according to the standard.


You can discuss this issue here.

3 Likes