summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2014-11-28 01:28:48 +0000
committerTed Trask <ttrask01@yahoo.com>2014-11-28 01:28:48 +0000
commita08d2d05987e3893f8f1e749579b04f9258150bb (patch)
tree898edd1564f9f965857d55503644b2e1daeb0edb
parentb76649d2b9f3c7a8a9d148c8b3ba9bbcdb25cc9b (diff)
downloadacf-lib-a08d2d05987e3893f8f1e749579b04f9258150bb.tar.bz2
acf-lib-a08d2d05987e3893f8f1e749579b04f9258150bb.tar.xz
Fix missing table detection for mysql
-rw-r--r--db.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/db.lua b/db.lua
index c34dce9..badf1f5 100644
--- a/db.lua
+++ b/db.lua
@@ -69,6 +69,8 @@ export.runsqlcommand = function(dbobject, sql, transaction)
local table
if dbobject.engine == mymodule.engine.postgresql then
table = string.match(err, "relation \"(%S+)\" does not exist")
+ elseif dbobject.engine == mymodule.engine.mysql then
+ table = string.match(err, "Table '[^.]*%.(%S+)' doesn't exist")
elseif dbobject.engine == mymodule.engine.sqlite3 then
table = string.match(err, "LuaSQL: no such table: (%S+)")
end
@@ -110,6 +112,8 @@ export.getselectresponse = function(dbobject, sql, transaction)
local table
if dbobject.engine == mymodule.engine.postgresql then
table = string.match(err, "relation \"(%S+)\" does not exist")
+ elseif dbobject.engine == mymodule.engine.mysql then
+ table = string.match(err, "Table '[^.]*%.(%S+)' doesn't exist")
elseif dbobject.engine == mymodule.engine.sqlite3 then
table = string.match(err, "LuaSQL: no such table: (%S+)")
end