summaryrefslogtreecommitdiff
path: root/sql/ha_partition.cc
diff options
context:
space:
mode:
authorunknown <jani@hynda.mysql.fi>2007-11-14 16:32:03 +0200
committerunknown <jani@hynda.mysql.fi>2007-11-14 16:32:03 +0200
commit94078aa9283a1db1e6fe612169c5e650aa1733c6 (patch)
tree370a898ba665a98fe82dbd6ab8d039f5e4199e2e /sql/ha_partition.cc
parent4f6c7eece38d8ff0443df88fb4197bdf61757740 (diff)
parentb3a71e34487b69846553111448fa2b32c86176a9 (diff)
downloadmariadb-git-94078aa9283a1db1e6fe612169c5e650aa1733c6.tar.gz
Merge hynda.mysql.fi:/home/my/mysql-5.1-main
into hynda.mysql.fi:/home/my/mysql-5.1-marvel include/my_sys.h: Auto merged sql/ha_partition.cc: Auto merged sql/handler.cc: Auto merged sql/item_func.cc: Auto merged sql/opt_range.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/table.cc: Auto merged storage/myisam/ft_boolean_search.c: Auto merged storage/myisam/ft_parser.c: Auto merged storage/myisam/mi_check.c: Auto merged
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r--sql/ha_partition.cc21
1 files changed, 16 insertions, 5 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 8e7cd1480d0..8b1833d3019 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -1599,6 +1599,7 @@ error:
void ha_partition::update_create_info(HA_CREATE_INFO *create_info)
{
m_file[0]->update_create_info(create_info);
+ create_info->data_file_name= create_info->index_file_name = NULL;
return;
}
@@ -2678,7 +2679,8 @@ int ha_partition::write_row(uchar * buf)
uint32 part_id;
int error;
longlong func_value;
- bool autoincrement_lock= false;
+ bool autoincrement_lock= FALSE;
+ my_bitmap_map *old_map;
#ifdef NOT_NEEDED
uchar *rec0= m_rec0;
#endif
@@ -2705,8 +2707,17 @@ int ha_partition::write_row(uchar * buf)
use autoincrement_lock variable to avoid unnecessary locks.
Probably not an ideal solution.
*/
- autoincrement_lock= true;
- pthread_mutex_lock(&table_share->mutex);
+ if (table_share->tmp_table == NO_TMP_TABLE)
+ {
+ /*
+ Bug#30878 crash when alter table from non partitioned table
+ to partitioned.
+ Checking if tmp table then there is no need to lock,
+ and the table_share->mutex may not be initialised.
+ */
+ autoincrement_lock= TRUE;
+ pthread_mutex_lock(&table_share->mutex);
+ }
error= update_auto_increment();
/*
@@ -2715,10 +2726,10 @@ int ha_partition::write_row(uchar * buf)
the correct partition. We must check and fail if neccessary.
*/
if (error)
- DBUG_RETURN(error);
+ goto exit;
}
- my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set);
+ old_map= dbug_tmp_use_all_columns(table, table->read_set);
#ifdef NOT_NEEDED
if (likely(buf == rec0))
#endif