summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/dblib.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/dblib.lua b/lib/dblib.lua
index 64ce880..3840657 100644
--- a/lib/dblib.lua
+++ b/lib/dblib.lua
@@ -1078,7 +1078,9 @@ luadb = {
-- get into a registry to fetch "id"
-- else
-- end
+ local olddb
if type(id) == "table" and type(id._) == "table" then
+ olddb = id
user = id._.user
password = id._.password
base = id._.base
@@ -1086,6 +1088,7 @@ luadb = {
id = id._.id
end
db = SQLConnection(id, user, password, base)
+ if olddb then olddb._.conn = db end
return {
opentable = _luadb.opentable,
SafeQuery = _luadb.mysql.SafeQuery,
@@ -1119,7 +1122,9 @@ luadb = {
l_env:setExceptions(false)
end
+ local olddb
if type(id) == "table" and type(id._) == "table" then
+ olddb = id
user = id._.user
password = id._.password
base = id._.base
@@ -1130,6 +1135,7 @@ luadb = {
if not conn then
return nil, l_env:getErrorCode(), l_env:getErrorMsg()
end
+ if olddb then olddb._.conn = conn end
return {
opentable = _luadb.opentable,
SafeQuery = _luadb.oracle.SafeQuery,