mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +02:00
Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into janus.mylan:/usr/home/serg/Abk/mysql-5.1 dbug/dbug.c: Auto merged include/my_base.h: Auto merged include/my_global.h: Auto merged sql/event_db_repository.cc: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/ha_ndbcluster.h: Auto merged sql/ha_partition.cc: Auto merged sql/handler.cc: Auto merged sql/item_subselect.cc: Auto merged sql/log.cc: Auto merged sql/log_event.cc: Auto merged sql/mysql_priv.h: Auto merged sql/opt_range.h: Auto merged sql/opt_sum.cc: Auto merged sql/slave.cc: Auto merged sql/slave.h: Auto merged sql/sp.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_plugin.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_servers.cc: Auto merged sql/sql_servers.h: Auto merged sql/table.cc: Auto merged sql/table.h: Auto merged sql/tztime.cc: Auto merged storage/heap/ha_heap.cc: Auto merged storage/myisammrg/ha_myisammrg.cc: Auto merged support-files/Makefile.am: Auto merged sql/opt_range.cc: manual merge storage/example/ha_example.cc: manual merge storage/federated/ha_federated.cc: manual merge storage/myisam/ha_myisam.cc: manual merge storage/myisam/mi_rkey.c: manual merge
This commit is contained in:
commit
bd47544561
75 changed files with 628 additions and 443 deletions
|
|
@ -238,34 +238,35 @@ int ha_heap::delete_row(const byte * buf)
|
|||
return res;
|
||||
}
|
||||
|
||||
int ha_heap::index_read(byte * buf, const byte * key, uint key_len,
|
||||
int ha_heap::index_read(byte * buf, const byte * key, ulonglong keypart_map,
|
||||
enum ha_rkey_function find_flag)
|
||||
{
|
||||
DBUG_ASSERT(inited==INDEX);
|
||||
statistic_increment(table->in_use->status_var.ha_read_key_count,
|
||||
&LOCK_status);
|
||||
int error = heap_rkey(file,buf,active_index, key, key_len, find_flag);
|
||||
int error = heap_rkey(file,buf,active_index, key, keypart_map, find_flag);
|
||||
table->status = error ? STATUS_NOT_FOUND : 0;
|
||||
return error;
|
||||
}
|
||||
|
||||
int ha_heap::index_read_last(byte *buf, const byte *key, uint key_len)
|
||||
int ha_heap::index_read_last(byte *buf, const byte *key, ulonglong keypart_map)
|
||||
{
|
||||
DBUG_ASSERT(inited==INDEX);
|
||||
statistic_increment(table->in_use->status_var.ha_read_key_count,
|
||||
&LOCK_status);
|
||||
int error= heap_rkey(file, buf, active_index, key, key_len,
|
||||
int error= heap_rkey(file, buf, active_index, key, keypart_map,
|
||||
HA_READ_PREFIX_LAST);
|
||||
table->status= error ? STATUS_NOT_FOUND : 0;
|
||||
return error;
|
||||
}
|
||||
|
||||
int ha_heap::index_read_idx(byte * buf, uint index, const byte * key,
|
||||
uint key_len, enum ha_rkey_function find_flag)
|
||||
ulonglong keypart_map,
|
||||
enum ha_rkey_function find_flag)
|
||||
{
|
||||
statistic_increment(table->in_use->status_var.ha_read_key_count,
|
||||
&LOCK_status);
|
||||
int error = heap_rkey(file, buf, index, key, key_len, find_flag);
|
||||
int error = heap_rkey(file, buf, index, key, keypart_map, find_flag);
|
||||
table->status = error ? STATUS_NOT_FOUND : 0;
|
||||
return error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,11 +75,11 @@ public:
|
|||
ulonglong nb_desired_values,
|
||||
ulonglong *first_value,
|
||||
ulonglong *nb_reserved_values);
|
||||
int index_read(byte * buf, const byte * key,
|
||||
uint key_len, enum ha_rkey_function find_flag);
|
||||
int index_read_idx(byte * buf, uint idx, const byte * key,
|
||||
uint key_len, enum ha_rkey_function find_flag);
|
||||
int index_read_last(byte * buf, const byte * key, uint key_len);
|
||||
int index_read(byte * buf, const byte * key, ulonglong keypart_map,
|
||||
enum ha_rkey_function find_flag);
|
||||
int index_read_last(byte *buf, const byte *key, ulonglong keypart_map);
|
||||
int index_read_idx(byte * buf, uint index, const byte * key,
|
||||
ulonglong keypart_map, enum ha_rkey_function find_flag);
|
||||
int index_next(byte * buf);
|
||||
int index_prev(byte * buf);
|
||||
int index_first(byte * buf);
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ extern int hp_close(register HP_INFO *info);
|
|||
extern void hp_clear(HP_SHARE *info);
|
||||
extern void hp_clear_keys(HP_SHARE *info);
|
||||
extern uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old,
|
||||
uint k_len);
|
||||
ulonglong keypart_map);
|
||||
#ifdef THREAD
|
||||
extern pthread_mutex_t THR_LOCK_heap;
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -784,30 +784,26 @@ uint hp_rb_make_key(HP_KEYDEF *keydef, byte *key,
|
|||
|
||||
|
||||
uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old,
|
||||
uint k_len)
|
||||
ulonglong keypart_map)
|
||||
{
|
||||
HA_KEYSEG *seg, *endseg;
|
||||
uchar *start_key= key;
|
||||
|
||||
for (seg= keydef->seg, endseg= seg + keydef->keysegs;
|
||||
seg < endseg && (int) k_len > 0; old+= seg->length, seg++)
|
||||
seg < endseg && keypart_map; old+= seg->length, seg++)
|
||||
{
|
||||
uint char_length;
|
||||
keypart_map>>= 1;
|
||||
if (seg->null_bit)
|
||||
{
|
||||
k_len--;
|
||||
if (!(*key++= (char) 1 - *old++))
|
||||
{
|
||||
k_len-= seg->length;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (seg->flag & HA_SWAP_KEY)
|
||||
{
|
||||
uint length= seg->length;
|
||||
byte *pos= (byte*) old + length;
|
||||
|
||||
k_len-= length;
|
||||
while (length--)
|
||||
{
|
||||
*key++= *--pos;
|
||||
|
|
@ -822,7 +818,6 @@ uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old,
|
|||
CHARSET_INFO *cs= seg->charset;
|
||||
char_length= length/cs->mbmaxlen;
|
||||
|
||||
k_len-= 2+length;
|
||||
old+= 2;
|
||||
set_if_smaller(length,tmp_length); /* Safety */
|
||||
FIX_LENGTH(cs, old, length, char_length);
|
||||
|
|
@ -843,7 +838,6 @@ uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old,
|
|||
}
|
||||
memcpy(key, old, (size_t) char_length);
|
||||
key+= seg->length;
|
||||
k_len-= seg->length;
|
||||
}
|
||||
return (uint) (key - start_key);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
#include "heapdef.h"
|
||||
|
||||
int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key,
|
||||
uint key_len, enum ha_rkey_function find_flag)
|
||||
ulonglong keypart_map, enum ha_rkey_function find_flag)
|
||||
{
|
||||
byte *pos;
|
||||
HP_SHARE *share= info->s;
|
||||
|
|
@ -38,7 +38,7 @@ int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key,
|
|||
custom_arg.keyseg= info->s->keydef[inx].seg;
|
||||
custom_arg.key_length= info->lastkey_len=
|
||||
hp_rb_pack_key(keyinfo, (uchar*) info->lastkey,
|
||||
(uchar*) key, key_len);
|
||||
(uchar*) key, keypart_map);
|
||||
custom_arg.search_flag= SEARCH_FIND | SEARCH_SAME;
|
||||
/* for next rkey() after deletion */
|
||||
if (find_flag == HA_READ_AFTER_KEY)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue