MDEV-34002 Initialise fields in spider_db_handler

Otherwise it may result in nonsensical values like 190 for a boolean.
This commit is contained in:
Yuchen Pei 2024-06-04 14:07:12 +10:00
parent 40dd5b8676
commit d524cb5b3d
No known key found for this signature in database
GPG Key ID: 3DD1B35105743563
3 changed files with 18 additions and 5 deletions

View File

@ -0,0 +1,9 @@
INSTALL PLUGIN Spider SONAME 'ha_spider.so';
CREATE TABLE t (c DATE, c2 VARCHAR(1025) CHARACTER SET utf8mb3, UNIQUE KEY k(c2)) ENGINE=SPIDER;
UPDATE t SET c='';
ERROR HY000: Unable to connect to foreign data source: localhost
drop table t;
Warnings:
Warning 1620 Plugin is busy and will be uninstalled on shutdown
Note 1305 PLUGIN SPIDER_ALLOC_MEM does not exist
Note 1305 PLUGIN SPIDER_WRAPPER_PROTOCOLS does not exist

View File

@ -0,0 +1,7 @@
INSTALL PLUGIN Spider SONAME 'ha_spider.so';
CREATE TABLE t (c DATE, c2 VARCHAR(1025) CHARACTER SET utf8mb3, UNIQUE KEY k(c2)) ENGINE=SPIDER;
--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE
UPDATE t SET c='';
drop table t;
--disable_query_log
--source ../../include/clean_up_spider.inc

View File

@ -1136,11 +1136,8 @@ public:
ha_spider *spider;
spider_db_share *db_share;
int first_link_idx;
#ifdef SPIDER_HAS_GROUP_BY_HANDLER
SPIDER_LINK_IDX_CHAIN *link_idx_chain;
#endif
bool strict_group_by;
bool no_where_cond;
bool strict_group_by= false;
bool no_where_cond= false;
spider_db_handler(ha_spider *spider, spider_db_share *db_share) :
dbton_id(db_share->dbton_id), spider(spider), db_share(db_share),
first_link_idx(-1) {}