~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/default.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:
103
103
#      multiple-row statement, the preceding rows will have been inserted.
104
104
#
105
105
create table bug20691 (i int, d datetime NOT NULL, dn datetime NULL);
106
 
--error ER_NO_DEFAULT_FOR_FIELD
 
106
--error 1364
107
107
insert into bug20691 values (7, DEFAULT, DEFAULT), (7, '1975-07-10 07:10:03', '1978-01-13 14:08:51'), (7, DEFAULT, DEFAULT);
108
108
insert into bug20691 values (7, '1975-07-10 07:10:03', DEFAULT);
109
109
select * from bug20691 order by i asc;
118
118
  i decimal not null,
119
119
  x int);
120
120
insert into bug20691 values (3, '0007-01-01', 11, 17, '0019-01-01 00:00:00', 23, 1);
121
 
--error ER_NO_DEFAULT_FOR_FIELD
 
121
--error 1364
122
122
insert into bug20691 (x) values (2);
123
123
insert into bug20691 values (3, '0007-01-01', 11, 17, '0019-01-01 00:00:00', 23, 3);
124
 
--error ER_NO_DEFAULT_FOR_FIELD
 
124
--error 1364
125
125
insert into bug20691 values (DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, 4);
126
126
select * from bug20691 order by x asc;
127
127
drop table bug20691;