~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/heap.test

  • Committer: Prafulla Tekawade
  • Date: 2010-07-13 16:07:35 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-20100713160735-2fsdtrm3azayuyu1
This bug is simillar to mysql bug 36133
http://bugs.mysql.com/bug.php?id=36133

Taking changes from that fix.

  - The problem was that the range optimizer evaluated constant expressions, 
    and among them it would try to evaluate IN-subquery predicates slated for
    handling with materialization strategy. However, these predicates require
    that parent_join->setup_subquery_materialization() is invoked before one
    attempts to evaluate them.
  
  - Fixed by making the range optimizer not to evaluate expressions that have
    item->is_expensive() == TRUE (these are materialization subqueries and 
    stored function calls). This should also resolve the problem that EXPLAIN 
    may be too long. 
    This change cuts off some opportunities for range optimizer, but this is 
    the price we're willing to pay for separation of query optimization and
    execution. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
update t1 set b=b+1 where a>=3;
19
19
replace t1 values (3,3);
20
20
select * from t1;
21
 
alter table t1 add c int DEFAULT 42 not null, add key (c,a);
 
21
alter table t1 add c int not null, add key (c,a);
22
22
drop table t1;
23
23
 
24
24
create temporary table t1 (a int not null,b int not null, primary key (a)) engine=memory comment="testing heaps";
51
51
engine=MEMORY;
52
52
insert into t1 values (1,1),(2,2),(1,3),(2,4),(2,5),(2,6);
53
53
select * from t1 where x=1;
54
 
--error ER_CANT_REOPEN_TABLE
 
54
-- error 1137
55
55
select * from t1,t1 as t2 where t1.x=t2.y;
56
 
--error ER_CANT_REOPEN_TABLE
 
56
-- error 1137
57
57
explain select * from t1,t1 as t2 where t1.x=t2.y;
58
58
drop table t1;
59
59
 
108
108
insert into t1 values ("hello"),("hello"),("hello"),("hello"),("hello"),("a"),("b"),("c"),("d"),("e"),("f"),("g"),("h"),("i");
109
109
explain select * from t1 where btn like "q%";
110
110
select * from t1 where btn like "q%";
111
 
alter table t1 add column new_col char(1) DEFAULT "Y" not null, add key (btn,new_col), drop key btn;
 
111
alter table t1 add column new_col char(1) not null, add key (btn,new_col), drop key btn;
112
112
update t1 set new_col=left(btn,1);
113
113
explain select * from t1 where btn="a";
114
114
explain select * from t1 where btn="a" and new_col="a";
215
215
create temporary table t1 (v varchar(10), c char(10), t varchar(50));
216
216
insert into t1 values('+ ', '+ ', '+ ');
217
217
set @a=repeat(' ',20);
218
 
--error ER_DATA_TOO_LONG
 
218
--error 1406
219
219
insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a));
220
220
set @a=repeat(' ',10);
221
 
--error ER_DATA_TOO_LONG
 
221
--error 1406
222
222
insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a));
223
223
set @a=repeat(' ',9);
224
224
insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a));
315
315
insert into t1 values ('a '),('a  '),('a   '),('a         ');
316
316
--error ER_DUP_ENTRY
317
317
insert into t1 values ('a     ');
318
 
--error ER_DATA_TOO_LONG
 
318
--error 1406
319
319
insert into t1 values ('a          ');
320
320
--error ER_DUP_ENTRY
321
321
insert into t1 values ('a ');
393
393
insert into t1 values ('a '),('a  '),('a   '),('a         ');
394
394
--error ER_DUP_ENTRY
395
395
insert into t1 values ('a     ');
396
 
--error ER_DATA_TOO_LONG
 
396
--error 1406
397
397
insert into t1 values ('a          ');
398
398
--error ER_DUP_ENTRY
399
399
insert into t1 values ('a ');
436
436
select * from t1;
437
437
drop table t1;
438
438
 
439
 
--error ER_WRONG_AUTO_KEY
 
439
--error 1075
440
440
create temporary table t1 (a int not null, b int not null auto_increment,
441
441
  primary key(a, b)) engine=MEMORY;
442
442