Below is the list of changes that have just been committed into a local
5.0 repository of mydev. When mydev 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.2087 06/03/10 15:06:04 ingo@stripped +9 -0
Merge mysql.com:/home/mydev/mysql-4.1-bug14980
into mysql.com:/home/mydev/mysql-5.0-bug14980
mysql-test/t/myisam.test
1.55 06/03/10 15:06:00 ingo@stripped +0 -0
SCCS merged
mysql-test/r/myisam.result
1.74 06/03/10 15:06:00 ingo@stripped +0 -0
SCCS merged
myisam/mi_write.c
1.56 06/03/10 15:04:04 ingo@stripped +0 -0
Auto merged
myisam/mi_update.c
1.20 06/03/10 15:04:04 ingo@stripped +0 -0
Auto merged
myisam/mi_unique.c
1.24 06/03/10 15:04:04 ingo@stripped +0 -0
Auto merged
myisam/mi_rnext_same.c
1.19 06/03/10 15:04:04 ingo@stripped +0 -0
Auto merged
myisam/mi_key.c
1.48 06/03/10 15:04:04 ingo@stripped +0 -0
Auto merged
myisam/mi_delete.c
1.39 06/03/10 15:04:04 ingo@stripped +0 -0
Auto merged
include/my_base.h
1.77 06/03/10 15:04:04 ingo@stripped +0 -0
Auto merged
# 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: ingo
# Host: synthia.local
# Root: /home/mydev/mysql-5.0-bug14980/RESYNC
--- 1.76/include/my_base.h 2006-02-17 07:51:10 +01:00
+++ 1.77/include/my_base.h 2006-03-10 15:04:04 +01:00
@@ -399,7 +399,7 @@
#define HA_STATE_BUFF_SAVED 512 /* If current keybuff is info->buff */
#define HA_STATE_ROW_CHANGED 1024 /* To invalide ROW cache */
#define HA_STATE_EXTEND_BLOCK 2048
-#define HA_STATE_RNEXT_SAME 4096 /* rnext_same was called */
+#define HA_STATE_RNEXT_SAME 4096 /* rnext_same occupied lastkey2 */
/* myisampack expects no more than 32 field types. */
enum en_fieldtype {
--- 1.38/myisam/mi_delete.c 2006-01-03 18:04:30 +01:00
+++ 1.39/myisam/mi_delete.c 2006-03-10 15:04:04 +01:00
@@ -88,6 +88,8 @@
_mi_make_key(info,i,old_key,record,info->lastpos)))
goto err;
}
+ /* The above changed info->lastkey2. Inform mi_rnext_same(). */
+ info->update&= ~HA_STATE_RNEXT_SAME;
}
}
--- 1.47/myisam/mi_key.c 2005-11-08 09:25:57 +01:00
+++ 1.48/myisam/mi_key.c 2006-03-10 15:04:04 +01:00
@@ -444,6 +444,10 @@
(char*) &blob_ptr,sizeof(char*));
memcpy(blob_ptr,key,length);
blob_ptr+=length;
+
+ /* The above changed info->lastkey2. Inform mi_rnext_same(). */
+ info->update&= ~HA_STATE_RNEXT_SAME;
+
_my_store_blob_length(record+keyseg->start,
(uint) keyseg->bit_start,length);
key+=length;
--- 1.18/myisam/mi_rnext_same.c 2005-10-27 19:04:31 +02:00
+++ 1.19/myisam/mi_rnext_same.c 2006-03-10 15:04:04 +01:00
@@ -40,7 +40,7 @@
if (info->s->concurrent_insert)
rw_rdlock(&info->s->key_root_lock[inx]);
-
+
switch (keyinfo->key_alg)
{
#ifdef HAVE_RTREE_KEYS
@@ -102,4 +102,4 @@
DBUG_RETURN(0);
}
DBUG_RETURN(my_errno);
-} /* mi_rnext */
+} /* mi_rnext_same */
--- 1.23/myisam/mi_unique.c 2005-07-04 02:42:04 +02:00
+++ 1.24/myisam/mi_unique.c 2006-03-10 15:04:04 +01:00
@@ -30,6 +30,9 @@
mi_unique_store(record+key->seg->start, unique_hash);
_mi_make_key(info,def->key,key_buff,record,0);
+ /* The above changed info->lastkey2. Inform mi_rnext_same(). */
+ info->update&= ~HA_STATE_RNEXT_SAME;
+
if (_mi_search(info,info->s->keyinfo+def->key,key_buff,MI_UNIQUE_HASH_LENGTH,
SEARCH_FIND,info->s->state.key_root[def->key]))
{
--- 1.19/myisam/mi_update.c 2005-09-27 20:10:55 +02:00
+++ 1.20/myisam/mi_update.c 2006-03-10 15:04:04 +01:00
@@ -111,6 +111,10 @@
{
uint new_length=_mi_make_key(info,i,new_key,newrec,pos);
uint old_length=_mi_make_key(info,i,old_key,oldrec,pos);
+
+ /* The above changed info->lastkey2. Inform mi_rnext_same(). */
+ info->update&= ~HA_STATE_RNEXT_SAME;
+
if (new_length != old_length ||
memcmp((byte*) old_key,(byte*) new_key,new_length))
{
--- 1.55/myisam/mi_write.c 2005-10-27 19:04:31 +02:00
+++ 1.56/myisam/mi_write.c 2006-03-10 15:04:04 +01:00
@@ -132,6 +132,10 @@
goto err;
}
}
+
+ /* The above changed info->lastkey2. Inform mi_rnext_same(). */
+ info->update&= ~HA_STATE_RNEXT_SAME;
+
if (local_lock_tree)
rw_unlock(&share->key_root_lock[i]);
}
--- 1.73/mysql-test/r/myisam.result 2006-02-16 08:59:48 +01:00
+++ 1.74/mysql-test/r/myisam.result 2006-03-10 15:06:00 +01:00
@@ -729,6 +729,24 @@
cip time score bob
1 00:01:00 0 NULL
drop table t1;
+create table t1 (
+id1 int not null auto_increment,
+id2 int not null default '0',
+t text not null,
+primary key (id1),
+key x (id2, t(32))
+) engine=myisam;
+insert into t1 (id2, t) values
+(10, 'abc'), (10, 'abc'), (10, 'abc'),
+(20, 'abc'), (20, 'abc'), (20, 'def'),
+(10, 'abc'), (10, 'abc');
+select count(*) from t1 where id2 = 10;
+count(*)
+5
+select count(id1) from t1 where id2 = 10;
+count(id1)
+5
+drop table t1;
set storage_engine=MyISAM;
drop table if exists t1,t2,t3;
--- Testing varchar ---
--- 1.54/mysql-test/t/myisam.test 2006-01-24 08:30:47 +01:00
+++ 1.55/mysql-test/t/myisam.test 2006-03-10 15:06:00 +01:00
@@ -678,6 +678,25 @@
create index bug on t1 (bob(22), cip, time);
select * from t1 where bob is null and cip=1;
drop table t1;
+
+#
+# Bug#14980 - COUNT(*) incorrect on MyISAM table with certain INDEX
+#
+create table t1 (
+ id1 int not null auto_increment,
+ id2 int not null default '0',
+ t text not null,
+ primary key (id1),
+ key x (id2, t(32))
+) engine=myisam;
+insert into t1 (id2, t) values
+(10, 'abc'), (10, 'abc'), (10, 'abc'),
+(20, 'abc'), (20, 'abc'), (20, 'def'),
+(10, 'abc'), (10, 'abc');
+select count(*) from t1 where id2 = 10;
+select count(id1) from t1 where id2 = 10;
+drop table t1;
+
# End of 4.1 tests
#
| Thread |
|---|
| • bk commit into 5.0 tree (ingo:1.2087) | ingo | 10 Mar |