From 56d07c65e3966566c3e50045fc72f6a36ea0bcd6 Mon Sep 17 00:00:00 2001 From: Pixel Date: Thu, 8 Oct 2009 10:08:47 -0700 Subject: Fixing once and for all that ugly baby of to_charp and extract from String, and fixing a couple of minor issues with dblib.lua --- lib/dblib.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/dblib.lua') diff --git a/lib/dblib.lua b/lib/dblib.lua index a47b755..f9130be 100644 --- a/lib/dblib.lua +++ b/lib/dblib.lua @@ -905,7 +905,7 @@ END; if query_type == "update" or query_type == "raw" then if query_type == "update" then - str = str:gsub(" *(.*) *;", "%1") + str = str:gsub("%s*(.*)%s*;", "%1") end db._.affectedRows = stmt:executeUpdate(str) if db._.affectedRows == nil then @@ -923,7 +923,7 @@ END; r = 0 end elseif query_type == "query" then - str = str:gsub(" *(.*) *;", "%1") + str = str:gsub("%s*(.*)%s*;", "%1") local rset = stmt:executeQuery(str) if rset then db._.errNO = 0 @@ -1122,6 +1122,9 @@ luadb = { id = id._.id end conn = l_env:createConnection(user, password, base) + if not conn then + return nil, l_env:getErrorCode(), l_env:getErrorMsg() + end return { opentable = _luadb.opentable, SafeQuery = _luadb.oracle.SafeQuery, -- cgit v1.2.3