From: Kevin Jurczyk Date: Tue, 8 Nov 2016 17:12:16 +0000 (-0500) Subject: Add quotes around PRAGMA values in pysqlcipher connect. X-Git-Tag: rel_1_1_4~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b141f9f3c8c5c7348daff5aa2a30850c3bf673ba;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Add quotes around PRAGMA values in pysqlcipher connect. Arguments such as cipher, kdf_iter, cipher_page_size and cipher_use_hmac may (always?) require quotes within the PRAGMA directive. Change-Id: I2c808f34e1c44f0593b72b304e170e4af0a6035a Pull-request: https://github.com/zzzeek/sqlalchemy/pull/319 --- diff --git a/doc/build/changelog/changelog_11.rst b/doc/build/changelog/changelog_11.rst index d8f785556a..4c8bdc7d96 100644 --- a/doc/build/changelog/changelog_11.rst +++ b/doc/build/changelog/changelog_11.rst @@ -21,6 +21,13 @@ .. changelog:: :version: 1.1.4 + .. change:: + :tags: bug, sqlite + + Added quotes to the PRAGMA directives in the pysqlcipher dialect + to support additional cipher arguments appropriately. Pull request + courtesy Kevin Jurczyk. + .. change:: :tags: bug, postgresql :tickets: 3846, 3807 diff --git a/lib/sqlalchemy/dialects/sqlite/pysqlcipher.py b/lib/sqlalchemy/dialects/sqlite/pysqlcipher.py index bbafc8d60c..4a501acacc 100644 --- a/lib/sqlalchemy/dialects/sqlite/pysqlcipher.py +++ b/lib/sqlalchemy/dialects/sqlite/pysqlcipher.py @@ -100,7 +100,7 @@ class SQLiteDialect_pysqlcipher(SQLiteDialect_pysqlite): conn.execute('pragma key="%s"' % passphrase) for prag, value in pragmas.items(): if value is not None: - conn.execute('pragma %s=%s' % (prag, value)) + conn.execute('pragma %s="%s"' % (prag, value)) return conn