diff options
author | Ted Trask <ttrask01@yahoo.com> | 2014-11-28 01:28:48 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2014-11-28 01:28:48 +0000 |
commit | a08d2d05987e3893f8f1e749579b04f9258150bb (patch) | |
tree | 898edd1564f9f965857d55503644b2e1daeb0edb | |
parent | b76649d2b9f3c7a8a9d148c8b3ba9bbcdb25cc9b (diff) | |
download | acf-lib-a08d2d05987e3893f8f1e749579b04f9258150bb.tar.bz2 acf-lib-a08d2d05987e3893f8f1e749579b04f9258150bb.tar.xz |
Fix missing table detection for mysql
-rw-r--r-- | db.lua | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 |