Below is the list of changes that have just been committed into a local
5.1 repository of reggie. When reggie does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2077 06/01/25 13:10:00 reggie@stripped +7 -0
Merge rburnett@stripped:/home/bk/mysql-5.1-new
into linux.site:/home/reggie/work/mysql-5.1-bug14354
mysql-test/t/partition_mgm_err.test
1.6 06/01/25 13:09:55 reggie@stripped +0 -0
SCCS merged
sql/sql_partition.cc
1.27 06/01/25 13:06:53 reggie@stripped +0 -0
Auto merged
sql/sql_parse.cc
1.513 06/01/25 13:06:53 reggie@stripped +0 -0
Auto merged
sql/mysql_priv.h
1.374 06/01/25 13:06:53 reggie@stripped +0 -0
Auto merged
sql/ha_partition.h
1.10 06/01/25 13:06:53 reggie@stripped +0 -0
Auto merged
sql/ha_partition.cc
1.24 06/01/25 13:06:53 reggie@stripped +0 -0
Auto merged
mysql-test/r/partition_mgm_err.result
1.6 06/01/25 13:06:52 reggie@stripped +0 -1
Auto merged
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: reggie
# Host: linux.site
# Root: /home/reggie/work/mysql-5.1-bug14354/RESYNC
--- 1.373/sql/mysql_priv.h 2006-01-23 06:02:38 -06:00
+++ 1.374/sql/mysql_priv.h 2006-01-25 13:06:53 -06:00
@@ -649,6 +649,8 @@
char* packet, uint packet_length);
void log_slow_statement(THD *thd);
bool check_dup(const char *db, const char *name, TABLE_LIST *tables);
+bool append_file_to_dir(THD *thd, const char **filename_ptr,
+ const char *table_name);
bool table_cache_init(void);
void table_cache_free(void);
--- 1.512/sql/sql_parse.cc 2006-01-23 01:59:21 -06:00
+++ 1.513/sql/sql_parse.cc 2006-01-25 13:06:53 -06:00
@@ -68,8 +68,6 @@
static bool check_multi_update_lock(THD *thd);
static void remove_escape(char *name);
static void refresh_status(THD *thd);
-static bool append_file_to_dir(THD *thd, const char **filename_ptr,
- const char *table_name);
const char *any_db="*any*"; // Special symbol for check_access
@@ -6729,8 +6727,8 @@
/* If pointer is not a null pointer, append filename to it */
-static bool append_file_to_dir(THD *thd, const char **filename_ptr,
- const char *table_name)
+bool append_file_to_dir(THD *thd, const char **filename_ptr,
+ const char *table_name)
{
char buff[FN_REFLEN],*ptr, *end;
if (!*filename_ptr)
--- 1.23/sql/ha_partition.cc 2006-01-18 09:25:48 -06:00
+++ 1.24/sql/ha_partition.cc 2006-01-25 13:06:53 -06:00
@@ -1696,7 +1696,7 @@
error= (*file)->delete_table((const char*) from_buff);
else
{
- set_up_table_before_create(table_arg, create_info, i);
+ set_up_table_before_create(table_arg, from_buff, create_info, i);
error= (*file)->create(from_buff, table_arg, create_info);
}
name_buffer_ptr= strend(name_buffer_ptr) + 1;
@@ -1770,8 +1770,9 @@
*/
void ha_partition::set_up_table_before_create(TABLE *table,
- HA_CREATE_INFO *info,
- uint part_id)
+ const char *partition_name_with_path,
+ HA_CREATE_INFO *info,
+ uint part_id)
{
partition_element *part_elem= find_partition_element(part_id);
@@ -1779,6 +1780,15 @@
return; // Fatal error
table->s->max_rows= part_elem->part_max_rows;
table->s->min_rows= part_elem->part_min_rows;
+ char *partition_name= strrchr(partition_name_with_path, FN_LIBCHAR);
+ if (part_elem->index_file_name)
+ append_file_to_dir(current_thd,
+ (const char**)&part_elem->index_file_name,
+ partition_name+1);
+ if (part_elem->data_file_name)
+ append_file_to_dir(current_thd,
+ (const char**)&part_elem->data_file_name,
+ partition_name+1);
info->index_file_name= part_elem->index_file_name;
info->data_file_name= part_elem->data_file_name;
}
--- 1.9/sql/ha_partition.h 2006-01-17 01:37:24 -06:00
+++ 1.10/sql/ha_partition.h 2006-01-25 13:06:53 -06:00
@@ -220,8 +220,10 @@
bool new_handlers_from_part_info();
bool create_handlers();
void clear_handler_file();
- void set_up_table_before_create(TABLE * table_arg, HA_CREATE_INFO * info,
- uint part_id);
+ void set_up_table_before_create(TABLE *table_arg,
+ const char *partition_name_with_path,
+ HA_CREATE_INFO *info,
+ uint part_id);
partition_element *find_partition_element(uint part_id);
public:
--- 1.26/sql/sql_partition.cc 2006-01-24 21:01:48 -06:00
+++ 1.27/sql/sql_partition.cc 2006-01-25 13:06:53 -06:00
@@ -2243,6 +2243,7 @@
}
static int add_keyword_string(File fptr, const char *keyword,
+ bool should_use_quotes,
const char *keystr)
{
int err= add_string(fptr, keyword);
@@ -2250,7 +2251,11 @@
err+= add_space(fptr);
err+= add_equal(fptr);
err+= add_space(fptr);
+ if (should_use_quotes)
+ err+= add_string(fptr, "'");
err+= add_string(fptr, keystr);
+ if (should_use_quotes)
+ err+= add_string(fptr, "'");
return err + add_space(fptr);
}
@@ -2278,7 +2283,8 @@
int err= 0;
if (p_elem->tablespace_name)
- err+= add_keyword_string(fptr,"TABLESPACE",p_elem->tablespace_name);
+ err+= add_keyword_string(fptr,"TABLESPACE", FALSE,
+ p_elem->tablespace_name);
if (p_elem->nodegroup_id != UNDEF_NODEGROUP)
err+= add_keyword_int(fptr,"NODEGROUP",(longlong)p_elem->nodegroup_id);
if (p_elem->part_max_rows)
@@ -2286,11 +2292,13 @@
if (p_elem->part_min_rows)
err+= add_keyword_int(fptr,"MIN_ROWS",(longlong)p_elem->part_min_rows);
if (p_elem->data_file_name)
- err+= add_keyword_string(fptr,"DATA DIRECTORY",p_elem->data_file_name);
+ err+= add_keyword_string(fptr, "DATA DIRECTORY", TRUE,
+ p_elem->data_file_name);
if (p_elem->index_file_name)
- err+= add_keyword_string(fptr,"INDEX DIRECTORY",p_elem->index_file_name);
+ err+= add_keyword_string(fptr, "INDEX DIRECTORY", TRUE,
+ p_elem->index_file_name);
if (p_elem->part_comment)
- err+= add_keyword_string(fptr, "COMMENT",p_elem->part_comment);
+ err+= add_keyword_string(fptr, "COMMENT", FALSE, p_elem->part_comment);
return err + add_engine(fptr,p_elem->engine_type);
}
--- 1.5/mysql-test/t/partition_mgm_err.test 2006-01-23 10:39:26 -06:00
+++ 1.6/mysql-test/t/partition_mgm_err.test 2006-01-25 13:09:55 -06:00
@@ -169,6 +169,22 @@
DROP TABLE t1;
#
+# BUG: 14354 Partitions: data directory clause fails
+#
+--exec rm -rf $MYSQL_TEST_DIR/var/tmp/bug14354
+--exec mkdir $MYSQL_TEST_DIR/var/tmp/bug14354
+disable_query_log;
+eval CREATE TABLE t1 (id int) PARTITION BY RANGE(id) (
+PARTITION p1 VALUES LESS THAN (20) ENGINE=myiasm
+DATA DIRECTORY="$MYSQL_TEST_DIR/var/tmp/bug14354"
+INDEX DIRECTORY="$MYSQL_TEST_DIR/var/tmp/bug14354");
+enable_query_log;
+--exec test -f $MYSQL_TEST_DIR/var/tmp/bug14354/t1_p1.MYD
+--exec test -f $MYSQL_TEST_DIR/var/tmp/bug14354/t1_p1.MYI
+DROP TABLE t1;
+--exec rm -rf $MYSQL_TEST_DIR/var/tmp/bug14354
+
+#
# Bug# 16534 - Trying to add multiple partitions crashes server
#
CREATE TABLE t1 ( id INT NOT NULL,
| Thread |
|---|
| • bk commit into 5.1 tree (reggie:1.2077) | reggie | 25 Jan |