MDEV-29242: Assertion `computed_weight == weight' failed SEL_ARG::verify_weight
Make SEL_ARG::make_root() maintain SEL_ARG::weight. Also, an unrelated change: fix dbug_print_sel_arg() to correctly print SQL NULL for the right endpoint.
This commit is contained in:
parent
ea12dafe65
commit
3b071bad19
@ -248,3 +248,12 @@ WHERE
|
|||||||
(help_topic_id < '2' OR help_topic_id != 8 OR help_topic_id < 1) AND
|
(help_topic_id < '2' OR help_topic_id != 8 OR help_topic_id < 1) AND
|
||||||
help_keyword_id = help_topic_id;
|
help_keyword_id = help_topic_id;
|
||||||
help_topic_id help_keyword_id
|
help_topic_id help_keyword_id
|
||||||
|
#
|
||||||
|
# MDEV-29242: Assertion `computed_weight == weight' failed SEL_ARG::verify_weight
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (id INT, KEY (id));
|
||||||
|
INSERT INTO t1 VALUES (1),(5);
|
||||||
|
SELECT id FROM t1 WHERE id IS NULL OR id NOT BETWEEN 1 AND 4;
|
||||||
|
id
|
||||||
|
5
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -150,3 +150,12 @@ FROM mysql.help_relation
|
|||||||
WHERE
|
WHERE
|
||||||
(help_topic_id < '2' OR help_topic_id != 8 OR help_topic_id < 1) AND
|
(help_topic_id < '2' OR help_topic_id != 8 OR help_topic_id < 1) AND
|
||||||
help_keyword_id = help_topic_id;
|
help_keyword_id = help_topic_id;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-29242: Assertion `computed_weight == weight' failed SEL_ARG::verify_weight
|
||||||
|
--echo #
|
||||||
|
CREATE TABLE t1 (id INT, KEY (id));
|
||||||
|
INSERT INTO t1 VALUES (1),(5);
|
||||||
|
SELECT id FROM t1 WHERE id IS NULL OR id NOT BETWEEN 1 AND 4;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
@ -1901,7 +1901,9 @@ inline void SEL_ARG::make_root()
|
|||||||
left=right= &null_element;
|
left=right= &null_element;
|
||||||
color=BLACK;
|
color=BLACK;
|
||||||
next=prev=0;
|
next=prev=0;
|
||||||
use_count=0; elements=1;
|
use_count=0;
|
||||||
|
elements=1;
|
||||||
|
weight= 1 + (next_key_part? next_key_part->weight : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
SEL_ARG::SEL_ARG(Field *f,const uchar *min_value_arg,
|
SEL_ARG::SEL_ARG(Field *f,const uchar *min_value_arg,
|
||||||
@ -16153,6 +16155,7 @@ const char *dbug_print_sel_arg(SEL_ARG *sel_arg)
|
|||||||
out.append("+inf");
|
out.append("+inf");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
buf.length(0);
|
||||||
print_sel_arg_key(sel_arg->field, sel_arg->max_value, &buf);
|
print_sel_arg_key(sel_arg->field, sel_arg->max_value, &buf);
|
||||||
out.append(buf);
|
out.append(buf);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user