Fix. `connected` method on LuaSQL backend.

This commit is contained in:
Alexey Melnichuk 2016-02-20 15:20:38 +03:00
parent 5afec68fb1
commit a33230db15
1 changed files with 5 additions and 1 deletions

View File

@ -94,7 +94,11 @@ function LuaSQLDatabase:release()
end
function LuaSQLDatabase:connected()
return self._dbh and self._dbh:connected()
if not self._dbh then
return false
end
local str = tostring(self._dbh)
return not string.find(str, 'closed')
end
end