mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
WL#3700: Handler API change: all index search methods - that is,
index_read(), index_read_idx(), index_read_last(), and records_in_range() - instead of 'uint keylen' argument take 'ulonglong keypart_map', a bitmap showing which keyparts are present in the key value. Fallback method is provided for handlers that are lagging behind.
This commit is contained in:
@ -1813,8 +1813,7 @@ static bool update_user_table(THD *thd, TABLE *table,
|
||||
table->key_info->key_length);
|
||||
|
||||
if (table->file->index_read_idx(table->record[0], 0,
|
||||
(byte *) user_key,
|
||||
table->key_info->key_length,
|
||||
(byte *) user_key, ~ULL(0),
|
||||
HA_READ_KEY_EXACT))
|
||||
{
|
||||
my_message(ER_PASSWORD_NO_MATCH, ER(ER_PASSWORD_NO_MATCH),
|
||||
@ -1905,8 +1904,7 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo,
|
||||
key_copy(user_key, table->record[0], table->key_info,
|
||||
table->key_info->key_length);
|
||||
|
||||
if (table->file->index_read_idx(table->record[0], 0,
|
||||
user_key, table->key_info->key_length,
|
||||
if (table->file->index_read_idx(table->record[0], 0, user_key, ~ULL(0),
|
||||
HA_READ_KEY_EXACT))
|
||||
{
|
||||
/* what == 'N' means revoke */
|
||||
@ -2123,8 +2121,7 @@ static int replace_db_table(TABLE *table, const char *db,
|
||||
key_copy(user_key, table->record[0], table->key_info,
|
||||
table->key_info->key_length);
|
||||
|
||||
if (table->file->index_read_idx(table->record[0],0,
|
||||
user_key, table->key_info->key_length,
|
||||
if (table->file->index_read_idx(table->record[0],0, user_key, ~ULL(0),
|
||||
HA_READ_KEY_EXACT))
|
||||
{
|
||||
if (what == 'N')
|
||||
@ -2341,9 +2338,8 @@ GRANT_TABLE::GRANT_TABLE(TABLE *form, TABLE *col_privs)
|
||||
col_privs->field[4]->store("",0, &my_charset_latin1);
|
||||
|
||||
col_privs->file->ha_index_init(0, 1);
|
||||
if (col_privs->file->index_read(col_privs->record[0],
|
||||
(byte*) key,
|
||||
key_prefix_len, HA_READ_KEY_EXACT))
|
||||
if (col_privs->file->index_read(col_privs->record[0], (byte*) key,
|
||||
(ulonglong)15, HA_READ_KEY_EXACT))
|
||||
{
|
||||
cols = 0; /* purecov: deadcode */
|
||||
col_privs->file->ha_index_end();
|
||||
@ -2479,7 +2475,7 @@ static int replace_column_table(GRANT_TABLE *g_t,
|
||||
table->field[3]->store(table_name,(uint) strlen(table_name),
|
||||
system_charset_info);
|
||||
|
||||
/* Get length of 3 first key parts */
|
||||
/* Get length of 4 first key parts */
|
||||
key_prefix_length= (key_part[0].store_length + key_part[1].store_length +
|
||||
key_part[2].store_length + key_part[3].store_length);
|
||||
key_copy(key, table->record[0], table->key_info, key_prefix_length);
|
||||
@ -2505,8 +2501,7 @@ static int replace_column_table(GRANT_TABLE *g_t,
|
||||
key_copy(user_key, table->record[0], table->key_info,
|
||||
table->key_info->key_length);
|
||||
|
||||
if (table->file->index_read(table->record[0], user_key,
|
||||
table->key_info->key_length,
|
||||
if (table->file->index_read(table->record[0], user_key, ~(ulonglong)0,
|
||||
HA_READ_KEY_EXACT))
|
||||
{
|
||||
if (revoke_grant)
|
||||
@ -2582,8 +2577,7 @@ static int replace_column_table(GRANT_TABLE *g_t,
|
||||
key_copy(user_key, table->record[0], table->key_info,
|
||||
key_prefix_length);
|
||||
|
||||
if (table->file->index_read(table->record[0], user_key,
|
||||
key_prefix_length,
|
||||
if (table->file->index_read(table->record[0], user_key, (ulonglong)15,
|
||||
HA_READ_KEY_EXACT))
|
||||
goto end;
|
||||
|
||||
@ -2684,8 +2678,7 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table,
|
||||
key_copy(user_key, table->record[0], table->key_info,
|
||||
table->key_info->key_length);
|
||||
|
||||
if (table->file->index_read_idx(table->record[0], 0,
|
||||
user_key, table->key_info->key_length,
|
||||
if (table->file->index_read_idx(table->record[0], 0, user_key, ~ULL(0),
|
||||
HA_READ_KEY_EXACT))
|
||||
{
|
||||
/*
|
||||
@ -2808,8 +2801,8 @@ static int replace_routine_table(THD *thd, GRANT_NAME *grant_name,
|
||||
TRUE);
|
||||
store_record(table,record[1]); // store at pos 1
|
||||
|
||||
if (table->file->index_read_idx(table->record[0],0,
|
||||
(byte*) table->field[0]->ptr,0,
|
||||
if (table->file->index_read_idx(table->record[0], 0,
|
||||
(byte*) table->field[0]->ptr, ~ULL(0),
|
||||
HA_READ_KEY_EXACT))
|
||||
{
|
||||
/*
|
||||
@ -4987,7 +4980,7 @@ static int handle_grant_table(TABLE_LIST *tables, uint table_no, bool drop,
|
||||
key_copy(user_key, table->record[0], table->key_info, key_prefix_length);
|
||||
|
||||
if ((error= table->file->index_read_idx(table->record[0], 0,
|
||||
user_key, key_prefix_length,
|
||||
user_key, ULL(3),
|
||||
HA_READ_KEY_EXACT)))
|
||||
{
|
||||
if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE)
|
||||
|
Reference in New Issue
Block a user