Bug #101256 | Regexp_engine::Replace doesn't reset error code after processing a record | ||
---|---|---|---|
Submitted: | 21 Oct 2020 6:02 | Modified: | 5 Nov 2020 22:56 |
Reporter: | Hope Lee (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S2 (Serious) |
Version: | 8.0.13, 8.0.22 | OS: | CentOS |
Assigned to: | CPU Architecture: | Any |
[21 Oct 2020 6:02]
Hope Lee
[21 Oct 2020 7:13]
MySQL Verification Team
Hello Lee, Thank you for the report and test case. - 8.0.22 (no crash in latest GA) mysql> SELECT REGEXP_REPLACE(a, ' \+', 'aamz') from t1; +----------------------------------+ | REGEXP_REPLACE(a, ' \+', 'aamz') | +----------------------------------+ | aamzaaa | | | +----------------------------------+ 2 rows in set (0.00 sec) Please ensure to re-send the patch via "Contribution" tab. Otherwise we would not be able to accept it. regards, Umesh
[21 Oct 2020 8:01]
Hope Lee
Fix the issue that Regexp_engine::Replace doesn't reset error code after processing a record. (*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.
Contribution: 0001-Bugfix-Regexp_engine-Replace-doesn-t-reset-error-cod.patch (application/octet-stream, text), 4.24 KiB.
[21 Oct 2020 8:06]
Hope Lee
Update the patch. (*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.
Contribution: 0001-Bugfix-Regexp_engine-Replace-doesn-t-reset-error-cod.patch (application/octet-stream, text), 4.24 KiB.
[5 Nov 2020 22:56]
Jon Stephens
Documented fix as follows in the NDB 8.0.23 changelog: When REGEXP_REPLACE() was used in an SQL statement, the internal function Regexp_engine::Replace() did not reset the error code value after handling a record, which could affect processing of the next record, which lead to issues. Our thanks to Hope Lee for the contribution. Closed.