Commit 0dc442ac authored by Varun Gupta's avatar Varun Gupta

MDEV-18942: Json_writer::add_bool: Conditional jump or move depends on...

MDEV-18942: Json_writer::add_bool: Conditional jump or move depends on uninitialised value upon fulltext search under optimizer trace

For keyuse of fulltext set the value for null_rejecting to FALSE
as we don't add NOT NULL keys for fulltext keyuses
parent eac97ef4
......@@ -6021,4 +6021,17 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
} 0 0
set @@optimizer_switch= @save_optimizer_switch;
drop table t1,t2;
#
# MDEV-18942: Json_writer::add_bool: Conditional jump or move depends on uninitialised value upon
# fulltext search under optimizer trace
#
CREATE TABLE t1 (f VARCHAR(255), FULLTEXT(f));
CREATE VIEW v1 AS SELECT * FROM t1;
INSERT INTO t1 VALUES ('fooba'),('abcde'),('xyzab');
SET optimizer_trace = 'enabled=on';
SELECT COUNT(*) FROM v1 WHERE MATCH (f) AGAINST ('fooba');
COUNT(*)
1
DROP VIEW v1;
DROP TABLE t1;
set optimizer_trace='enabled=off';
......@@ -373,4 +373,18 @@ explain select * from t1 t_outer_1,t2 t_outer_2 where t_outer_1.a in (select t_
select * from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
set @@optimizer_switch= @save_optimizer_switch;
drop table t1,t2;
--echo #
--echo # MDEV-18942: Json_writer::add_bool: Conditional jump or move depends on uninitialised value upon
--echo # fulltext search under optimizer trace
--echo #
CREATE TABLE t1 (f VARCHAR(255), FULLTEXT(f));
CREATE VIEW v1 AS SELECT * FROM t1;
INSERT INTO t1 VALUES ('fooba'),('abcde'),('xyzab');
SET optimizer_trace = 'enabled=on';
SELECT COUNT(*) FROM v1 WHERE MATCH (f) AGAINST ('fooba');
DROP VIEW v1;
DROP TABLE t1;
set optimizer_trace='enabled=off';
......@@ -6487,6 +6487,7 @@ add_ft_keys(DYNAMIC_ARRAY *keyuse_array,
keyuse.keypart_map= 0;
keyuse.sj_pred_no= UINT_MAX;
keyuse.validity_ref= 0;
keyuse.null_rejecting= FALSE;
return insert_dynamic(keyuse_array,(uchar*) &keyuse);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment