Below is the list of changes that have just been committed into a local
4.1 repository of istruewing. When istruewing 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@stripped, 2006-08-19 20:07:17+02:00, istruewing@stripped +6 -0
Merge bk-internal:/home/bk/mysql-4.0
into chilla.local:/home/mydev/mysql-4.1-amerge
MERGE: 1.1346.1.847
BitKeeper/etc/ignore@stripped, 2006-08-19 19:41:15+02:00, istruewing@stripped +6 -6
auto-union
MERGE: 1.107.1.61
include/my_global.h@stripped, 2006-08-19 19:41:16+02:00, istruewing@stripped +0 -1
Auto merged
MERGE: 1.34.1.41
myisam/mi_rkey.c@stripped, 2006-08-19 20:07:16+02:00, istruewing@stripped +28 -29
Manual merge
MERGE: 1.11.1.5
mysql-test/r/myisam.result@stripped, 2006-08-19 20:07:16+02:00, istruewing@stripped +0 -0
Manual merge
MERGE: 1.10.1.22
mysql-test/t/myisam.test@stripped, 2006-08-19 20:07:16+02:00, istruewing@stripped +0 -1
Manual merge
MERGE: 1.7.1.21
sql/sql_select.cc@stripped, 2006-08-19 20:07:16+02:00, istruewing@stripped +9 -11
Manual merge
MERGE: 1.152.1.144
# 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: istruewing
# Host: chilla.local
# Root: /home/mydev/mysql-4.1-amerge/RESYNC
--- 1.19/myisam/mi_rkey.c 2006-08-19 20:07:21 +02:00
+++ 1.20/myisam/mi_rkey.c 2006-08-19 20:07:21 +02:00
@@ -92,33 +92,39 @@ int mi_rkey(MI_INFO *info, byte *buf, in
if (!_mi_search(info, keyinfo, key_buff, use_key_length,
myisam_read_vec[search_flag], info->s->state.key_root[inx]))
{
- /*
- If we are searching for an exact key (including the data pointer)
- and this was added by an concurrent insert,
- then the result is "key not found".
- */
- if ((search_flag == HA_READ_KEY_EXACT) &&
- (info->lastpos >= info->state->data_file_length))
+ if (info->lastpos >= info->state->data_file_length)
{
- my_errno= HA_ERR_KEY_NOT_FOUND;
- info->lastpos= HA_OFFSET_ERROR;
- }
- else while (info->lastpos >= info->state->data_file_length)
- {
- /*
- Skip rows that are inserted by other threads since we got a lock
- Note that this can only happen if we are not searching after an
- exact key, because the keys are sorted according to position
- */
- if (_mi_search_next(info, keyinfo, info->lastkey,
- info->lastkey_length,
- myisam_readnext_vec[search_flag],
- info->s->state.key_root[inx]))
- break;
+ do
+ {
+ uint not_used;
+ /*
+ If we are searching for an exact key, abort if we find a bigger
+ key.
+ */
+ if (search_flag == HA_READ_KEY_EXACT &&
+ (use_key_length == USE_WHOLE_KEY ||
+ _mi_key_cmp(keyinfo->seg, key_buff, info->lastkey, use_key_length,
+ SEARCH_FIND, ¬_used)))
+ {
+ my_errno= HA_ERR_END_OF_FILE;
+ info->lastpos= HA_OFFSET_ERROR;
+ break;
+ }
+ /*
+ Skip rows that are inserted by other threads since we got a lock
+ Note that this can only happen if we are not searching after an
+ full length exact key, because the keys are sorted
+ according to position
+ */
+ if (_mi_search_next(info, keyinfo, info->lastkey,
+ info->lastkey_length,
+ myisam_readnext_vec[search_flag],
+ info->s->state.key_root[inx]))
+ break;
+ } while (info->lastpos >= info->state->data_file_length);
}
}
}
-
if (share->concurrent_insert)
rw_unlock(&share->key_root_lock[inx]);
--- 1.453/sql/sql_select.cc 2006-08-19 20:07:21 +02:00
+++ 1.454/sql/sql_select.cc 2006-08-19 20:07:21 +02:00
@@ -9083,6 +9083,8 @@ setup_copy_fields(THD *thd, TMP_TABLE_PA
param->copy_funcs.empty();
for (i= 0; (pos= li++); i++)
{
+ Field *field;
+ char *tmp;
if (pos->type() == Item::FIELD_ITEM)
{
Item_field *item;
@@ -9113,11 +9115,19 @@ setup_copy_fields(THD *thd, TMP_TABLE_PA
*/
Field *field= item->field;
item->result_field=field->new_field(thd->mem_root,field->table);
- char *tmp=(char*) sql_alloc(field->pack_length()+1);
+ /*
+ We need to allocate one extra byte for null handling and
+ another extra byte to not get warnings from purify in
+ Field_string::val_int
+ */
+ tmp= (char*) sql_alloc(field->pack_length()+2);
if (!tmp)
goto err;
copy->set(tmp, item->result_field);
item->result_field->move_field(copy->to_ptr,copy->to_null_ptr,1);
+#ifdef HAVE_purify
+ copy->to_ptr[copy->from_length]= 0;
+#endif
copy++;
}
}
--- 1.62/mysql-test/r/myisam.result 2006-08-19 20:07:21 +02:00
+++ 1.63/mysql-test/r/myisam.result 2006-08-19 20:07:21 +02:00
@@ -508,6 +508,21 @@ select c1 from t1 order by c1 limit 1;
c1
a
drop table t1;
+create table t1 (a int not null, primary key(a));
+create table t2 (a int not null, b int not null, primary key(a,b));
+insert into t1 values (1),(2),(3),(4),(5),(6);
+insert into t2 values (1,1),(2,1);
+lock tables t1 read local, t2 read local;
+select straight_join * from t1,t2 force index (primary) where t1.a=t2.a;
+a a b
+1 1 1
+2 2 1
+insert into t2 values(2,0);
+select straight_join * from t1,t2 force index (primary) where t1.a=t2.a;
+a a b
+1 1 1
+2 2 1
+drop table t1,t2;
CREATE TABLE t1 (`a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', UNIQUE KEY `a` USING RTREE (`a`,`b`)) ENGINE=MyISAM;
Got one of the listed errors
create table t1 (a int, b varchar(200), c text not null) checksum=1;
--- 1.48/mysql-test/t/myisam.test 2006-08-19 20:07:21 +02:00
+++ 1.49/mysql-test/t/myisam.test 2006-08-19 20:07:21 +02:00
@@ -486,6 +486,22 @@ select c1 from t1 order by c1 limit 1;
drop table t1;
#
+# Bug #14400 Join could miss concurrently inserted row
+#
+create table t1 (a int not null, primary key(a));
+create table t2 (a int not null, b int not null, primary key(a,b));
+insert into t1 values (1),(2),(3),(4),(5),(6);
+insert into t2 values (1,1),(2,1);
+lock tables t1 read local, t2 read local;
+select straight_join * from t1,t2 force index (primary) where t1.a=t2.a;
+connect (root,localhost,root,,test,$MASTER_MYPORT,master.sock);
+insert into t2 values(2,0);
+disconnect root;
+connection default;
+select straight_join * from t1,t2 force index (primary) where t1.a=t2.a;
+drop table t1,t2;
+
+# end of 4.0 tests
# Test RTREE index
#
--error 1235, 1289
--- 1.235/BitKeeper/etc/ignore 2006-08-19 20:07:21 +02:00
+++ 1.236/BitKeeper/etc/ignore 2006-08-19 20:07:21 +02:00
@@ -1,3 +1,5 @@
+*.Plo
+*.Po
*.a
*.bb
*.bbg
@@ -11,6 +13,8 @@
*.reject
*.spec
*/*_pure_*warnings
+*/.deps
+*/.libs/*
*/.pure
*~
.*.swp
@@ -336,6 +340,7 @@ isam/test2
isam/test3
libmysql/*.c
libmysql/conf_to_src
+libmysql/libmysql.ver
libmysql/my_static.h
libmysql/my_time.c
libmysql/mysys_priv.h
@@ -443,6 +448,7 @@ libmysqld/sql_insert.cc
libmysqld/sql_lex.cc
libmysqld/sql_list.cc
libmysqld/sql_load.cc
+libmysqld/sql_locale.cc
libmysqld/sql_manager.cc
libmysqld/sql_map.cc
libmysqld/sql_olap.cc
@@ -1057,5 +1063,3 @@ vio/test-ssl
vio/test-sslclient
vio/test-sslserver
vio/viotest-ssl
-libmysql/libmysql.ver
-libmysqld/sql_locale.cc
| Thread |
|---|
| • bk commit into 4.1 tree (istruewing:1.2542) | ingo | 19 Aug |