diff options
author | Igor Babaev <igor@askmonty.org> | 2011-06-05 21:54:25 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2011-06-05 21:54:25 -0700 |
commit | 3bf08e549a78ad12191f6b1ca49719bc667664ef (patch) | |
tree | f086c8ecfd829cf3fb717bf0725c1b2b5c2275d5 /mysql-test/suite/parts | |
parent | f03a3ee54fb8b5aeeba590677f48b54a57ab45cf (diff) | |
download | mariadb-git-3bf08e549a78ad12191f6b1ca49719bc667664ef.tar.gz |
Added two new flags for the optimizer switch:
'derived_merge':
- if the flag is off then all derived tables are materialized
- if the flag is on then mergeable derived tables are merged
'derived_with_keys':
- if the flag is off then no keys are created for derived tables
- if the flag is on then for any derived table a key to access
the derived table may be created.
Now by default both flags are on.
Later the default values for the flags will be off to comply with
the current behaviour of mysql-5.1.
Uncommented previously commented out test case from parts.partition_repair_myisam
after having added an explicit requirement to materialize the derived
table used in the test case.
Diffstat (limited to 'mysql-test/suite/parts')
-rw-r--r-- | mysql-test/suite/parts/r/partition_repair_myisam.result | 14 | ||||
-rw-r--r-- | mysql-test/suite/parts/t/partition_repair_myisam.test | 10 |
2 files changed, 20 insertions, 4 deletions
diff --git a/mysql-test/suite/parts/r/partition_repair_myisam.result b/mysql-test/suite/parts/r/partition_repair_myisam.result index aeba93273f9..a34627a91cb 100644 --- a/mysql-test/suite/parts/r/partition_repair_myisam.result +++ b/mysql-test/suite/parts/r/partition_repair_myisam.result @@ -393,6 +393,20 @@ partition b a length(c) 6 34 6 row 2 64 6 83 64 6 97 zzzzzZzzzzz 64 +SET @save_optimizer_switch= @@optimizer_switch; +SET @@optimizer_switch='derived_merge=off'; +SELECT (b % 7) AS partition, b, a FROM (SELECT b,a FROM t1_will_crash) q +WHERE (b % 7) = 6 +ORDER BY partition, b, a; +partition b a +6 6 jkl +6 13 ooo +6 34 6 row 2 +6 48 6 row 4 +6 62 6 row 6 +6 83 +6 97 zzzzzZzzzzz +SET @@optimizer_switch=@save_optimizer_switch; ALTER TABLE t1_will_crash CHECK PARTITION p6; Table Op Msg_type Msg_text test.t1_will_crash check warning Size of datafile is: 868 Should be: 604 diff --git a/mysql-test/suite/parts/t/partition_repair_myisam.test b/mysql-test/suite/parts/t/partition_repair_myisam.test index 3e03669c1ce..849f175b920 100644 --- a/mysql-test/suite/parts/t/partition_repair_myisam.test +++ b/mysql-test/suite/parts/t/partition_repair_myisam.test @@ -230,10 +230,12 @@ FLUSH TABLES; SELECT (b % 7) AS partition, b, a, length(c) FROM t1_will_crash WHERE (b % 7) = 6 ORDER BY partition, b, a; -# !!! The next test case has to be changed to provide the same result set as before mwl106 -# SELECT (b % 7) AS partition, b, a FROM (SELECT b,a FROM t1_will_crash) q -# WHERE (b % 7) = 6 -# ORDER BY partition, b, a; +SET @save_optimizer_switch= @@optimizer_switch; +SET @@optimizer_switch='derived_merge=off'; +SELECT (b % 7) AS partition, b, a FROM (SELECT b,a FROM t1_will_crash) q +WHERE (b % 7) = 6 +ORDER BY partition, b, a; +SET @@optimizer_switch=@save_optimizer_switch; # NOTE: REBUILD PARTITION without CHECK before, 2 + (1) records will be lost! #ALTER TABLE t1_will_crash REBUILD PARTITION p6; ALTER TABLE t1_will_crash CHECK PARTITION p6; |