[MDEV-6027] RLIKE: "." no longer matching new line Created: 2014-04-05 Updated: 2014-04-23 Resolved: 2014-04-23 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.0.10 |
| Fix Version/s: | 10.0.11 |
| Type: | Bug | Priority: | Critical |
| Reporter: | M Kellogg | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Environment: |
Windows 8, Windows Server 2012 R2, maybe others |
||
| Description |
|
In 5.5.36, RLIKE and REGEXP work as they always have:
I consider this to be a critical issue that would cause queries to not function as expected. |
| Comments |
| Comment by Elena Stepanova [ 2014-04-05 ] | |||||||||
|
Apparently the difference was caused by switching to PCRE. | |||||||||
| Comment by Elena Stepanova [ 2014-04-06 ] | |||||||||
|
With PCRE, to have the dot to matchi a new line character, option (?s) should be set:
See https://mariadb.com/kb/en/pcre-regular-expressions/#option-setting . It's still not very good that the default behavior changed. | |||||||||
| Comment by Jorge Manuel Silva [ 2014-04-07 ] | |||||||||
|
Maybe that option should be enabled by default, and using (?-s) would disable it. | |||||||||
| Comment by Sergei Golubchik [ 2014-04-07 ] | |||||||||
|
On the other hand, it would be good to be as close to the "normal" pcre behavior as possible, users that know pcre shouldn't need to read mariadb manual to know all mariadb specific pcre quirks. bar, perhaps we could add, like, @@default_regex_flags variable? This will keep pcre "normal behavior" in mariadb and won't change defaults post-GA, but users of old applications would be able to set 's' flag to be on by default. | |||||||||
| Comment by Jorge Manuel Silva [ 2014-04-07 ] | |||||||||
|
That would be a good idea. I agree. | |||||||||
| Comment by Alexander Barkov [ 2014-04-23 ] | |||||||||
|
Added a new variable @@default_regex_flags. To make "." match new line, one can add this command into my.cnf: [mysqld] See here for more details: | |||||||||
| Comment by Alexander Barkov [ 2014-04-23 ] | |||||||||
|
Pushed into 10.0. |