Bug #105794 | Regression in FIND_IN_SET() between 8.0.21 and 8.0.22 | ||
---|---|---|---|
Submitted: | 3 Dec 2021 17:14 | Modified: | 21 Dec 2021 20:26 |
Reporter: | David Landgren | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S2 (Serious) |
Version: | 8.0.22, 8.0.27 | OS: | Ubuntu (20.04) |
Assigned to: | CPU Architecture: | x86 | |
Tags: | regression |
[3 Dec 2021 17:14]
David Landgren
[3 Dec 2021 17:19]
MySQL Verification Team
Hello David Landgren, Thank you for the report and test case. regards, Umesh
[21 Dec 2021 20:26]
Jon Stephens
Documented fix as follows in the MySQL 8.0.29 changelog: When searching a SET column value, a user variable used as the first argument to FIND_IN_SET() did not produce the same result as a literal value. Example: Consider the table t1 created and populated as shown here: CREATE TABLE t1 (c1 SET('a', 'b', 'c', 'd')); INSERT INTO t1 (c1) VALUES ('a, c, d'), ('c'); The values shown in var and str should be the same in both rows of the output from the following query, but were not. SET @a = 'c'; SELECT FIND_IN_SET(@a, c1) AS var, FIND_IN_SET('c', c1) AS str FROM t1; Now we make sure in such cases to return the position of the match within the set used for the column definition whether the value sought is a constant or a column value.