summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2017-07-03 18:02:45 +0000
committerTed Trask <ttrask01@yahoo.com>2017-07-03 18:02:45 +0000
commit67a900259f2faf1ff5e2f79627bc019643a18da6 (patch)
treed86ae1f998de61b5fbc5de2a9164e12811e6b20d
parent52d26708d66a9b6e99b1c586f55fb6e80234763b (diff)
downloadacf-lib-67a900259f2faf1ff5e2f79627bc019643a18da6.tar.bz2
acf-lib-67a900259f2faf1ff5e2f79627bc019643a18da6.tar.xz
Fix db table creation bugs when in transaction
-rw-r--r--db.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/db.lua b/db.lua
index 442f484..0ce8b34 100644
--- a/db.lua
+++ b/db.lua
@@ -80,8 +80,8 @@ export.runsqlcommand = function(dbobject, sql, transaction)
end
if table and dbobject.table_creation_scripts and dbobject.table_creation_scripts[table] then
if transaction then assert(dbobject.con:execute("ROLLBACK TO before_command")) end
- dbobject.runscript(dbobject.table_creation_scripts[table])
- dbobject.runsqlcommand(sql)
+ dbobject.runscript(dbobject.table_creation_scripts[table], transaction)
+ dbobject.runsqlcommand(sql, transaction)
else
assert(res, err)
end
@@ -127,9 +127,9 @@ export.getselectresponse = function(dbobject, sql, transaction)
table = string.match(err, "LuaSQL: no such table: (%S+)")
end
if table and dbobject.table_creation_scripts and dbobject.table_creation_scripts[table] then
- if transaction then assert(con:execute("ROLLBACK TO before_select")) end
- dbobject.runscript(dbobject.table_creation_scripts[table])
- return dbobject.getselectresponse(sql)
+ if transaction then assert(dbobject.con:execute("ROLLBACK TO before_select")) end
+ dbobject.runscript(dbobject.table_creation_scripts[table], transaction)
+ return dbobject.getselectresponse(sql, transaction)
else
assert(res, err)
end