~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/innodb_mysql.test

  • Committer: Prafulla Tekawade
  • Date: 2010-07-18 03:36:32 UTC
  • mto: (1662.1.4 rollup)
  • mto: This revision was merged to the branch mainline in revision 1664.
  • Revision ID: prafulla_t@users.sourceforge.net-20100718033632-p7q6qtgliqbhe38p
Fix for Bug 592444

There were two problems:
o. In greedy_search optimizer method, best_extension_by_limited search
   maintains join embedding(nestedness) of tables added so far, so that 
   correct(valid)  join order is selected
   These are requirements from nested outer join executioner.
   The problem was, embedding_map was not correctly updated when a table 
   is added to optimal plan outside best_extension_by_limited search, 
   by greedy_search method. We need to update join->cur_embedding_map
   correctly here so that execution plan for other tables get
   generated.
   Invoked checked_interleaving_with_nj from greedy_search on the
   best_table selected. Fixed its prototype to take only one JoinTab
   This is same as mysql 5.1 source tree.
o. The other problem was, join->cur_embedding_map was not restored correctly
   when a table is added to the optimal plan to reflect the current embedding 
   map. 
   Taken good documented method restore_prev_nj_state which restores 
   cur_embedding_map from mysql 5.1 source tree and modified it for drizzled 
   code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
# InnoDB does support FOREIGN KEYFOREIGN KEYs
12
12
let $test_foreign_keys= 1;
13
13
set global innodb_support_xa=default;
 
14
set session innodb_support_xa=default;
14
15
--source include/mix1.inc
15
 
 
16
 
--echo #
17
 
--echo # Test for bug #39932 "create table fails if column for FK is in different
18
 
--echo #                      case than in corr index".
19
 
--echo #
20
 
--disable_warnings
21
 
drop tables if exists t1, t2;
22
 
--enable_warnings
23
 
create table t1 (pk int primary key) engine=InnoDB;
24
 
--echo # Even although the below statement uses uppercased field names in
25
 
--echo # foreign key definition it still should be able to find explicitly
26
 
--echo # created supporting index. So it should succeed and should not
27
 
--echo # create any additional supporting indexes.
28
 
create table t2 (fk int, key x (fk),
29
 
                 constraint x foreign key (FK) references t1 (PK)) engine=InnoDB;
30
 
show create table t2;
31
 
drop table t2, t1;
32
 
--echo #
33
 
--echo # Bug#55826: create table .. select crashes with when KILL_BAD_DATA 
34
 
--echo #  is returned
35
 
--echo #
36
 
 
37
 
CREATE TABLE t1(a INT) ENGINE=innodb;
38
 
INSERT INTO t1 VALUES (0);
39
 
--error ER_TRUNCATED_WRONG_VALUE
40
 
CREATE TABLE t2 
41
 
  SELECT LEAST((SELECT '' FROM t1),NOW()) FROM `t1`;
42
 
DROP TABLE IF EXISTS t1,t2;