From a08d2d05987e3893f8f1e749579b04f9258150bb Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Fri, 28 Nov 2014 01:28:48 +0000 Subject: Fix missing table detection for mysql --- db.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'db.lua') 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 -- cgit v1.2.3