You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this is a bug.
I'm facing a problem wherein the query_rule is getting matched but replace_pattern is not getting applied.
Steps to reproduce:
Add query_rule as follows insert into mysql_query_rules(rule_id,active,match_pattern,negate_match_pattern,replace_pattern,apply) values (1, 1, '^select .* from test_table where id =.*', 1, 'select "RANDOM STUFF"', 1);
Now, my understanding is that
Query select * from test_table where id = 1 will match the "match_pattern" of the rule. But since "negate_match_pattern" flag is set, the query will not match the rule. So, the query will return 1 row from test_table. This is working as per my understanding and stats_mysql_query_rules.hits for the rule remains unchanged.
But, query select * from test_table where 1 = 1 and id = 1 will not match the "match_pattern" of the rule. To my understanding, since "negate_match_pattern" flag is set, the query will match the rule and the query result should be "RANDOM STUFF". But, I'm getting one data row from mysql instead of "RANDOM STUFF" even though stats_mysql_query_rules.hits for the rule gets incremented.
ProxySQL version - 1.3.4-15-gf70037c
Am I doing some mistake or "replace_pattern" and "negate_match_pattern" won't work together?
Any help is very much appreciated.
Thanks.
The text was updated successfully, but these errors were encountered:
Hi @kartt . This is not a bug, but needs to be documented.
The replaces works replacing the match_pattern with replace_pattern . Since match_pattern doesn't match, no replace happens.
In other words, if you use negate_match_pattern , the match+replace can't work.
This is expected, but need to be documented.
Hello
I use proxysql 2.5 with same problem select hostgroup,username,count_star,digest_text,digest from stats_mysql_query_digest where digest_text like '%myproduct_url%';
Where some query not match with host group i set in query rule.
My rule is INSERT INTO mysql_query_rules (rule_id,active,match_digest,destination_hostgroup,apply) VALUES(3,1,'.*(myproduct_url(.*))',5,1);
but in below query is run from other host group delete from myproduct_url where (queue_id=?)
After update rule check result after below query LOAD MYSQL QUERY RULES TO RUNTIME;SAVE MYSQL QUERY RULES TO DISK;SELECT * FROM stats_mysql_query_digest_reset;
Also check with add digest in query_rule but not apply
I'm not sure if this is a bug.
I'm facing a problem wherein the query_rule is getting matched but replace_pattern is not getting applied.
Steps to reproduce:
Add query_rule as follows
insert into mysql_query_rules(rule_id,active,match_pattern,negate_match_pattern,replace_pattern,apply) values (1, 1, '^select .* from test_table where id =.*', 1, 'select "RANDOM STUFF"', 1);
Now, my understanding is that
Query
select * from test_table where id = 1
will match the "match_pattern" of the rule. But since "negate_match_pattern" flag is set, the query will not match the rule. So, the query will return 1 row from test_table. This is working as per my understanding and stats_mysql_query_rules.hits for the rule remains unchanged.But, query
select * from test_table where 1 = 1 and id = 1
will not match the "match_pattern" of the rule. To my understanding, since "negate_match_pattern" flag is set, the query will match the rule and the query result should be "RANDOM STUFF". But, I'm getting one data row from mysql instead of "RANDOM STUFF" even though stats_mysql_query_rules.hits for the rule gets incremented.ProxySQL version - 1.3.4-15-gf70037c
Am I doing some mistake or "replace_pattern" and "negate_match_pattern" won't work together?
Any help is very much appreciated.
Thanks.
The text was updated successfully, but these errors were encountered: