Commit 58bc83e1 authored by Yuchen Pei's avatar Yuchen Pei

[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.
parent 8642453c
......@@ -1512,6 +1512,7 @@ int spider_db_append_key_hint(
if (str->reserve(
hint_str_len - 2 + SPIDER_SQL_INDEX_USE_LEN +
SPIDER_SQL_OPEN_PAREN_LEN + SPIDER_SQL_CLOSE_PAREN_LEN))
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
hint_str += 2;
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);
......@@ -1524,10 +1525,11 @@ int spider_db_append_key_hint(
if (str->reserve(
hint_str_len - 3 + SPIDER_SQL_INDEX_IGNORE_LEN +
SPIDER_SQL_OPEN_PAREN_LEN + SPIDER_SQL_CLOSE_PAREN_LEN))
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
hint_str += 3;
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(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);
} else if (str->reserve(hint_str_len + SPIDER_SQL_SPACE_LEN))
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++)
{
tmp_key_hint->length(0);
if (tmp_key_hint->append(spider_share->key_hint->ptr(),
spider_share->key_hint->length(), system_charset_info))
if (tmp_key_hint->append(spider_share->key_hint[roop_count].ptr(),
spider_share->key_hint[roop_count].length(), system_charset_info))
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
}
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment