Bug #102839 Index out of bounds in regular expression search.
Submitted: 6 Mar 11:03 Modified: 6 Mar 11:36
Reporter: Luuk V Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S2 (Serious)
Version:8.0.23 OS:Any
Assigned to: CPU Architecture:Any

[6 Mar 11:03] Luuk V
Description:
This bug looks like this (closed) bug:
https://bugs.mysql.com/bug.php?id=9288

I have this code (because of a question on stackoverflow.com):

set @q="'в работе','на списание','списано'";
WITH RECURSIVE cte as (
   select 1 as a union all
   select a+1 from cte where a<35
   )
select distinct  regexp_substr(@q,'''[^,]*''',a) as E from cte;

When setting higher values for the number where U currently entered '35' and error "ERROR 3686 (HY000): Index out of bounds in regular expression search."
is returned.

How to repeat:
When doing a single line like this:
select regexp_substr("a,b,c",'''[^,]*''',100) as E ;

The error is also shown.

Suggested fix:
Do not throw this error ...
[6 Mar 11:36] MySQL Verification Team
Hello Luuk V,

Thank you for the report and test case.

regards,
Umesh