mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Fixed INSERT DELAYED with Innobase
Fix for shutdown on NT Fixed bug when using wrong dates from blob field. BitKeeper/deleted/.del-df_crash.result~4a3dbee64843953d: Delete: mysql-test/r/df_crash.result BitKeeper/deleted/.del-df_crash.test~4c365178fe437f6: Delete: mysql-test/t/df_crash.test Docs/manual.texi: Changelog innobase/ib_config.h.in: automatic changed file innobase/ib_config.h: automatic changed file mysql-test/r/func_time.result: Test case for bug in time functions mysql-test/r/innobase.result: Test for INSERT DELAYED mysql-test/t/func_time.test: Test case for bug in time functions mysql-test/t/innobase.test: Test for INSERT DELAYED scripts/mysql_convert_table_format.sh: Added --socket and --port sql/ha_innobase.cc: Fix bug when compiling with SAFE_MUTEX Cleaner comment when using SHOW TABLE STATUS sql/mysqld.cc: Fix for shutdown on NT sql/sql_insert.cc: Fixed problem with Innobase and INSERT DELAYED sql/sql_udf.cc: Support for UDF on windows sql/time.cc: Fixed bug when using wrong dates from blob field. strings/ctype-tis620.c: Removed not used variable support-files/mysql-max.spec.sh: Removed old not used section BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
This commit is contained in:
@@ -35,10 +35,28 @@
|
||||
#endif
|
||||
|
||||
#include "mysql_priv.h"
|
||||
|
||||
#ifdef HAVE_DLOPEN
|
||||
extern "C"
|
||||
{
|
||||
#if defined(__WIN__)
|
||||
void* dlsym(void* lib,const char* name)
|
||||
{
|
||||
return GetProcAddress((HMODULE)lib,name);
|
||||
}
|
||||
void* dlopen(const char* libname,int unused)
|
||||
{
|
||||
return LoadLibraryEx(libname,NULL,0);
|
||||
}
|
||||
void dlclose(void* lib)
|
||||
{
|
||||
FreeLibrary((HMODULE)lib);
|
||||
}
|
||||
|
||||
#else
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <hash.h>
|
||||
}
|
||||
@@ -62,6 +80,7 @@ static udf_func *add_udf(char *name, Item_result ret, char *dl,
|
||||
static void del_udf(udf_func *udf);
|
||||
static void *find_udf_dl(const char *dl);
|
||||
|
||||
|
||||
static void init_syms(udf_func *tmp)
|
||||
{
|
||||
char nm[MAX_FIELD_NAME+16],*end;
|
||||
@@ -232,7 +251,7 @@ static void del_udf(udf_func *udf)
|
||||
uint name_length=udf->name_length;
|
||||
udf->name=(char*) "*";
|
||||
udf->name_length=1;
|
||||
hash_update(&udf_hash,(byte*) udf,name,name_length);
|
||||
hash_update(&udf_hash,(byte*) udf,(byte*) name,name_length);
|
||||
}
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
@@ -262,7 +281,7 @@ udf_func *find_udf(const char *name,uint length,bool mark_used)
|
||||
|
||||
/* TODO: This should be changed to reader locks someday! */
|
||||
pthread_mutex_lock(&THR_LOCK_udf);
|
||||
udf=(udf_func*) hash_search(&udf_hash,name,
|
||||
udf=(udf_func*) hash_search(&udf_hash,(byte*) name,
|
||||
length ? length : (uint) strlen(name));
|
||||
if (mark_used)
|
||||
udf->usage_count++;
|
||||
@@ -304,7 +323,7 @@ static udf_func *add_udf(char *name, Item_result ret, char *dl,
|
||||
tmp->returns = ret;
|
||||
tmp->type = type;
|
||||
tmp->usage_count=1;
|
||||
if (hash_insert(&udf_hash,(char*) tmp))
|
||||
if (hash_insert(&udf_hash,(byte*) tmp))
|
||||
return 0;
|
||||
using_udf_functions=1;
|
||||
return tmp;
|
||||
@@ -344,7 +363,7 @@ int mysql_create_function(THD *thd,udf_func *udf)
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&THR_LOCK_udf);
|
||||
if (hash_search(&udf_hash,udf->name, udf->name_length))
|
||||
if (hash_search(&udf_hash,(byte*) udf->name, udf->name_length))
|
||||
{
|
||||
net_printf(&thd->net, ER_UDF_EXISTS, udf->name);
|
||||
goto err;
|
||||
@@ -430,7 +449,7 @@ int mysql_drop_function(THD *thd,const char *udf_name)
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
pthread_mutex_lock(&THR_LOCK_udf);
|
||||
if (!(udf=(udf_func*) hash_search(&udf_hash,udf_name, (uint) strlen(udf_name))))
|
||||
if (!(udf=(udf_func*) hash_search(&udf_hash,(byte*) udf_name, (uint) strlen(udf_name))))
|
||||
{
|
||||
net_printf(&thd->net, ER_FUNCTION_NOT_DEFINED, udf_name);
|
||||
goto err;
|
||||
|
Reference in New Issue
Block a user