Merge branch '1.0'

This commit is contained in:
Alexey Kopytov
2017-06-07 22:39:46 +03:00
3 changed files with 23 additions and 3 deletions

View File

@ -885,12 +885,14 @@ int sb_lua_db_connect(lua_State *L)
sb_lua_ctxt_t * const ctxt = &tls_lua_ctxt;
ctxt->driver = db_create(NULL);
if (ctxt->driver == NULL) {
if (ctxt->driver == NULL)
{
luaL_error(L, "DB initialization failed");
lua_pushstring(L, ctxt->driver->sname);
lua_setglobal(L, "db_driver");
}
lua_pushstring(L, ctxt->driver->sname);
lua_setglobal(L, "db_driver");
if (ctxt->con != NULL)
return 0;