mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 18:41:56 +01:00
Merge chilla.local:/home/mydev/mysql-5.0
into chilla.local:/home/mydev/mysql-5.0-ateam libmysqld/lib_sql.cc: Auto merged libmysqld/libmysqld.c: Auto merged myisam/mi_check.c: Auto merged myisam/mi_create.c: Auto merged myisam/mi_dynrec.c: Auto merged myisam/mi_key.c: Auto merged mysql-test/r/func_sapdb.result: Auto merged mysql-test/r/func_time.result: Auto merged mysql-test/r/gis-rtree.result: Auto merged mysql-test/r/gis.result: Auto merged mysql-test/r/myisam.result: Auto merged mysql-test/r/symlink.result: Auto merged mysql-test/t/func_sapdb.test: Auto merged mysql-test/t/func_time.test: Auto merged mysql-test/t/gis-rtree.test: Auto merged mysql-test/t/gis.test: Auto merged mysql-test/t/key.test: Auto merged mysql-test/t/myisam.test: Auto merged scripts/make_binary_distribution.sh: Auto merged sql/field.cc: Auto merged sql/item_geofunc.h: Auto merged sql/item_timefunc.cc: Auto merged sql/opt_sum.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_parse.cc: Auto merged sql-common/client.c: Auto merged sql/table.cc: Auto merged support-files/mysql.spec.sh: Auto merged mysql-test/r/ctype_utf8.result: Manual merge mysql-test/r/key.result: Manual merge mysql-test/t/ctype_utf8.test: Manual merge
This commit is contained in:
commit
5d6e7a0016
2 changed files with 21 additions and 9 deletions
|
@ -68,6 +68,7 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, uint key_len,
|
||||||
|
|
||||||
if (fast_mi_readinfo(info))
|
if (fast_mi_readinfo(info))
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
if (share->concurrent_insert)
|
if (share->concurrent_insert)
|
||||||
rw_rdlock(&share->key_root_lock[inx]);
|
rw_rdlock(&share->key_root_lock[inx]);
|
||||||
|
|
||||||
|
@ -92,14 +93,24 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, uint key_len,
|
||||||
if (!_mi_search(info, keyinfo, key_buff, use_key_length,
|
if (!_mi_search(info, keyinfo, key_buff, use_key_length,
|
||||||
myisam_read_vec[search_flag], info->s->state.key_root[inx]))
|
myisam_read_vec[search_flag], info->s->state.key_root[inx]))
|
||||||
{
|
{
|
||||||
while (info->lastpos >= info->state->data_file_length)
|
/*
|
||||||
|
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))
|
||||||
|
{
|
||||||
|
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
|
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
|
Note that this can only happen if we are not searching after an
|
||||||
exact key, because the keys are sorted according to position
|
exact key, because the keys are sorted according to position
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (_mi_search_next(info, keyinfo, info->lastkey,
|
if (_mi_search_next(info, keyinfo, info->lastkey,
|
||||||
info->lastkey_length,
|
info->lastkey_length,
|
||||||
myisam_readnext_vec[search_flag],
|
myisam_readnext_vec[search_flag],
|
||||||
|
@ -108,6 +119,7 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, uint key_len,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (share->concurrent_insert)
|
if (share->concurrent_insert)
|
||||||
rw_unlock(&share->key_root_lock[inx]);
|
rw_unlock(&share->key_root_lock[inx]);
|
||||||
|
|
||||||
|
|
|
@ -930,7 +930,7 @@ bool select_send::send_data(List<Item> &items)
|
||||||
Protocol *protocol= thd->protocol;
|
Protocol *protocol= thd->protocol;
|
||||||
char buff[MAX_FIELD_WIDTH];
|
char buff[MAX_FIELD_WIDTH];
|
||||||
String buffer(buff, sizeof(buff), &my_charset_bin);
|
String buffer(buff, sizeof(buff), &my_charset_bin);
|
||||||
DBUG_ENTER("send_data");
|
DBUG_ENTER("select_send::send_data");
|
||||||
|
|
||||||
protocol->prepare_for_resend();
|
protocol->prepare_for_resend();
|
||||||
Item *item;
|
Item *item;
|
||||||
|
@ -1140,7 +1140,7 @@ select_export::prepare(List<Item> &list, SELECT_LEX_UNIT *u)
|
||||||
bool select_export::send_data(List<Item> &items)
|
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];
|
char buff[MAX_FIELD_WIDTH],null_buff[2],space[MAX_FIELD_WIDTH];
|
||||||
bool space_inited=0;
|
bool space_inited=0;
|
||||||
String tmp(buff,sizeof(buff),&my_charset_bin),*res;
|
String tmp(buff,sizeof(buff),&my_charset_bin),*res;
|
||||||
|
@ -1297,7 +1297,7 @@ bool select_dump::send_data(List<Item> &items)
|
||||||
String tmp(buff,sizeof(buff),&my_charset_bin),*res;
|
String tmp(buff,sizeof(buff),&my_charset_bin),*res;
|
||||||
tmp.length(0);
|
tmp.length(0);
|
||||||
Item *item;
|
Item *item;
|
||||||
DBUG_ENTER("send_data");
|
DBUG_ENTER("select_dump::send_data");
|
||||||
|
|
||||||
if (unit->offset_limit_cnt)
|
if (unit->offset_limit_cnt)
|
||||||
{ // using limit offset,count
|
{ // using limit offset,count
|
||||||
|
|
Loading…
Add table
Reference in a new issue