mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
[fixup] Spider: Restored lines accidentally deleted in MDEV-32157
Also restored a change that resulted in off-by-one, as well as appending the correctly indexed key_hint.
This commit is contained in:
@@ -1512,6 +1512,7 @@ int spider_db_append_key_hint(
|
|||||||
if (str->reserve(
|
if (str->reserve(
|
||||||
hint_str_len - 2 + SPIDER_SQL_INDEX_USE_LEN +
|
hint_str_len - 2 + SPIDER_SQL_INDEX_USE_LEN +
|
||||||
SPIDER_SQL_OPEN_PAREN_LEN + SPIDER_SQL_CLOSE_PAREN_LEN))
|
SPIDER_SQL_OPEN_PAREN_LEN + SPIDER_SQL_CLOSE_PAREN_LEN))
|
||||||
|
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
||||||
hint_str += 2;
|
hint_str += 2;
|
||||||
str->q_append(SPIDER_SQL_INDEX_USE_STR, SPIDER_SQL_INDEX_USE_LEN);
|
str->q_append(SPIDER_SQL_INDEX_USE_STR, SPIDER_SQL_INDEX_USE_LEN);
|
||||||
str->q_append(SPIDER_SQL_OPEN_PAREN_STR, SPIDER_SQL_OPEN_PAREN_LEN);
|
str->q_append(SPIDER_SQL_OPEN_PAREN_STR, SPIDER_SQL_OPEN_PAREN_LEN);
|
||||||
@@ -1524,10 +1525,11 @@ int spider_db_append_key_hint(
|
|||||||
if (str->reserve(
|
if (str->reserve(
|
||||||
hint_str_len - 3 + SPIDER_SQL_INDEX_IGNORE_LEN +
|
hint_str_len - 3 + SPIDER_SQL_INDEX_IGNORE_LEN +
|
||||||
SPIDER_SQL_OPEN_PAREN_LEN + SPIDER_SQL_CLOSE_PAREN_LEN))
|
SPIDER_SQL_OPEN_PAREN_LEN + SPIDER_SQL_CLOSE_PAREN_LEN))
|
||||||
|
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
||||||
hint_str += 3;
|
hint_str += 3;
|
||||||
str->q_append(SPIDER_SQL_INDEX_IGNORE_STR, SPIDER_SQL_INDEX_IGNORE_LEN);
|
str->q_append(SPIDER_SQL_INDEX_IGNORE_STR, SPIDER_SQL_INDEX_IGNORE_LEN);
|
||||||
str->q_append(SPIDER_SQL_OPEN_PAREN_STR, SPIDER_SQL_OPEN_PAREN_LEN);
|
str->q_append(SPIDER_SQL_OPEN_PAREN_STR, SPIDER_SQL_OPEN_PAREN_LEN);
|
||||||
str->q_append(hint_str, hint_str_len - 2);
|
str->q_append(hint_str, hint_str_len - 3);
|
||||||
str->q_append(SPIDER_SQL_CLOSE_PAREN_STR, SPIDER_SQL_CLOSE_PAREN_LEN);
|
str->q_append(SPIDER_SQL_CLOSE_PAREN_STR, SPIDER_SQL_CLOSE_PAREN_LEN);
|
||||||
} else if (str->reserve(hint_str_len + SPIDER_SQL_SPACE_LEN))
|
} else if (str->reserve(hint_str_len + SPIDER_SQL_SPACE_LEN))
|
||||||
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
||||||
|
@@ -7612,8 +7612,8 @@ int spider_mbase_share::convert_key_hint_str()
|
|||||||
roop_count < (int) table_share->keys; roop_count++, tmp_key_hint++)
|
roop_count < (int) table_share->keys; roop_count++, tmp_key_hint++)
|
||||||
{
|
{
|
||||||
tmp_key_hint->length(0);
|
tmp_key_hint->length(0);
|
||||||
if (tmp_key_hint->append(spider_share->key_hint->ptr(),
|
if (tmp_key_hint->append(spider_share->key_hint[roop_count].ptr(),
|
||||||
spider_share->key_hint->length(), system_charset_info))
|
spider_share->key_hint[roop_count].length(), system_charset_info))
|
||||||
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user