~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/temp_table.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:
22
22
create TEMPORARY TABLE IF NOT EXISTS t2 (a int) engine=MEMORY;
23
23
 
24
24
# This should give errors
25
 
--error ER_TABLE_EXISTS_ERROR
 
25
--error 1050
26
26
CREATE TEMPORARY TABLE t1 (a int not null, b char (10) not null);
27
 
--error ER_TABLE_EXISTS_ERROR
 
27
--error 1050
28
28
ALTER TABLE t1 RENAME t2;
29
29
 
30
30
select * from t2;
124
124
CREATE TABLE t1 (i INT);
125
125
CREATE TEMPORARY TABLE t2 (i INT);
126
126
 
127
 
--error ER_BAD_TABLE_ERROR
 
127
--error 1051
128
128
DROP TEMPORARY TABLE t2, t1;
129
129
 
130
130
# Table t2 should have been dropped.
131
 
--error ER_NO_SUCH_TABLE
 
131
--error 1146
132
132
SELECT * FROM t2;
133
133
# But table t1 should still be there.
134
134
SELECT * FROM t1;