#At file:///Users/mattiasj/mysql-bzr/topush-trunk-wl5217/ based on revid:mattias.jonsson@stripped
3211 Mattias Jonsson 2010-12-17
WL#5217: Add explicit partition selection
pre-push test fixes
@ mysql-test/suite/parts/t/partition_debug_myisam.test
Disable the test on embedded, since restart does not work.
@ mysql-test/t/wl5217.test
Set the default storage engine to InnoDB, to pass on embedded.
@ sql/partition_info.cc
Wrong order of DBUG_ASSERT, and an assert that was not correct.
modified:
mysql-test/r/wl5217.result
mysql-test/suite/parts/t/partition_debug_myisam.test
mysql-test/t/wl5217.test
sql/partition_info.cc
=== modified file 'mysql-test/r/wl5217.result'
--- a/mysql-test/r/wl5217.result 2010-12-14 15:13:57 +0000
+++ b/mysql-test/r/wl5217.result 2010-12-17 11:16:44 +0000
@@ -1,3 +1,7 @@
+# Must have InnoDB as engine to get the same statistics results.
+# embedded uses MyISAM as default. CREATE SELECT uses the default engine.
+SET @old_default_storage_engine = @@default_storage_engine;
+SET @@default_storage_engine = 'InnoDB';
# Original tests for WL#5217
# TODO: benchmark what value to use for MAX_PARTITIONS_BEFORE_HASH
# Test to show if I_S affects HANDLER_ counts
@@ -1095,3 +1099,4 @@ HANDLER_WRITE 17
SELECT * FROM t3 PARTITION (pNeg);
ERROR HY000: PARTITION () clause on non partitioned table
DROP TABLE t1, t2, t3;
+SET @@default_storage_engine = @old_default_storage_engine;
=== modified file 'mysql-test/suite/parts/t/partition_debug_myisam.test'
--- a/mysql-test/suite/parts/t/partition_debug_myisam.test 2010-08-13 07:50:25 +0000
+++ b/mysql-test/suite/parts/t/partition_debug_myisam.test 2010-12-17 11:16:44 +0000
@@ -4,6 +4,8 @@
--source include/have_debug.inc
--source include/have_partition.inc
--source include/not_valgrind.inc
+# Crash tests don't work with embedded
+--source include/not_embedded.inc
--disable_warnings
DROP TABLE IF EXISTS t1;
=== modified file 'mysql-test/t/wl5217.test'
--- a/mysql-test/t/wl5217.test 2010-12-14 15:13:57 +0000
+++ b/mysql-test/t/wl5217.test 2010-12-17 11:16:44 +0000
@@ -1,24 +1,14 @@
--source include/have_innodb.inc
--source include/have_partition.inc
+--echo # Must have InnoDB as engine to get the same statistics results.
+--echo # embedded uses MyISAM as default. CREATE SELECT uses the default engine.
+SET @old_default_storage_engine = @@default_storage_engine;
+SET @@default_storage_engine = 'InnoDB';
+
--echo # Original tests for WL#5217
--echo # TODO: benchmark what value to use for MAX_PARTITIONS_BEFORE_HASH
-#let $get_handler_write_status_counts= SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS
-#WHERE (VARIABLE_NAME = 'HANDLER_EXTERNAL_LOCK' OR
-#VARIABLE_NAME = 'HANDLER_WRITE') AND
-#VARIABLE_VALUE > 0;
-#let $get_handler_read_status_counts= SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS
-#WHERE (VARIABLE_NAME = 'HANDLER_EXTERNAL_LOCK' OR
-#VARIABLE_NAME LIKE 'HANDLER_READ_%') AND
-#VARIABLE_VALUE > 0;
-#let $get_handler_status_counts= SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS
-#WHERE (VARIABLE_NAME = 'HANDLER_EXTERNAL_LOCK' OR
-#VARIABLE_NAME = 'HANDLER_UPDATE' OR
-#VARIABLE_NAME = 'HANDLER_DELETE' OR
-#VARIABLE_NAME = 'HANDLER_WRITE' OR
-#VARIABLE_NAME LIKE 'HANDLER_READ_%') AND
-#VARIABLE_VALUE > 0;
let $get_handler_status_counts= SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS
WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0;
@@ -504,3 +494,4 @@ eval $get_handler_status_counts;
SELECT * FROM t3 PARTITION (pNeg);
DROP TABLE t1, t2, t3;
+SET @@default_storage_engine = @old_default_storage_engine;
=== modified file 'sql/partition_info.cc'
--- a/sql/partition_info.cc 2010-12-14 20:03:21 +0000
+++ b/sql/partition_info.cc 2010-12-17 11:16:44 +0000
@@ -101,8 +101,8 @@ bool partition_info::prune_partition_bit
DBUG_ENTER("partition_info::prune_partition_bitmaps");
DBUG_ASSERT(table && table->s && table->s->ha_part_data);
- DBUG_ASSERT(part_name_hash->records);
part_name_hash= &table->s->ha_part_data->partition_name_hash;
+ DBUG_ASSERT(part_name_hash->records);
if (num_names < 1)
DBUG_RETURN(true);
@@ -645,12 +645,13 @@ char *partition_info::has_unique_names()
partition_element *el;
DBUG_ENTER("partition_info::has_unique_names");
+
/*
- Only called before the table is created.
- If table->s exists one could use the partition_name_hash there instead.
+ TODO: If table->s->ha_part_data->partition_name_hash.elements is > 0,
+ then we could just return NULL, but that has not been verified.
+ And this only happens when in ALTER TABLE with full table copy.
*/
- DBUG_ASSERT(!table || !table->s);
-
+
max_names= num_parts;
if (is_sub_partitioned())
max_names+= num_parts * num_subparts;
Attachment: [text/bzr-bundle] bzr/mattias.jonsson@oracle.com-20101217111644-9sx0qxhkoutjcp3p.bundle
| Thread |
|---|
| • bzr commit into mysql-trunk branch (mattias.jonsson:3211) WL#5217 | Mattias Jonsson | 17 Dec |