3431 Jonas Oreland 2011-07-07
ndb - wl#3749 - fix an missing close_temporary (cause trailing share). Then found what must be an incorrect #ifdef. Changed that and had to change a couple of lines in sql_partition (which makes sense)
modified:
sql/sql_partition.cc
sql/sql_table.cc
3430 Jonas Oreland 2011-07-07 [merge]
ndb - merge 71 to 55
modified:
mysql-test/suite/ndb/r/ndb_share.result
mysql-test/suite/ndb/t/ndb_share.cnf
mysql-test/suite/ndb/t/ndb_share.test
3429 jonas oreland 2011-07-06
add suppression for running with "--mysqld=--binlog-format=mixed" as pb-swei does
modified:
mysql-test/suite/ndb/t/ndb_share.test
=== modified file 'mysql-test/suite/ndb/r/ndb_share.result'
--- a/mysql-test/suite/ndb/r/ndb_share.result 2011-07-06 06:47:16 +0000
+++ b/mysql-test/suite/ndb/r/ndb_share.result 2011-07-07 10:00:25 +0000
@@ -50,6 +50,22 @@ set global ndb_check_shares=1;
set global ndb_check_shares=1;
set global ndb_check_shares=1;
set global ndb_check_shares=1;
+create table t1 (a int primary key) engine=ndbcluster
+partition by list(a) (partition p0 values in (0));
+alter offline table t1 add partition (partition p1 values in (1));
+drop table t1;
+set global ndb_check_shares=1;
+set global ndb_check_shares=1;
+set global ndb_check_shares=1;
+set global ndb_check_shares=1;
+create table t1 (a int primary key) engine=ndbcluster
+partition by list(a) (partition p0 values in (0));
+alter offline table t1 add partition (partition p1 values in (1));
+drop table t1;
+set global ndb_check_shares=1;
+set global ndb_check_shares=1;
+set global ndb_check_shares=1;
+set global ndb_check_shares=1;
create table t1 (a int primary key) engine=ndbcluster;
alter online table t1 add column b int column_format dynamic;
drop table t1;
=== modified file 'mysql-test/suite/ndb/t/ndb_share.cnf'
--- a/mysql-test/suite/ndb/t/ndb_share.cnf 2011-07-05 14:19:56 +0000
+++ b/mysql-test/suite/ndb/t/ndb_share.cnf 2011-07-07 10:00:25 +0000
@@ -4,15 +4,19 @@
mysqld=,,,
[mysqld.1.1]
+new
log-bin=mysqld-bin
[mysqld.2.1]
+new
log-bin=mysqld-bin
[mysqld.3.1]
+new
skip-log-bin
[mysqld.4.1]
+new
skip-log-bin
[ENV]
=== modified file 'mysql-test/suite/ndb/t/ndb_share.test'
--- a/mysql-test/suite/ndb/t/ndb_share.test 2011-07-06 16:48:08 +0000
+++ b/mysql-test/suite/ndb/t/ndb_share.test 2011-07-07 10:12:54 +0000
@@ -67,6 +67,24 @@ drop table t1;
--source suite/ndb/include/ndb_share_check_shares.inc
#
+# Basic create+offline-alter-partitions+drop (from with and without log-bin)
+# no share should be present
+#
+connection server1;
+create table t1 (a int primary key) engine=ndbcluster
+partition by list(a) (partition p0 values in (0));
+alter offline table t1 add partition (partition p1 values in (1));
+drop table t1;
+--source suite/ndb/include/ndb_share_check_shares.inc
+
+connection server2;
+create table t1 (a int primary key) engine=ndbcluster
+partition by list(a) (partition p0 values in (0));
+alter offline table t1 add partition (partition p1 values in (1));
+drop table t1;
+--source suite/ndb/include/ndb_share_check_shares.inc
+
+#
# Basic create+online-alter+drop (from with and without log-bin)
# no share should be present
#
=== modified file 'sql/sql_partition.cc'
--- a/sql/sql_partition.cc 2011-05-30 21:13:02 +0000
+++ b/sql/sql_partition.cc 2011-07-07 12:25:26 +0000
@@ -4674,7 +4674,11 @@ uint prep_alter_part_table(THD *thd, TAB
without any changes at all.
*/
#ifndef MCP_WL3749
- *is_fast_alter_partitioning= TRUE;
+ flags= new_table->file->alter_table_flags(alter_info->flags);
+ if ((flags & (HA_FAST_CHANGE_PARTITION | HA_PARTITION_ONE_PHASE)) != 0)
+ {
+ *is_fast_alter_partitioning= TRUE;
+ }
#else
*fast_alter_table= new_table;
#endif
@@ -4711,6 +4715,7 @@ uint prep_alter_part_table(THD *thd, TAB
#else
*fast_alter_table= new_table;
#endif
+
#ifndef MCP_WL3749
DBUG_PRINT("info", ("*is_fast_alter_partitioning: %u flags: 0x%x",
*is_fast_alter_partitioning, flags));
=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc 2011-07-06 08:33:33 +0000
+++ b/sql/sql_table.cc 2011-07-07 12:25:26 +0000
@@ -7104,10 +7104,11 @@ bool mysql_alter_table(THD *thd,char *ne
db, table_name, path,
#ifndef MCP_WL3749
&table_for_fast_alter_partition,
- &is_fast_alter_partitioning))
+ &is_fast_alter_partitioning
#else
- &table_for_fast_alter_partition))
+ &table_for_fast_alter_partition
#endif
+ ))
goto err;
#endif
/*
@@ -7134,13 +7135,13 @@ bool mysql_alter_table(THD *thd,char *ne
#endif
set_table_default_charset(thd, create_info, db);
+#ifdef MCP_WL3749
if (thd->variables.old_alter_table
|| (table->s->db_type() != create_info->db_type)
#ifdef WITH_PARTITION_STORAGE_ENGINE
|| partition_changed
#endif
- )
-#ifdef MCP_WL3749
+ )
need_copy_table= ALTER_TABLE_DATA_CHANGED;
else
{
@@ -7997,6 +7998,11 @@ bool mysql_alter_table(THD *thd,char *ne
end_online:
#endif
+#ifndef MCP_WL3749
+ if (table_for_fast_alter_partition)
+ close_temporary(table_for_fast_alter_partition, 1, 0);
+#endif
+
if (thd->locked_tables_list.reopen_tables(thd))
goto err_with_mdl;
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-5.5-cluster branch (jonas.oreland:3429 to 3431) WL#3749 | Jonas Oreland | 7 Jul |