Skip to content

Commit

Permalink
MDEV-34002 Initialise fields in spider_db_handler
Browse files Browse the repository at this point in the history
Otherwise it may result in nonsensical values like 190 for a boolean.
  • Loading branch information
mariadb-YuchenPei committed Jun 10, 2024
1 parent 40dd5b8 commit d524cb5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
9 changes: 9 additions & 0 deletions storage/spider/mysql-test/spider/bugfix/r/mdev_34002.result
Original file line number Diff line number Diff line change
@@ -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='2';
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
7 changes: 7 additions & 0 deletions storage/spider/mysql-test/spider/bugfix/t/mdev_34002.test
Original file line number Diff line number Diff line change
@@ -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='2';
drop table t;
--disable_query_log
--source ../../include/clean_up_spider.inc
7 changes: 2 additions & 5 deletions storage/spider/spd_db_include.h
Original file line number Diff line number Diff line change
Expand Up @@ -1136,11 +1136,8 @@ class spider_db_handler
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) {}
Expand Down

0 comments on commit d524cb5

Please sign in to comment.