List:Internals« Previous MessageNext Message »
From:monty Date:January 29 2004 3:16pm
Subject:bk commit into 4.0 tree (monty:1.1687)
View as plain text  
Below is the list of changes that have just been committed into a local
4.0 repository of monty. When monty 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://www.mysql.com/doc/I/n/Installing_source_tree.html

ChangeSet
  1.1687 04/01/29 15:16:48 monty@stripped +8 -0
  Mark that strings may change on index only reads (for BDB tables).
  This fixed problem with index reads on character fields with BDB tables. (Bug #2509)

  sql/table.cc
    1.69 04/01/29 15:16:47 monty@stripped +2 -1
    Allow index only reads on binary strings

  sql/item_strfunc.cc
    1.76 04/01/29 15:16:47 monty@stripped +4 -7
    Cleanup

  sql/ha_berkeley.h
    1.54 04/01/29 15:16:47 monty@stripped +1 -1
    Mark that strings may change on index only reads

  mysql-test/t/myisam.test
    1.24 04/01/29 15:16:47 monty@stripped +17 -1
    More test to verify pushed bug fix

  mysql-test/t/bdb.test
    1.30 04/01/29 15:16:47 monty@stripped +14 -0
    Test for idnex only read

  mysql-test/r/myisam.result
    1.28 04/01/29 15:16:47 monty@stripped +29 -1
    More tests

  mysql-test/r/bdb.result
    1.29 04/01/29 15:16:47 monty@stripped +25 -0
    New test

  BitKeeper/etc/ignore
    1.153 04/01/29 15:15:04 monty@stripped +1 -0
    added man/*.1

# 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:	monty
# Host:	narttu.
# Root:	/home/my/mysql-4.0

--- 1.53/sql/ha_berkeley.h	Tue Dec 30 12:14:18 2003
+++ 1.54/sql/ha_berkeley.h	Thu Jan 29 15:16:47 2004
@@ -92,7 +92,7 @@
 		    HA_NULL_KEY | HA_BLOB_KEY | HA_NOT_EXACT_COUNT |
 		    HA_PRIMARY_KEY_IN_READ_INDEX | HA_DROP_BEFORE_CREATE |
 		    HA_AUTO_PART_KEY | HA_TABLE_SCAN_ON_INDEX |
-		    HA_FILE_BASED),
+		    HA_KEY_READ_WRONG_STR | HA_FILE_BASED),
     changed_rows(0),last_dup_key((uint) -1),version(0),using_ignore(0)
   {
   }

--- 1.75/sql/item_strfunc.cc	Thu Jan 22 17:20:41 2004
+++ 1.76/sql/item_strfunc.cc	Thu Jan 29 15:16:47 2004
@@ -1507,14 +1507,11 @@
 {
   max_length=0;
   decimals=0;
-  /*
-    first numeric argument isn't in args (3.23 and 4.0)
-    but since 4.1 the cycle should start from 1
-    so this change 
-    
-    should NOT be merged into 4.1!!!
-  */
+#if MYSQL_VERSION_ID < 40100
   for (uint i= 0; i < arg_count ; i++)
+#else
+  for (uint i= 1; i < arg_count ; i++)
+#endif
   {
     set_if_bigger(max_length,args[i]->max_length);
     set_if_bigger(decimals,args[i]->decimals);

--- 1.68/sql/table.cc	Fri Dec 12 21:26:56 2003
+++ 1.69/sql/table.cc	Thu Jan 29 15:16:47 2004
@@ -498,7 +498,8 @@
 	      field->type() != FIELD_TYPE_BLOB)
 	  {
 	    if (field->key_type() != HA_KEYTYPE_TEXT ||
-		(!(ha_option & HA_KEY_READ_WRONG_STR) &&
+		((!(ha_option & HA_KEY_READ_WRONG_STR) ||
+		  field->flags & BINARY_FLAG) &&
 		 !(keyinfo->flags & HA_FULLTEXT)))
 	      field->part_of_key|= ((key_map) 1 << key);
 	    if ((field->key_type() != HA_KEYTYPE_TEXT ||

--- 1.27/mysql-test/r/myisam.result	Wed Jan 21 23:39:33 2004
+++ 1.28/mysql-test/r/myisam.result	Thu Jan 29 15:16:47 2004
@@ -386,7 +386,10 @@
 test.t1	check	status	OK
 drop table t1;
 create table t1 ( a text not null, key a (a(20)));
-insert into t1 values ('aaa   '),('aaa');
+insert into t1 values ('aaa   '),('aaa'),('aa');
+check table t1;
+Table	Op	Msg_type	Msg_text
+test.t1	check	status	OK
 repair table t1;
 Table	Op	Msg_type	Msg_text
 test.t1	repair	status	OK
@@ -394,6 +397,15 @@
 concat(a,'.')
 aaa.
 aaa   .
+select concat(a,'.') from t1 where binary a='aaa';
+concat(a,'.')
+aaa.
+update t1 set a='bbb' where a='aaa';
+select concat(a,'.') from t1;
+concat(a,'.')
+bbb.
+bbb.
+aa.
 drop table t1;
 create table t1(a text not null, b text not null, c text not null, index
(a(10),b(10),c(10)));
 insert into t1 values('807780', '477', '165');
@@ -402,4 +414,20 @@
 select * from t1 where a='807780' and b='477' and c='165';
 a	b	c
 807780	477	165
+drop table t1;
+create table t1 (a int not null auto_increment primary key, b text not null, unique b
(b(20)));
+insert into t1 (b) values ('a'),('a '),('a  ');
+select concat(b,'.') from t1;
+concat(b,'.')
+a.
+a .
+a  .
+update t1 set b='b ' where a=2;
+update t1 set b='b  ' where a > 1;
+Duplicate entry 'b  ' for key 2
+delete from t1 where b='b';
+select a,concat(b,'.') from t1;
+a	concat(b,'.')
+1	a.
+3	a  .
 drop table t1;

--- 1.23/mysql-test/t/myisam.test	Wed Jan 21 23:39:33 2004
+++ 1.24/mysql-test/t/myisam.test	Thu Jan 29 15:16:47 2004
@@ -390,9 +390,13 @@
 # two bugs in myisam-space-stripping feature
 #
 create table t1 ( a text not null, key a (a(20)));
-insert into t1 values ('aaa   '),('aaa');
+insert into t1 values ('aaa   '),('aaa'),('aa');
+check table t1;
 repair table t1;
 select concat(a,'.') from t1 where a='aaa';
+select concat(a,'.') from t1 where binary a='aaa';
+update t1 set a='bbb' where a='aaa';
+select concat(a,'.') from t1;
 drop table t1;
 
 #
@@ -406,3 +410,15 @@
 select * from t1 where a='807780' and b='477' and c='165';
 drop table t1;
 
+#
+# Test text and unique
+#
+create table t1 (a int not null auto_increment primary key, b text not null, unique b
(b(20)));
+insert into t1 (b) values ('a'),('a '),('a  ');
+select concat(b,'.') from t1;
+update t1 set b='b ' where a=2;
+--error 1062
+update t1 set b='b  ' where a > 1;
+delete from t1 where b='b';
+select a,concat(b,'.') from t1;
+drop table t1;

--- 1.152/BitKeeper/etc/ignore	Sun Nov 16 17:37:12 2003
+++ 1.153/BitKeeper/etc/ignore	Thu Jan 29 15:15:04 2004
@@ -541,3 +541,4 @@
 hardcopy.0
 scripts/make_sharedlib_distribution
 sql/udf_example.so
+man/*.1

--- 1.28/mysql-test/r/bdb.result	Thu Dec  4 18:48:08 2003
+++ 1.29/mysql-test/r/bdb.result	Thu Jan 29 15:16:47 2004
@@ -1165,3 +1165,28 @@
 insert into t2 select * from t1;
 delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
 drop table t1,t2;
+create table t1 (a char(10), key(a), b int not null, key(b)) engine=bdb;
+insert into t1 values ('a',1),('A',2);
+explain select a from t1;
+table	type	possible_keys	key	key_len	ref	rows	Extra
+t1	ALL	NULL	NULL	NULL	NULL	2	
+select a from t1;
+a
+a
+A
+explain select b from t1;
+table	type	possible_keys	key	key_len	ref	rows	Extra
+t1	index	NULL	b	4	NULL	2	Using index
+select b from t1;
+b
+1
+2
+alter table t1 modify a char(10) binary;
+explain select a from t1;
+table	type	possible_keys	key	key_len	ref	rows	Extra
+t1	index	NULL	a	11	NULL	2	Using index
+select a from t1;
+a
+A
+a
+drop table t1;

--- 1.29/mysql-test/t/bdb.test	Thu Dec  4 18:48:09 2003
+++ 1.30/mysql-test/t/bdb.test	Thu Jan 29 15:16:47 2004
@@ -815,3 +815,17 @@
 
 delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
 drop table t1,t2;
+
+#
+# Test index only read (Bug #2509)
+#
+create table t1 (a char(10), key(a), b int not null, key(b)) engine=bdb;
+insert into t1 values ('a',1),('A',2);
+explain select a from t1;
+select a from t1;
+explain select b from t1;
+select b from t1;
+alter table t1 modify a char(10) binary;
+explain select a from t1;
+select a from t1;
+drop table t1;
Thread
bk commit into 4.0 tree (monty:1.1687)monty29 Jan