summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authormonty@hundin.mysql.fi <>2001-11-05 01:04:08 +0200
committermonty@hundin.mysql.fi <>2001-11-05 01:04:08 +0200
commit3afb157ca21925c53724425785ab0769397e3b45 (patch)
tree1750cfa3cfd660f20d5055a78caff42a53363247 /sql
parent5609e21d70ef10ee498e6a1559a92b9e55648e5d (diff)
downloadmariadb-git-3afb157ca21925c53724425785ab0769397e3b45.tar.gz
Fixes up things after merge from 3.23.44
Portability fixes. Don't delete temporary tables on FLUSH tables.
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_innobase.cc60
-rw-r--r--sql/log_event.cc9
2 files changed, 37 insertions, 32 deletions
diff --git a/sql/ha_innobase.cc b/sql/ha_innobase.cc
index dd72bb15473..4f3560290cf 100644
--- a/sql/ha_innobase.cc
+++ b/sql/ha_innobase.cc
@@ -2002,47 +2002,45 @@ ha_innobase::change_active_index(
index, even if it was internally generated by
InnoDB */
{
- row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt;
- KEY* key;
-
- statistic_increment(ha_read_key_count, &LOCK_status);
-
- DBUG_ENTER("index_read_idx");
+ row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt;
+ KEY* key;
- active_index = keynr;
+ statistic_increment(ha_read_key_count, &LOCK_status);
+ DBUG_ENTER("index_read_idx");
- if (keynr != MAX_KEY && table->keys > 0) {
- key = table->key_info + active_index;
+ active_index = keynr;
- prebuilt->index = dict_table_get_index_noninline(
- prebuilt->table, key->name);
- } else {
- prebuilt->index = dict_table_get_first_index_noninline(
- prebuilt->table);
- }
+ if (keynr != MAX_KEY && table->keys > 0)
+ {
+ key = table->key_info + active_index;
- if (!prebuilt->index) {
- fprintf(stderr,
- "InnoDB: Could not find key n:o %u with name %s from dict cache\n"
- "InnoDB: for table %s\n", keynr, key->name, prebuilt->table->name);
+ prebuilt->index=dict_table_get_index_noninline(prebuilt->table, key->name);
+ if (!prebuilt->index)
+ {
+ fprintf(stderr,
+ "InnoDB: Could not find key n:o %u with name %s from dict cache\n"
+ "InnoDB: for table %s\n", keynr, key->name,
+ prebuilt->table->name);
+ return(1);
+ }
+ }
+ else
+ prebuilt->index = dict_table_get_first_index_noninline(prebuilt->table);
- return(1);
- }
-
- assert(prebuilt->search_tuple);
+ assert(prebuilt->search_tuple);
- dtuple_set_n_fields(prebuilt->search_tuple, prebuilt->index->n_fields);
+ dtuple_set_n_fields(prebuilt->search_tuple, prebuilt->index->n_fields);
- dict_index_copy_types(prebuilt->search_tuple, prebuilt->index,
- prebuilt->index->n_fields);
+ dict_index_copy_types(prebuilt->search_tuple, prebuilt->index,
+ prebuilt->index->n_fields);
- /* Maybe MySQL changes the active index for a handle also
- during some queries, we do not know: then it is safest to build
- the template such that all columns will be fetched */
+ /* Maybe MySQL changes the active index for a handle also
+ during some queries, we do not know: then it is safest to build
+ the template such that all columns will be fetched */
- build_template(prebuilt, user_thd, table, ROW_MYSQL_WHOLE_ROW);
+ build_template(prebuilt, user_thd, table, ROW_MYSQL_WHOLE_ROW);
- DBUG_RETURN(0);
+ DBUG_RETURN(0);
}
/**************************************************************************
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 5bd386c7b29..6db0c3ef9f7 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -1657,14 +1657,21 @@ int Load_log_event::exec_event(NET* net, struct st_master_info* mi)
int Start_log_event::exec_event(struct st_master_info* mi)
{
+#ifdef TO_BE_DELETED
+ /*
+ We can't close temporary files or cleanup the tmpdir here, becasue
+ someone may have just rotated the logs on the master.
+ We should only do this cleanup when we know the master restarted.
+ */
close_temporary_tables(thd);
cleanup_load_tmpdir();
+#endif
return Log_event::exec_event(mi);
}
int Stop_log_event::exec_event(struct st_master_info* mi)
{
- if(mi->pos > 4) // stop event should be ignored after rotate event
+ if (mi->pos > 4) // stop event should be ignored after rotate event
{
close_temporary_tables(thd);
cleanup_load_tmpdir();