diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2017-02-26 18:22:38 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-26 18:22:38 +0300 |
commit | 4a926caf8e5fd8af771b2c34bfb6e91c732331fe (patch) | |
tree | bddaa3a91ef435b1b18716b8385a6415c55fbd13 /Lib/sqlite3 | |
parent | bpo-29648: import.rst: Add reference to create_module() (GH-290) (diff) | |
download | cpython-4a926caf8e5fd8af771b2c34bfb6e91c732331fe.tar.gz cpython-4a926caf8e5fd8af771b2c34bfb6e91c732331fe.tar.bz2 cpython-4a926caf8e5fd8af771b2c34bfb6e91c732331fe.zip |
bpo-28518: Start a transaction implicitly before a DML statement (#245)
Patch by Aviv Palivoda.
Diffstat (limited to 'Lib/sqlite3')
-rw-r--r-- | Lib/sqlite3/test/transactions.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/sqlite3/test/transactions.py b/Lib/sqlite3/test/transactions.py index 45f1b04c696..b8a13de55bc 100644 --- a/Lib/sqlite3/test/transactions.py +++ b/Lib/sqlite3/test/transactions.py @@ -179,6 +179,15 @@ class TransactionalDDL(unittest.TestCase): result = self.con.execute("select * from test").fetchall() self.assertEqual(result, []) + def CheckImmediateTransactionalDDL(self): + # You can achieve transactional DDL by issuing a BEGIN + # statement manually. + self.con.execute("begin immediate") + self.con.execute("create table test(i)") + self.con.rollback() + with self.assertRaises(sqlite.OperationalError): + self.con.execute("select * from test") + def CheckTransactionalDDL(self): # You can achieve transactional DDL by issuing a BEGIN # statement manually. |