Commit 62260434 authored by Alexander Barkov's avatar Alexander Barkov

pcre: fixing a test failure in character_sets_dir_basic in this command:

--replace_regex /.prefix.sql.share.charsets[/\]/MYSQL_CHARSETSDIR/
select @@global.character_sets_dir;

The intention of the '[/\]' part was to replace both slash
'/' and backslash '\\', so it does not depend on the OS.

The pattern '[/\]' was actually wrong, because ']' is escaped
and should be considered as a part of the class, instead of
being a closing bracket for the class. However, due to some bug
in the old REGEX library it worked fine.

After switching to PCRE, mysqltest correctly complains about unbalaced '[]'.
The expected correct pattern should be '[/\\]'.
However, due to some bug in mysqltest, it eats consequetive baskslashes
in a strange way, so there is no a way to have to consequetive 
backslashes after unescaping.

Workaround:

using [[:punct:]] as a pattern that matches both slash and backslash,
which should be fine for this test purposes.
parent 038554ec
......@@ -8,7 +8,7 @@
# TODO: fix with a proper comparison in mysqltest
let $rcd= `SELECT REPLACE('$MYSQL_CHARSETSDIR', '\\\\\', '.')`;
let $rcd= `SELECT REPLACE('$rcd', '/', '.')`;
let $regex_charsetdir= `SELECT '/$rcd[\\\\\/\\\\\]/MYSQL_CHARSETSDIR/'`;
let $regex_charsetdir= `SELECT '/$rcd[[:punct:]]/MYSQL_CHARSETSDIR/'`;
--replace_regex $regex_charsetdir
select @@global.character_sets_dir;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment