Skip to content

Commit d524cb5

Browse files
MDEV-34002 Initialise fields in spider_db_handler
Otherwise it may result in nonsensical values like 190 for a boolean.
1 parent 40dd5b8 commit d524cb5

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
INSTALL PLUGIN Spider SONAME 'ha_spider.so';
2+
CREATE TABLE t (c DATE, c2 VARCHAR(1025) CHARACTER SET utf8mb3, UNIQUE KEY k(c2)) ENGINE=SPIDER;
3+
UPDATE t SET c='2';
4+
ERROR HY000: Unable to connect to foreign data source: localhost
5+
drop table t;
6+
Warnings:
7+
Warning 1620 Plugin is busy and will be uninstalled on shutdown
8+
Note 1305 PLUGIN SPIDER_ALLOC_MEM does not exist
9+
Note 1305 PLUGIN SPIDER_WRAPPER_PROTOCOLS does not exist
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
INSTALL PLUGIN Spider SONAME 'ha_spider.so';
2+
CREATE TABLE t (c DATE, c2 VARCHAR(1025) CHARACTER SET utf8mb3, UNIQUE KEY k(c2)) ENGINE=SPIDER;
3+
--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE
4+
UPDATE t SET c='2';
5+
drop table t;
6+
--disable_query_log
7+
--source ../../include/clean_up_spider.inc

storage/spider/spd_db_include.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,11 +1136,8 @@ class spider_db_handler
11361136
ha_spider *spider;
11371137
spider_db_share *db_share;
11381138
int first_link_idx;
1139-
#ifdef SPIDER_HAS_GROUP_BY_HANDLER
1140-
SPIDER_LINK_IDX_CHAIN *link_idx_chain;
1141-
#endif
1142-
bool strict_group_by;
1143-
bool no_where_cond;
1139+
bool strict_group_by= false;
1140+
bool no_where_cond= false;
11441141
spider_db_handler(ha_spider *spider, spider_db_share *db_share) :
11451142
dbton_id(db_share->dbton_id), spider(spider), db_share(db_share),
11461143
first_link_idx(-1) {}

0 commit comments

Comments
 (0)