From f8809e266320ac4f9776372c2139b58a78bcaaba Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 11 May 2006 12:11:42 +0000 Subject: [PATCH] Fixed a backwards compatibility issue with free result --- dlls/mysqlx/module.cpp | 2 +- dlls/mysqlx/oldcompat_sql.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dlls/mysqlx/module.cpp b/dlls/mysqlx/module.cpp index a8b05864..d3147653 100644 --- a/dlls/mysqlx/module.cpp +++ b/dlls/mysqlx/module.cpp @@ -8,7 +8,7 @@ void OnAmxxAttach() MF_AddNatives(g_BaseSqlNatives); MF_AddNatives(g_ThreadSqlNatives); MF_RegisterFunction(&g_Mysql, "GetSqlDriver"); - if (!MF_RequestFunction("GetDbDriver") || !MF_FindLibrary("SQLITE", LibType_Library)) + if (!MF_RequestFunction("GetDbDriver") && !MF_FindLibrary("SQLITE", LibType_Library)) { MF_AddNatives(g_OldCompatNatives); MF_AddLibraries("dbi", LibType_Class, &g_ident); diff --git a/dlls/mysqlx/oldcompat_sql.cpp b/dlls/mysqlx/oldcompat_sql.cpp index 9b330c40..3e283447 100644 --- a/dlls/mysqlx/oldcompat_sql.cpp +++ b/dlls/mysqlx/oldcompat_sql.cpp @@ -327,6 +327,12 @@ static cell AMX_NATIVE_CALL dbi_free_result(AMX *amx, cell *params) { cell *_r = MF_GetAmxAddr(amx, params[1]); cell num = *_r; + + if (!num) + { + return 1; + } + oldresult_s *oldrs = (oldresult_s *)GetHandle(num, Handle_OldResult); if (!oldrs) {