Closed utdrmac closed 6 years ago
Why can't replace_pattern work against digest? Why not just a simple replace?
If $queryDigest == $digest then $query = $replace_pattern; else if regexMatch($query, $match_pattern) then regexReplace($query, $replace_pattern);
@utdrmac this is a duplicate of https://github.com/sysown/proxysql/issues/1556 and of #1386 .
See renecannao commented on Jun 19 The new definition for mysql_query_rules.replace_pattern is:
replace_pattern VARCHAR CHECK(match_pattern IS NOT NULL)
are u using an old version?
@Tusamarco Not using old version. Using 1.4.10.
I was using 1.4.9 and upgraded to 1.4.10. Does not appear that the schema for mysql_query_rules
table was updated. My schema still shows this:
replace_pattern VARCHAR,
The new schema definition is in 2.0.0 , not 1.4 series.
But the bottom line is the same: replace_pattern
requires match_pattern
.
Attempting simple demonstrations of ProxySQL's ability to rewrite queries results in repeatable crash.
ProxySQL 1.4.10. Test query:
SELECT k FROM sysbench.sbtest1 LIMIT 1
Expected result:
Actual result:
ProxySQL Error log snippet:
After crash restart, attempt to use digest hex matching with error_msg (this works):
Attempting replace_pattern with match_digest:
Result (crash):
proxysql_cores.tar.gz