summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <acurtis/antony@ltamd64.xiphis.org>2006-12-26 12:33:21 -0800
committerunknown <acurtis/antony@ltamd64.xiphis.org>2006-12-26 12:33:21 -0800
commitcd1585c9258da5cad3c3905ad93526beb4a79a46 (patch)
treec404e0b5b76f15a67987df869260f7a0aba1dcaf /sql
parent2f7e36f686f1352cab19481db13afaa82adf8445 (diff)
parent6659b12bd1e84665596b0f53eb6d44ad92143a06 (diff)
downloadmariadb-git-cd1585c9258da5cad3c3905ad93526beb4a79a46.tar.gz
Merge xiphis.org:/home/antony/work2/mysql-5.1-engines
into xiphis.org:/home/antony/work2/mysql-5.1-engines-merge include/mysql.h: Auto merged mysql-test/Makefile.am: Auto merged sql/opt_range.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_insert.cc: Auto merged sql/sql_parse.cc: Auto merged storage/federated/ha_federated.cc: Auto merged storage/myisam/mi_check.c: Auto merged storage/myisam/mi_dynrec.c: Auto merged storage/myisam/mi_packrec.c: Auto merged storage/myisam/mi_range.c: Auto merged storage/myisam/mi_test1.c: Auto merged storage/myisam/mi_write.c: Auto merged storage/myisam/rt_split.c: Auto merged configure.in: fix merge conflict
Diffstat (limited to 'sql')
-rw-r--r--sql/opt_range.cc15
-rw-r--r--sql/sql_insert.cc3
-rw-r--r--sql/sql_parse.cc2
-rw-r--r--sql/sql_plugin.cc21
4 files changed, 22 insertions, 19 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index bd930ba91f4..929133841bc 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -1001,6 +1001,11 @@ QUICK_RANGE_SELECT::~QUICK_RANGE_SELECT()
if (file)
{
range_end();
+ if (head->key_read)
+ {
+ head->key_read= 0;
+ file->extra(HA_EXTRA_NO_KEYREAD);
+ }
if (free_file)
{
DBUG_PRINT("info", ("Freeing separate handler 0x%lx (free: %d)", (long) file,
@@ -1009,10 +1014,6 @@ QUICK_RANGE_SELECT::~QUICK_RANGE_SELECT()
file->close();
delete file;
}
- else
- {
- file->extra(HA_EXTRA_NO_KEYREAD);
- }
}
delete_dynamic(&ranges); /* ranges are allocated in alloc */
free_root(&alloc,MYF(0));
@@ -1194,7 +1195,11 @@ end:
org_file= head->file;
head->file= file;
/* We don't have to set 'head->keyread' here as the 'file' is unique */
- head->mark_columns_used_by_index(index);
+ if (!head->no_keyread)
+ {
+ head->key_read= 1;
+ head->mark_columns_used_by_index(index);
+ }
head->prepare_for_position();
head->file= org_file;
bitmap_copy(&column_bitmap, head->read_set);
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 85fe54c3f96..84133003462 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -1807,8 +1807,6 @@ void kill_delayed_threads(void)
delayed_insert *tmp;
while ((tmp=it++))
{
- /* Ensure that the thread doesn't kill itself while we are looking at it */
- pthread_mutex_lock(&tmp->mutex);
tmp->thd.killed= THD::KILL_CONNECTION;
if (tmp->thd.mysys_var)
{
@@ -1827,7 +1825,6 @@ void kill_delayed_threads(void)
}
pthread_mutex_unlock(&tmp->thd.mysys_var->mutex);
}
- pthread_mutex_unlock(&tmp->mutex);
}
VOID(pthread_mutex_unlock(&LOCK_delayed_insert)); // For unlink from list
}
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index bd336a5f038..01aa7565e28 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -7358,6 +7358,7 @@ bool mysql_create_index(THD *thd, TABLE_LIST *table_list, List<Key> &keys)
bzero((char*) &create_info,sizeof(create_info));
create_info.db_type= 0;
create_info.default_table_charset= thd->variables.collation_database;
+ create_info.row_type= ROW_TYPE_NOT_USED;
DBUG_RETURN(mysql_alter_table(thd,table_list->db,table_list->table_name,
&create_info, table_list,
fields, keys, 0, (ORDER*)0,
@@ -7374,6 +7375,7 @@ bool mysql_drop_index(THD *thd, TABLE_LIST *table_list, ALTER_INFO *alter_info)
bzero((char*) &create_info,sizeof(create_info));
create_info.db_type= 0;
create_info.default_table_charset= thd->variables.collation_database;
+ create_info.row_type= ROW_TYPE_NOT_USED;
alter_info->clear();
alter_info->flags= ALTER_DROP_INDEX;
DBUG_RETURN(mysql_alter_table(thd,table_list->db,table_list->table_name,
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 8cd4c661fb8..6385791a3db 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -951,29 +951,28 @@ my_bool plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func,
state_mask= ~state_mask; // do it only once
rw_rdlock(&THR_LOCK_plugin);
+ total= type == MYSQL_ANY_PLUGIN ? plugin_array.elements
+ : plugin_hash[type].records;
+ /*
+ Do the alloca out here in case we do have a working alloca:
+ leaving the nested stack frame invalidates alloca allocation.
+ */
+ plugins=(struct st_plugin_int **)my_alloca(total*sizeof(*plugins));
if (type == MYSQL_ANY_PLUGIN)
{
- total=plugin_array.elements;
- plugins=(struct st_plugin_int **)my_alloca(total*sizeof(*plugins));
for (idx= 0; idx < total; idx++)
{
plugin= dynamic_element(&plugin_array, idx, struct st_plugin_int *);
- if (plugin->state & state_mask)
- continue;
- plugins[idx]= plugin;
+ plugins[idx]= !(plugin->state & state_mask) ? plugin : NULL;
}
}
else
{
- HASH *hash= &plugin_hash[type];
- total=hash->records;
- plugins=(struct st_plugin_int **)my_alloca(total*sizeof(*plugins));
+ HASH *hash= plugin_hash + type;
for (idx= 0; idx < total; idx++)
{
plugin= (struct st_plugin_int *) hash_element(hash, idx);
- if (plugin->state & state_mask)
- continue;
- plugins[idx]= plugin;
+ plugins[idx]= !(plugin->state & state_mask) ? plugin : NULL;
}
}
rw_unlock(&THR_LOCK_plugin);