~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/drop.test

  • Committer: Prafulla Tekawade
  • Date: 2010-08-06 11:21:12 UTC
  • mto: (1711.1.21 build) (1725.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1714.
  • Revision ID: prafulla_t@users.sourceforge.net-20100806112112-7w5u0s3nx9u67nzt
Fix for Bug 586051

1. test_if_ref method which checks whether predicate is already evaluated
   due to ref/eq_ref access or not was incorrectly removing a predicate 
   that was not implicitly evaluated due to ref access (due to presence of filesort ?)
   It was field=NULL predicate.
   Such predicate should be kept and execution engine will filter out rows
   correctly. Removal of such predicate led to returning of rows which had
   NULL for join/predicate columns.
2. field COMP_OP NULL will always false for all fields except when COMP_OP
   is NULL-safe equality operator. Modified range optimizer to return zero
   row count in such cases.
   Query now does not even run. It returns zero result. As such Fix(1) is not
   required but we might hit that case in some other query (I have not tried it
   yet)
3. Fixed Field::val_str to print "NULL" for literal NULL instead of "0". It
   added lot of confusion while debugging.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
drop database if exists client_test_db;
7
7
--enable_warnings
8
8
 
9
 
--error ER_BAD_TABLE_ERROR
 
9
--error 1051
10
10
drop table t1;
11
11
create table t1(n int);
12
12
insert into t1 values(1);
13
13
create temporary table t1( n int);
14
14
insert into t1 values(2);
15
 
--error ER_TABLE_EXISTS_ERROR
 
15
--error 1050
16
16
create table t1(n int);
17
17
drop table t1;
18
18
select * from t1;
37
37
# (tableN instead on tN)
38
38
#
39
39
use mysqltest;
40
 
--error ER_BAD_TABLE_ERROR
 
40
--error 1051
41
41
drop table table1, table2, table3, table4, table5, table6,
42
42
table7, table8, table9, table10, table11, table12, table13,
43
43
table14, table15, table16, table17, table18, table19, table20,
44
44
table21, table22, table23, table24, table25, table26, table27,
45
45
table28;
46
46
 
47
 
--error ER_BAD_TABLE_ERROR
 
47
--error 1051
48
48
drop table table1, table2, table3, table4, table5, table6,
49
49
table7, table8, table9, table10, table11, table12, table13,
50
50
table14, table15, table16, table17, table18, table19, table20,
56
56
 
57
57
# test drop/create database and FLUSH TABLES WITH READ LOCK
58
58
flush tables with read lock;
59
 
--error ER_DROP_DB_WITH_READ_LOCK, ER_CANT_UPDATE_WITH_READLOCK
 
59
--error 1209,1223
60
60
create database mysqltest;
61
61
unlock tables;
62
62
create database mysqltest;
63
63
show databases;
64
64
flush tables with read lock;
65
 
--error ER_DROP_DB_WITH_READ_LOCK, ER_CANT_UPDATE_WITH_READLOCK
 
65
--error 1208,1223
66
66
drop database mysqltest;
67
67
unlock tables;
68
68
drop database mysqltest;
69
69
show databases;
70
 
--error ER_DB_DROP_EXISTS
 
70
--error 1008
71
71
drop database mysqltest;
72
72
 
73
73
# test create table and FLUSH TABLES WITH READ LOCK
74
74
drop table t1;
75
75
flush tables with read lock;
76
 
--error ER_CANT_UPDATE_WITH_READLOCK
 
76
--error 1223
77
77
create table t1(n int);
78
78
unlock tables;
79
79
create table t1(n int);