List:Internals« Previous MessageNext Message »
From:Martin Skold Date:April 4 2005 7:38pm
Subject:bk commit into 5.0 tree (mskold:1.1862) BUG#9517
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of marty. When marty does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.1862 05/04/04 21:38:05 mskold@stripped +3 -0
  Fix Bug #9517  Condition pushdown to storage engine does not work for update/delete

  sql/records.cc
    1.37 05/04/04 21:37:42 mskold@stripped +7 -0
    Fix Bug #9517  Condition pushdown to storage engine does not work for update/delete

  mysql-test/t/ndb_condition_pushdown.test
    1.10 05/04/04 21:37:42 mskold@stripped +59 -0
    Fix Bug #9517  Condition pushdown to storage engine does not work for update/delete

  mysql-test/r/ndb_condition_pushdown.result
    1.10 05/04/04 21:37:42 mskold@stripped +57 -1
    Fix Bug #9517  Condition pushdown to storage engine does not work for update/delete

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	mskold
# Host:	blowfish.ndb.mysql.com
# Root:	/usr/local/home/marty/MySQL/mysql-5.0

--- 1.36/sql/records.cc	Thu Jan 20 05:51:00 2005
+++ 1.37/sql/records.cc	Mon Apr  4 21:37:42 2005
@@ -128,6 +128,13 @@
       VOID(table->file->extra_opt(HA_EXTRA_CACHE,
 				  thd->variables.read_buff_size));
   }
+  /* Condition pushdown to storage engine */
+  if (thd->variables.engine_condition_pushdown && 
+      select && select->cond && 
+      select->cond->used_tables() & table->map &&
+      !(select->quick || table->file->pushed_cond))
+    table->file->cond_push(select->cond);
+
   DBUG_VOID_RETURN;
 } /* init_read_record */
 

--- 1.9/mysql-test/r/ndb_condition_pushdown.result	Mon Mar 14 15:23:13 2005
+++ 1.10/mysql-test/r/ndb_condition_pushdown.result	Mon Apr  4 21:37:42 2005
@@ -1023,6 +1023,62 @@
 1
 3
 4
+update t1
+set medium = 17
+where 
+string = "aaaa" and 
+vstring = "aaaa" and 
+bin = 0xAAAA and 
+vbin = 0xAAAA and
+tiny = -1 and 
+short = -1 and 
+medium = -1 and 
+long_int = -1 and 
+longlong = -1 and 
+real_float > 1.0 and real_float < 2.0 and 
+real_double > 1.0 and real_double < 2.0 and
+real_decimal > 1.0 and real_decimal < 2.0 and
+utiny = 1 and 
+ushort = 1 and 
+umedium = 1 and 
+ulong = 1 and 
+ulonglong = 1 and 
+/* bits = b'001' and */
+options = 'one' and 
+flags = 'one' and 
+date_field = '1901-01-01' and
+year_field = '1901' and
+time_field = '01:01:01' and 
+date_time = '1901-01-01 01:01:01';
+delete from t1 
+where
+string = "aaaa" and 
+vstring = "aaaa" and 
+bin = 0xAAAA and 
+vbin = 0xAAAA and
+tiny = -1 and 
+short = -1 and 
+medium = 17 and 
+long_int = -1 and 
+longlong = -1 and 
+real_float > 1.0 and real_float < 2.0 and 
+real_double > 1.0 and real_double < 2.0 and
+real_decimal > 1.0 and real_decimal < 2.0 and
+utiny = 1 and 
+ushort = 1 and 
+umedium = 1 and 
+ulong = 1 and 
+ulonglong = 1 and 
+/* bits = b'001' and */
+options = 'one' and 
+flags = 'one' and 
+date_field = '1901-01-01' and
+year_field = '1901' and
+time_field = '01:01:01' and 
+date_time = '1901-01-01 01:01:01';
+select count(*) from t1;
+count(*)
+3
 explain 
 select * from t2 where attr3 is null or attr1 > 2 and pk1= 3 order by pk1;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
@@ -1078,7 +1134,7 @@
 explain
 select auto from t1 where string = "aaaa" collate latin1_general_ci order by auto;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	4	Using where; Using filesort
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	Using where; Using filesort
 explain
 select * from t2 where (attr1 < 2) = (attr2 < 2) order by pk1;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra

--- 1.9/mysql-test/t/ndb_condition_pushdown.test	Mon Mar 14 15:23:12 2005
+++ 1.10/mysql-test/t/ndb_condition_pushdown.test	Mon Apr  4 21:37:42 2005
@@ -954,6 +954,65 @@
 vbin not like concat(0xBB, '%')
 order by auto;
 
+# Update test
+update t1
+set medium = 17
+where 
+string = "aaaa" and 
+vstring = "aaaa" and 
+bin = 0xAAAA and 
+vbin = 0xAAAA and
+tiny = -1 and 
+short = -1 and 
+medium = -1 and 
+long_int = -1 and 
+longlong = -1 and 
+real_float > 1.0 and real_float < 2.0 and 
+real_double > 1.0 and real_double < 2.0 and
+real_decimal > 1.0 and real_decimal < 2.0 and
+utiny = 1 and 
+ushort = 1 and 
+umedium = 1 and 
+ulong = 1 and 
+ulonglong = 1 and 
+/* bits = b'001' and */
+options = 'one' and 
+flags = 'one' and 
+date_field = '1901-01-01' and
+year_field = '1901' and
+time_field = '01:01:01' and 
+date_time = '1901-01-01 01:01:01';
+
+# Delete test
+delete from t1 
+where
+string = "aaaa" and 
+vstring = "aaaa" and 
+bin = 0xAAAA and 
+vbin = 0xAAAA and
+tiny = -1 and 
+short = -1 and 
+medium = 17 and 
+long_int = -1 and 
+longlong = -1 and 
+real_float > 1.0 and real_float < 2.0 and 
+real_double > 1.0 and real_double < 2.0 and
+real_decimal > 1.0 and real_decimal < 2.0 and
+utiny = 1 and 
+ushort = 1 and 
+umedium = 1 and 
+ulong = 1 and 
+ulonglong = 1 and 
+/* bits = b'001' and */
+options = 'one' and 
+flags = 'one' and 
+date_field = '1901-01-01' and
+year_field = '1901' and
+time_field = '01:01:01' and 
+date_time = '1901-01-01 01:01:01';
+
+select count(*) from t1;
+
 # Various tests 
 explain 
 select * from t2 where attr3 is null or attr1 > 2 and pk1= 3 order by pk1;
Thread
bk commit into 5.0 tree (mskold:1.1862) BUG#9517Martin Skold4 Apr