Merge branch '1.0'
This commit is contained in:
@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user