Author maggyero
Recipients Jeremy Banks, Jim.Jewett, Mark.Bucciarelli, Ronny.Pfannschmidt, adamtj, asvetlov, aymeric.augustin, berker.peksag, bkircher, bulb, carlwgeorge, dholth, flox, ghaering, maggyero, malin, monsanto, ned.deily, pitrou, python-dev, r.david.murray, scott.urban, steve.dower, torsten, tshepang, zzzeek
Date 2020-01-25.00:23:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1579911819.54.0.258685162008.issue10740@roundup.psfhosted.org>
In-reply-to
Content
With Berker Peksag's patch merged in 2016, in the default non auto-commit mode, sqlite3 implicitly issues a BEGIN statement before any non SELECT statement not already in a transaction, EXCEPT DDL statements, for backwards compatibility reasons:

+    /* For backwards compatibility reasons, do not start a transaction if a
+       DDL statement is encountered.  If anybody wants transactional DDL,
+       they can issue a BEGIN statement manually. */
+    if (self->connection->begin_statement && !sqlite3_stmt_readonly(self->statement->st) && !self->statement->is_ddl) {
+        if (sqlite3_get_autocommit(self->connection->db)) {
+            result = _pysqlite_connection_begin(self->connection);
+            if (!result) {
+                goto error;
+            }
+            Py_DECREF(result);
         }
     }

Is there any plan to cover DDL statements as well in a future Python version and deprecate the old behaviour? That would avoid having to insert BEGIN statements manually for getting transactional DDL statements, like in psycopg2 for PostgreSQL databases.
History
Date User Action Args
2020-01-25 00:23:39maggyerosetrecipients: + maggyero, ghaering, pitrou, ned.deily, Jeremy Banks, r.david.murray, zzzeek, asvetlov, flox, adamtj, dholth, torsten, monsanto, scott.urban, aymeric.augustin, tshepang, python-dev, Ronny.Pfannschmidt, berker.peksag, Mark.Bucciarelli, Jim.Jewett, steve.dower, malin, bulb, bkircher, carlwgeorge
2020-01-25 00:23:39maggyerosetmessageid: <1579911819.54.0.258685162008.issue10740@roundup.psfhosted.org>
2020-01-25 00:23:39maggyerolinkissue10740 messages
2020-01-25 00:23:39maggyerocreate