From: Date: February 7 2006 4:31pm Subject: bk commit into 5.1 tree (tomas:1.2078) BUG#17005 List-Archive: http://lists.mysql.com/commits/2245 X-Bug: 17005 Message-Id: <20060207153133.F33661F3061@poseidon.mysql.com> Below is the list of changes that have just been committed into a local 5.1 repository of tomas. When tomas 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.2078 06/02/07 16:31:20 tomas@stripped +2 -0 Bug #17005 Ndb partition handling for create table like is broken sql/sql_partition.cc 1.30 06/02/07 16:31:10 tomas@stripped +14 -8 Bug #17005 Ndb partition handling for create table like is broken sql/ha_ndbcluster.cc 1.263 06/02/07 16:31:10 tomas@stripped +1 -0 Bug #17005 Ndb partition handling for create table like is broken # 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: tomas # Host: poseidon.ndb.mysql.com # Root: /home/tomas/mysql-5.1-new --- 1.262/sql/ha_ndbcluster.cc 2006-02-07 12:16:16 +01:00 +++ 1.263/sql/ha_ndbcluster.cc 2006-02-07 16:31:10 +01:00 @@ -9592,6 +9592,7 @@ break; } ndb= get_ndb(); + ndb->setDatabaseName(m_dbname); dict= ndb->getDictionary(); if (!(tab= dict->getTable(m_tabname))) ERR_BREAK(dict->getNdbError(), err); --- 1.29/sql/sql_partition.cc 2006-01-30 17:54:12 +01:00 +++ 1.30/sql/sql_partition.cc 2006-02-07 16:31:10 +01:00 @@ -250,14 +250,14 @@ FALSE Success */ -bool partition_default_handling(TABLE *table, partition_info *part_info) +bool partition_default_handling(TABLE *table, partition_info *part_info, + const char *normalized_path) { DBUG_ENTER("partition_default_handling"); if (part_info->use_default_no_partitions) { - if (table->file->get_no_parts(table->s->normalized_path.str, - &part_info->no_parts)) + if (table->file->get_no_parts(normalized_path, &part_info->no_parts)) { DBUG_RETURN(TRUE); } @@ -266,8 +266,7 @@ part_info->use_default_no_subpartitions) { uint no_parts; - if (table->file->get_no_parts(table->s->normalized_path.str, - &no_parts)) + if (table->file->get_no_parts(normalized_path, &no_parts)) { DBUG_RETURN(TRUE); } @@ -2005,7 +2004,8 @@ if (!is_create_table_ind) { - if (partition_default_handling(table, part_info)) + if (partition_default_handling(table, part_info, + table->s->normalized_path.str)) { DBUG_RETURN(TRUE); } @@ -3901,9 +3901,15 @@ old_lex->name contains the t2 and the table we are opening has name t1. */ - if (partition_default_handling(table, part_info)) + Table_ident *table_ident= (Table_ident *)old_lex->name; + char *src_db= table_ident->db.str ? table_ident->db.str : thd->db; + char *src_table= table_ident->table.str; + char buf[FN_REFLEN]; + build_table_filename(buf, sizeof(buf), src_db, src_table, ""); + if (partition_default_handling(table, part_info, buf)) { - DBUG_RETURN(TRUE); + result= TRUE; + goto end; } } else