summaryrefslogtreecommitdiff
path: root/storage/spider/spd_db_conn.cc
diff options
context:
space:
mode:
Diffstat (limited to 'storage/spider/spd_db_conn.cc')
-rw-r--r--storage/spider/spd_db_conn.cc42
1 files changed, 33 insertions, 9 deletions
diff --git a/storage/spider/spd_db_conn.cc b/storage/spider/spd_db_conn.cc
index 264f85d74cb..be9ee324ee1 100644
--- a/storage/spider/spd_db_conn.cc
+++ b/storage/spider/spd_db_conn.cc
@@ -2008,12 +2008,20 @@ int spider_db_append_key_where_internal(
case HA_READ_AFTER_KEY:
if (sql_kind == SPIDER_SQL_KIND_SQL)
{
+ const char* op_str;
+ uint32 op_len;
+ if (start_key_part_map == 1) {
+ op_str = SPIDER_SQL_GT_STR;
+ op_len = SPIDER_SQL_GT_LEN;
+ } else {
+ op_str = SPIDER_SQL_GTEQUAL_STR;
+ op_len = SPIDER_SQL_GTEQUAL_LEN;
+ }
if (str->reserve(store_length + key_name_length +
- /* SPIDER_SQL_NAME_QUOTE_LEN */ 2 +
- SPIDER_SQL_GT_LEN))
+ /* SPIDER_SQL_NAME_QUOTE_LEN */ 2 + op_len))
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
dbton_share->append_column_name(str, field->field_index);
- str->q_append(SPIDER_SQL_GT_STR, SPIDER_SQL_GT_LEN);
+ str->q_append(op_str, op_len);
if (spider_dbton[dbton_id].db_util->
append_column_value(spider, str, field, ptr,
share->access_charset))
@@ -2081,12 +2089,20 @@ int spider_db_append_key_where_internal(
result_list->desc_flg = TRUE;
if (sql_kind == SPIDER_SQL_KIND_SQL)
{
+ const char* op_str;
+ uint32 op_len;
+ if (start_key_part_map == 1) {
+ op_str = SPIDER_SQL_LT_STR;
+ op_len = SPIDER_SQL_LT_LEN;
+ } else {
+ op_str = SPIDER_SQL_LTEQUAL_STR;
+ op_len = SPIDER_SQL_LTEQUAL_LEN;
+ }
if (str->reserve(store_length + key_name_length +
- /* SPIDER_SQL_NAME_QUOTE_LEN */ 2 +
- SPIDER_SQL_LT_LEN))
+ /* SPIDER_SQL_NAME_QUOTE_LEN */ 2 + op_len))
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
dbton_share->append_column_name(str, field->field_index);
- str->q_append(SPIDER_SQL_LT_STR, SPIDER_SQL_LT_LEN);
+ str->q_append(op_str, op_len);
if (spider_dbton[dbton_id].db_util->
append_column_value(spider, str, field, ptr,
share->access_charset))
@@ -2499,12 +2515,20 @@ int spider_db_append_key_where_internal(
case HA_READ_BEFORE_KEY:
if (sql_kind == SPIDER_SQL_KIND_SQL)
{
+ const char* op_str;
+ uint32 op_len;
+ if (end_key_part_map == 1) {
+ op_str = SPIDER_SQL_LT_STR;
+ op_len = SPIDER_SQL_LT_LEN;
+ } else {
+ op_str = SPIDER_SQL_LTEQUAL_STR;
+ op_len = SPIDER_SQL_LTEQUAL_LEN;
+ }
if (str->reserve(store_length + key_name_length +
- /* SPIDER_SQL_NAME_QUOTE_LEN */ 2 +
- SPIDER_SQL_LT_LEN))
+ /* SPIDER_SQL_NAME_QUOTE_LEN */ 2 + op_len))
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
dbton_share->append_column_name(str, field->field_index);
- str->q_append(SPIDER_SQL_LT_STR, SPIDER_SQL_LT_LEN);
+ str->q_append(op_str, op_len);
if (spider_dbton[dbton_id].db_util->
append_column_value(spider, str, field, ptr,
share->access_charset))