summaryrefslogtreecommitdiff
path: root/storage/spider
diff options
context:
space:
mode:
authorKentoku SHIBA <kentokushiba@gmail.com>2014-03-25 05:10:40 +0900
committerKentoku SHIBA <kentokushiba@gmail.com>2014-03-25 05:10:40 +0900
commit74195f40b49070b949822361deeba97c383cd0e7 (patch)
treedabba66670fb91370a98ab1a30099f390463d514 /storage/spider
parent5b07977ac6677c7beced1a804bcdf3c570a84f58 (diff)
downloadmariadb-git-74195f40b49070b949822361deeba97c383cd0e7.tar.gz
current date
Diffstat (limited to 'storage/spider')
-rw-r--r--storage/spider/ha_spider.cc20
-rw-r--r--storage/spider/spd_db_conn.cc19
-rw-r--r--storage/spider/spd_db_include.h1
3 files changed, 29 insertions, 11 deletions
diff --git a/storage/spider/ha_spider.cc b/storage/spider/ha_spider.cc
index 67c2164b818..7d8ad886200 100644
--- a/storage/spider/ha_spider.cc
+++ b/storage/spider/ha_spider.cc
@@ -9438,11 +9438,6 @@ int ha_spider::direct_update_rows_init(
}
result_list.direct_order_limit = TRUE;
}
-
- if ((error_num = spider_check_trx_and_get_conn(thd, this, TRUE)))
- {
- DBUG_RETURN(error_num);
- }
trx->direct_update_count++;
DBUG_PRINT("info",("spider OK"));
DBUG_RETURN(0);
@@ -9481,6 +9476,10 @@ int ha_spider::direct_update_rows_init(
do_direct_update = FALSE;
DBUG_RETURN(HA_ERR_WRONG_COMMAND);
}
+ if ((error_num = spider_check_trx_and_get_conn(thd, this, TRUE)))
+ {
+ DBUG_RETURN(error_num);
+ }
#endif
trx->direct_update_count++;
DBUG_PRINT("info",("spider OK"));
@@ -9728,11 +9727,6 @@ int ha_spider::direct_delete_rows_init(
}
result_list.direct_order_limit = TRUE;
}
-
- if ((error_num = spider_check_trx_and_get_conn(thd, this, TRUE)))
- {
- DBUG_RETURN(error_num);
- }
trx->direct_delete_count++;
DBUG_PRINT("info",("spider OK"));
DBUG_RETURN(0);
@@ -9750,6 +9744,12 @@ int ha_spider::direct_delete_rows_init(
#endif
do_direct_update
) {
+#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
+ if ((error_num = spider_check_trx_and_get_conn(thd, this, TRUE)))
+ {
+ DBUG_RETURN(error_num);
+ }
+#endif
trx->direct_delete_count++;
DBUG_PRINT("info",("spider OK"));
DBUG_RETURN(0);
diff --git a/storage/spider/spd_db_conn.cc b/storage/spider/spd_db_conn.cc
index 7f35c1d6608..23f487b9c56 100644
--- a/storage/spider/spd_db_conn.cc
+++ b/storage/spider/spd_db_conn.cc
@@ -8026,10 +8026,27 @@ int spider_db_open_item_int(
{
char tmp_buf[MAX_FIELD_WIDTH];
spider_string tmp_str(tmp_buf, MAX_FIELD_WIDTH, str->charset());
+ String *tmp_str2;
tmp_str.init_calc_mem(127);
- if (str->append(*item->val_str(tmp_str.get_str())))
+ if (!(tmp_str2 = item->val_str(tmp_str.get_str())))
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
tmp_str.mem_calc();
+#ifdef SPIDER_ITEM_HAS_CMP_TYPE
+ DBUG_PRINT("info",("spider cmp_type=%u", item->cmp_type()));
+ if (item->cmp_type() == TIME_RESULT)
+ {
+ if (str->reserve(SPIDER_SQL_VALUE_QUOTE_LEN * 2 + tmp_str2->length()))
+ DBUG_RETURN(HA_ERR_OUT_OF_MEM);
+ str->q_append(SPIDER_SQL_VALUE_QUOTE_STR, SPIDER_SQL_VALUE_QUOTE_LEN);
+ str->append(*tmp_str2);
+ str->q_append(SPIDER_SQL_VALUE_QUOTE_STR, SPIDER_SQL_VALUE_QUOTE_LEN);
+ } else {
+#endif
+ if (str->append(*tmp_str2))
+ DBUG_RETURN(HA_ERR_OUT_OF_MEM);
+#ifdef SPIDER_ITEM_HAS_CMP_TYPE
+ }
+#endif
}
DBUG_RETURN(0);
}
diff --git a/storage/spider/spd_db_include.h b/storage/spider/spd_db_include.h
index 37de22a86b1..83e8b83dfc6 100644
--- a/storage/spider/spd_db_include.h
+++ b/storage/spider/spd_db_include.h
@@ -28,6 +28,7 @@
#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100007
#define SPIDER_HAS_DISCOVER_TABLE_STRUCTURE_COMMENT
+#define SPIDER_ITEM_HAS_CMP_TYPE
#endif
#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100004