Commit 7df839e7 authored by monty@mysql.com's avatar monty@mysql.com

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)
parent 13b092d3
......@@ -9,6 +9,6 @@ strip=yes
extra_configs="$extra_configs --with-innodb --with-berkeley-db \
--with-embedded-server --enable-thread-safe-client \
--with-openssl --with-vio"
--with-openssl --with-vio --with-raid"
. "$path/FINISH.sh"
......@@ -1815,7 +1815,7 @@ AC_CHECK_FUNCS(alarm bmove \
sigset sigthreadmask pthread_sigmask pthread_setprio pthread_setprio_np \
pthread_setschedparam pthread_attr_setprio pthread_attr_setschedparam \
pthread_attr_create pthread_getsequence_np pthread_attr_setstacksize \
pthread_attr_getstacksize \
pthread_attr_getstacksize pthread_key_delete \
pthread_condattr_create rwlock_init pthread_rwlock_rdlock \
fsync fdatasync fchmod getpass getpassphrase initgroups mlockall)
......
......@@ -384,6 +384,11 @@ struct tm *localtime_r(const time_t *clock, struct tm *res);
#define pthread_condattr_destroy pthread_condattr_delete
#endif
/* FSU THREADS */
#if !defined(HAVE_PTHREAD_KEY_DELETE) && !defined(pthread_key_delete)
#define pthread_key_delete(A) pthread_dummy(0)
#endif
#ifdef HAVE_CTHREADS_WRAPPER /* For MacOSX */
#define pthread_cond_destroy(A) pthread_dummy(0)
#define pthread_mutex_destroy(A) pthread_dummy(0)
......
......@@ -430,4 +430,4 @@ dtuple_contains_null(
}
return(FALSE);
}
\ No newline at end of file
}
create database test_raid;
create table test_raid.r1 (i int) raid_type=1;
create table test_raid.r2 (i int) raid_type=1 raid_chunks=32;
drop database test_raid;
DROP TABLE IF EXISTS t1,t2;
CREATE TABLE t1 (
......
......@@ -9,6 +9,7 @@ enable_query_log;
create database test_raid;
create table test_raid.r1 (i int) raid_type=1;
create table test_raid.r2 (i int) raid_type=1 raid_chunks=32;
drop database test_raid;
DROP TABLE IF EXISTS t1,t2;
CREATE TABLE t1 (
......
......@@ -219,7 +219,7 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
/*
Removes files with known extensions plus all found subdirectories that
are 2 digits (raid directories).
are 2 hex digits (raid directories).
thd MUST be set when calling this function!
*/
......@@ -245,7 +245,10 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
DBUG_PRINT("info",("Examining: %s", file->name));
/* Check if file is a raid directory */
if (isdigit(file->name[0]) && isdigit(file->name[1]) &&
if ((isdigit(file->name[0]) ||
(file->name[0] >= 'a' && file->name[0] <= 'f')) &&
(isdigit(file->name[1]) ||
(file->name[1] >= 'a' && file->name[1] <= 'f')) &&
!file->name[2] && !level)
{
char newpath[FN_REFLEN];
......
......@@ -2823,6 +2823,8 @@ make_join_readinfo(JOIN *join,uint options)
{
uint i;
SELECT_LEX *select_lex = &(join->thd->lex.select_lex);
bool statistics= test(!(join->select_options & SELECT_DESCRIBE));
DBUG_ENTER("make_join_readinfo");
for (i=join->const_tables ; i < join->tables ; i++)
......@@ -2907,7 +2909,8 @@ make_join_readinfo(JOIN *join,uint options)
{
select_lex->options|=QUERY_NO_GOOD_INDEX_USED;
tab->read_first_record= join_init_quick_read_record;
statistic_increment(select_range_check_count, &LOCK_status);
if (statistics)
statistic_increment(select_range_check_count, &LOCK_status);
}
else
{
......@@ -2916,24 +2919,28 @@ make_join_readinfo(JOIN *join,uint options)
{
if (tab->select && tab->select->quick)
{
statistic_increment(select_range_count, &LOCK_status);
if (statistics)
statistic_increment(select_range_count, &LOCK_status);
}
else
{
select_lex->options|=QUERY_NO_INDEX_USED;
statistic_increment(select_scan_count, &LOCK_status);
if (statistics)
statistic_increment(select_scan_count, &LOCK_status);
}
}
else
{
if (tab->select && tab->select->quick)
{
statistic_increment(select_full_range_join_count, &LOCK_status);
if (statistics)
statistic_increment(select_full_range_join_count, &LOCK_status);
}
else
{
select_lex->options|=QUERY_NO_INDEX_USED;
statistic_increment(select_full_join_count, &LOCK_status);
if (statistics)
statistic_increment(select_full_join_count, &LOCK_status);
}
}
if (!table->no_keyread)
......
......@@ -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 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment