summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorunknown <ingo@mysql.com>2006-06-28 18:55:30 +0200
committerunknown <ingo@mysql.com>2006-06-28 18:55:30 +0200
commit7aa26e264582964b6e4df64980edbee8cde8cbd7 (patch)
treeb472a6c7fd5a989ba1fcb599bc6b8443ab059848 /sql/sql_class.cc
parent65fcdee56e6ffccee45fc4ab70e6d3050fa0e20d (diff)
downloadmariadb-git-7aa26e264582964b6e4df64980edbee8cde8cbd7.tar.gz
Bug#14400 - Query joins wrong rows from table which is subject of "concurrent insert"
It was possible that fetching a record by an exact key value (including the record pointer) could return a record with a different key value. This happened only if a concurrent insert added a record with the searched key value after the fetching statement locked the table for read. The search succeded on the key value, but the record was rejected as it was past the file length that was remembered at start of the fetching statement. With other words it was rejected as being a concurrently inserted record. The action to recover from this problem was to fetch the record that is pointed at by the next key of the index. This was repeated until a record below the file length was found. I do now avoid this loop if an exact match was searched. If this match is beyond the file length, it is now treated as "key not found". There cannot be another key with the same record pointer. myisam/mi_rkey.c: Bug#14400 - Query joins wrong rows from table which is subject of "concurrent insert" Added a check for exact key match before searching for the next key that was not concurrently inserted. If an exact key match finds a concurrently inserted row, this must be treated as "key not found". sql/sql_class.cc: Bug#14400 - Query joins wrong rows from table which is subject of "concurrent insert" Fixed some DBUG_ENTER strings.
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 66d23ada163..f8cf8a7a58e 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -477,7 +477,7 @@ bool select_send::send_data(List<Item> &items)
{
List_iterator_fast<Item> li(items);
String *packet= &thd->packet;
- DBUG_ENTER("send_data");
+ DBUG_ENTER("select_send::send_data");
#ifdef HAVE_INNOBASE_DB
/* We may be passing the control from mysqld to the client: release the
@@ -611,7 +611,7 @@ select_export::prepare(List<Item> &list)
bool select_export::send_data(List<Item> &items)
{
- DBUG_ENTER("send_data");
+ DBUG_ENTER("select_export::send_data");
char buff[MAX_FIELD_WIDTH],null_buff[2],space[MAX_FIELD_WIDTH];
bool space_inited=0;
String tmp(buff,sizeof(buff)),*res;
@@ -828,7 +828,7 @@ bool select_dump::send_data(List<Item> &items)
String tmp(buff,sizeof(buff)),*res;
tmp.length(0);
Item *item;
- DBUG_ENTER("send_data");
+ DBUG_ENTER("select_dump::send_data");
if (thd->offset_limit)
{ // using limit offset,count