Bug #41368 | --replace_regex does not work as expected | ||
---|---|---|---|
Submitted: | 10 Dec 2008 18:07 | Modified: | 2 Mar 2009 18:24 |
Reporter: | Hakan Küçükyılmaz | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Documentation | Severity: | S3 (Non-critical) |
Version: | OS: | Any | |
Assigned to: | Paul DuBois | CPU Architecture: | Any |
[10 Dec 2008 18:07]
Hakan Küçükyılmaz
[10 Dec 2008 21:46]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/61284 2932 Hakan Kuecuekyilmaz 2008-12-10 * Workaround for Bug#41368 --replace_regex does not work as expected. * Fix for Bug #40636 falcon_bug_28095 test fails with "Server failed to restart". * Fix for Bug #41303 Using global variable makes mysql-test-run test fail. * Fixed a gcc warning in mysys/stacktrace.c. * Made falcon_unicode.test a --big-test test.
[10 Dec 2008 21:56]
Hakan Küçükyılmaz
Just pushed a workaround to a test case, which suffers from this bug.
[11 Dec 2008 6:36]
Sveta Smirnova
Thank you for the report. I got a bit different results than you describe: =====mysql-6.0===== =====bug41368===== SELECT 1, 2 FROM DUAL; 1 2 1 2 SELECT 'replace_regex with space works' FROM DUAL; replace_regex with space works replace_regex with space works SELECT 'replace_regex with tab works' FROM DUAL; replace_regex with tab works replace_regex with tab works SELECTreplace_regex with tab with two columns works'1replace_regex with tab with two columns works2',replace_regex with tab with two columns works'3replace_regex with tab with two columns works4'replace_regex with tab with two columns worksFROMreplace_regex with tab with two columns worksDUAL; 1replace_regex with tab with two columns works2 3replace_regex with tab with two columns works4 1replace_regex with tab with two columns works2 3replace_regex with tab with two columns works4 $cat bug41368.test --replace_regex /1[[:space:]]2/replace_regex works/ SELECT 1, 2 FROM DUAL; --replace_regex /1[[:space:]]2/replace_regex with space works/ SELECT '1 2' FROM DUAL; --replace_regex /1[[:space:]]2/replace_regex with tab works/ SELECT '1 2' FROM DUAL; --replace_regex /[[:space:]]/replace_regex with tab with two columns works/ SELECT '1 2', '3 4' FROM DUAL; $perl --version This is perl, v5.8.6 built for i386-linux-thread-multi Please check if you really get same results.
[11 Dec 2008 9:06]
Hakan Küçükyılmaz
Your results show the problem. In the first output the tab between the two columns is not replaced. In the last output the tab is only replaced within the column but not between the columns.
[11 Dec 2008 14:19]
Bugs System
Pushed into 6.0.9-alpha (revid:hky@sun.com-20081210214553-mfx2mfwcvnga1aig) (version source revid:hky@sun.com-20081210214553-mfx2mfwcvnga1aig) (pib:5)
[11 Dec 2008 15:17]
Sveta Smirnova
Thank you for the feedback. Verified as described: replace_regex does not replace values in some results, although documenation says " replace_regex /pattern/replacement/[i] ... In the output from the next statement, find strings that match pattern (a regular expression) and replace them with replacement. "
[26 Feb 2009 11:52]
Patrick Crews
After discussion with Hakan, we agree that this is a documentation bug. --replace_regex works fine within columns of data, but not within an entire row of multiple column. It doesn't look for patterns that span multiple columns (ie it doesn't combine the total data of all columns), it only finds matches within a single column at a time (though multiple columns might have matching patterns). The documentation should be more explicit about this working constraint.
[2 Mar 2009 18:24]
Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.