We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 439b8ec commit d6d7eb7Copy full SHA for d6d7eb7
mvsqlite-preload/shim.c
@@ -91,17 +91,27 @@ int sqlite3_open16(
91
abort();
92
}
93
94
+static __thread int in_sqlite3_step = 0;
95
+
96
int sqlite3_step(sqlite3_stmt *pStmt) {
97
int ret;
98
int autocommit;
- sqlite3 *db = sqlite3_db_handle(pStmt);
99
+ sqlite3 *db;
100
101
+ if(in_sqlite3_step) {
102
+ return real_sqlite3_step(pStmt);
103
+ }
104
105
+ in_sqlite3_step = 1;
106
+ db = sqlite3_db_handle(pStmt);
107
108
while (1) {
109
autocommit = sqlite3_get_autocommit(db);
110
ret = real_sqlite3_step(pStmt);
111
if(ret == SQLITE_BUSY && mvsqlite_enabled && autocommit) {
112
mvsqlite_autocommit_backoff(db);
113
} else {
114
+ in_sqlite3_step = 0;
115
return ret;
116
117
0 commit comments