Details
Description
Under some conditions, the regexp function will raise a warning about some internal error:
MariaDB [(none)]> SELECT 'mail@abcdefghijklmnopqr. com' REGEXP '@([[:alnum:]]*|[-]*|[.]*)*[.](com|net|us|tv|vg|qs|org|cc|tc|info|ws|ms|biz|bz|net|edu|es|fr|ru|nl|it|de|am|cl)'; +--------------------------------------------------------------------------------------------------------------------------------------------------------+ | 'mail@abcdefghijklmnopqr. com' REGEXP '@([[:alnum:]]*|[-]*|[.]*)*[.](com|net|us|tv|vg|qs|org|cc|tc|info|ws|ms|biz|bz|net|edu|es|fr|ru|nl|it|de|am|cl)' | +--------------------------------------------------------------------------------------------------------------------------------------------------------+ | 0 | +--------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set, 1 warning (0.18 sec) MariaDB [(none)]> SHOW WARNINGS; +---------+------+--------------------------------------------------------+ | Level | Code | Message | +---------+------+--------------------------------------------------------+ | Warning | 1139 | Got error 'pcre_exec: Internal error (-8)' from regexp | +---------+------+--------------------------------------------------------+ 1 row in set (0.00 sec)
It might be related to string length. Changing the length of the string makes the message go away:
MariaDB [(none)]> SELECT 'mail@abcdefghijklmnopq. com' REGEXP '@([[:alnum:]]*|[-]*|[.]*)*[.](com|net|us|tv|vg|qs|org|cc|tc|info|ws|ms|biz|bz|net|edu|es|fr|ru|nl|it|de|am|cl)'; +-------------------------------------------------------------------------------------------------------------------------------------------------------+ | 'mail@abcdefghijklmnopq. com' REGEXP '@([[:alnum:]]*|[-]*|[.]*)*[.](com|net|us|tv|vg|qs|org|cc|tc|info|ws|ms|biz|bz|net|edu|es|fr|ru|nl|it|de|am|cl)' | +-------------------------------------------------------------------------------------------------------------------------------------------------------+ | 0 | +-------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.14 sec)
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
Just FYI:
The error is
and it means
Internally, pcre_exec() uses a function called match(), which it calls repeatedly (sometimes recursively). The limit set by match_limit is imposed on the number of times this function is called during a match, which has the effect of limiting the amount of backtracking that can take place. For patterns that are not anchored, the count restarts from zero for each position in the subject string. ... The default value for the limit can be set when PCRE is built; the default default is 10 million, which handles all but the most extreme cases. You can override the default by suppling pcre_exec() with a pcre_extra block in which match_limit is set, and PCRE_EXTRA_MATCH_LIMIT is set in the flags field. If the limit is exceeded, pcre_exec() returns PCRE_ERROR_MATCHLIMIT.