From 1d842f41523c89ed813104d7e5e15cb9567037a4 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Mon, 9 Jun 2014 01:59:02 +0300 Subject: [PATCH] sqlite3: Auto-execute non-select statements in execute(). --- sqlite3/sqlite3.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sqlite3/sqlite3.py b/sqlite3/sqlite3.py index 05f986ac..b73fd1db 100644 --- a/sqlite3/sqlite3.py +++ b/sqlite3/sqlite3.py @@ -88,6 +88,9 @@ class Cursor: print("stmnt", self.stmnt) self.num_cols = sqlite3_column_count(self.stmnt) print("num_cols", self.num_cols) + # If it's not select, actually execute it here + if not sql.startswith("SELECT"): + self.fetchone() def close(self): s = sqlite3_finalize(self.stmnt)