From d295f07c4281a45fc45aff95a151aeee117b2d8a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Feb 2004 09:12:23 +0100 Subject: Added testing of pthread_key_delete (to fix compile problem on SCO) (Bug #2461) DROP DATABASE now assumes RAID directories are in hex. (Bug #2627) Don't increment 'select_full_range' and similar statistics for EXPLAIN queries. (Bug #2506) Test in configure if pthread_key_delete() exists (to fix compile problem on SCO) (Bug #2461) BUILD/compile-pentium-max: Added --with-raid configure.in: Added testing of pthread_key_delete (to fix compile problem on SCO) (Bug #2461) include/my_pthread.h: Added testing of pthread_key_delete (to fix compile problem on SCO) (Bug #2461) innobase/include/data0data.ic: Added missing newline mysql-test/r/raid.result: Test of DROP DATABASE with RAID directories in hex mysql-test/t/raid.test: Test of DROP DATABASE with RAID directories in hex sql/sql_db.cc: DROP DATABASE could not drop databases with RAID tables that had more than 9 RAID_CHUNKS because DROP DATABASE assumed raid tables where in decimal while the RAID CREATE code assumed directories was in hex.(Bug #2627) sql/sql_select.cc: Don't increment 'select_full_range' and similar statistics for EXPLAIN queries. (Bug #2506) sql/sql_udf.cc: mysqld crashed if mysql.func table didn't exists (Bug #2577) --- sql/sql_udf.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'sql/sql_udf.cc') diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index 54613f82f00..431f8a13d28 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -116,6 +116,7 @@ void udf_init() udf_func *tmp; TABLE_LIST tables; READ_RECORD read_record_info; + TABLE *table; int error; DBUG_ENTER("ufd_init"); @@ -148,13 +149,11 @@ void udf_init() if (open_and_lock_tables(new_thd, &tables)) { DBUG_PRINT("error",("Can't open udf table")); - sql_print_error("Can't open mysql/func table"); - close_thread_tables(new_thd); - delete new_thd; - DBUG_VOID_RETURN; + sql_print_error("Can't open the mysql/func table. Please run the mysql_install_db script to create it."); + goto end; } - TABLE *table = tables.table; + table= tables.table; init_read_record(&read_record_info, new_thd, table, NULL,1,0); while (!(error = read_record_info.read_record(&read_record_info))) { @@ -200,6 +199,8 @@ void udf_init() sql_print_error(ER(ER_GET_ERRNO), my_errno); end_read_record(&read_record_info); new_thd->version--; // Force close to free memory + +end: close_thread_tables(new_thd); delete new_thd; /* Remember that we don't have a THD */ -- cgit v1.2.1 From 433c2bf535ff190933d7a7463c56bfef878b3cd2 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 19 Mar 2004 14:35:00 +0400 Subject: Fix for bug#1439 UDF Corruption --- sql/sql_udf.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sql/sql_udf.cc') diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index a4461beed29..561f79f9de1 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -298,7 +298,11 @@ udf_func *find_udf(const char *name,uint length,bool mark_used) DBUG_ENTER("find_udf"); /* TODO: This should be changed to reader locks someday! */ - rw_rdlock(&THR_LOCK_udf); + if (mark_used) + rw_wrlock(&THR_LOCK_udf); /* Called during fix_fields */ + else + rw_rdlock(&THR_LOCK_udf); /* Called during parsing */ + if ((udf=(udf_func*) hash_search(&udf_hash,(byte*) name, length ? length : (uint) strlen(name)))) { @@ -474,7 +478,7 @@ int mysql_drop_function(THD *thd,const LEX_STRING *udf_name) if (!(udf=(udf_func*) hash_search(&udf_hash,(byte*) udf_name->str, (uint) udf_name->length))) { - net_printf(thd, ER_FUNCTION_NOT_DEFINED, udf_name); + net_printf(thd, ER_FUNCTION_NOT_DEFINED, udf_name->str); goto err; } del_udf(udf); -- cgit v1.2.1