Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rule with only digest set always matches on everything #717

Closed
btkador opened this issue Oct 8, 2016 · 9 comments
Closed

rule with only digest set always matches on everything #717

btkador opened this issue Oct 8, 2016 · 9 comments
Assignees
Milestone

Comments

@btkador
Copy link

btkador commented Oct 8, 2016

I have a rule with only digest value set, and regarding the documentation I expected it will only match if its the identical digest, but seems to match on any query.

digest - match queries with a specific digest, as returned by stats_mysql_query_digest.digest

mysql> select * from runtime_mysql_query_rules where rule_id=100\G
*************************** 1. row ***************************
              rule_id: 100
               active: 1
             username: demo_user
           schemaname: demo_table
               flagIN: 0
          client_addr: NULL
           proxy_addr: NULL
           proxy_port: NULL
               digest: 0xDB3A841EF5443C35
         match_digest: NULL
        match_pattern: NULL
 negate_match_pattern: 0
              flagOUT: NULL
      replace_pattern: NULL
destination_hostgroup: NULL
            cache_ttl: NULL
            reconnect: NULL
              timeout: NULL
              retries: NULL
                delay: NULL
       mirror_flagOUT: NULL
     mirror_hostgroup: NULL
            error_msg: NULL
                  log: NULL
                apply: 1
              comment: NULL
mysql> SELECT * FROM stats.stats_mysql_query_rules;
+---------+------+
| rule_id | hits |
+---------+------+
| 100     | 337  |
| 205     | 0    |
| 206     | 0    |
| 207     | 0    |
| 208     | 0    |
| 209     | 0    |
| 210     | 0    |
| 211     | 0    |
+---------+------+
@renecannao renecannao self-assigned this Oct 8, 2016
@renecannao renecannao added this to the v1.3 milestone Oct 8, 2016
@renecannao
Copy link
Contributor

Thank you for the report.
Will look into it shortly.

@renecannao renecannao added the bug label Oct 8, 2016
@renecannao
Copy link
Contributor

Bug confirmed

renecannao added a commit that referenced this issue Oct 8, 2016
mysql_query_rules.digest was not checked, and therefore unable to filter
@renecannao
Copy link
Contributor

Hi,
this bug is now fixed in branch v1.3.0-717 .
Is this a not production environment? If yes, are you able to test it?
Thanks

@btkador
Copy link
Author

btkador commented Oct 8, 2016

wasn't bale to get it to compile on ubuntu 14.0 with simply issuing make ..

runs always into issues with mariadb patching.. last try was with -R yes .. but still failing..

-- Generating done
-- Build files have been written to: /opt/proxysql-1.3.0-717/deps/mariadb-client-library/mariadb_client
cd mariadb-client-library/mariadb_client && patch libmariadb/libmariadb.c < ../libmariadb.c.patch
patching file libmariadb/libmariadb.c
Hunk #1 succeeded at 2383 (offset 126 lines).
cd mariadb-client-library/mariadb_client && patch libmariadb/net.c < ../net.c.patch
patching file libmariadb/net.c
Hunk #1 succeeded at 228 (offset 4 lines).
cd mariadb-client-library/mariadb_client && patch libmariadb/password.c < ../password.c.patch
patching file libmariadb/password.c
cd mariadb-client-library/mariadb_client && patch libmariadb/ma_secure.c < ../ma_secure.c.patch
patching file libmariadb/ma_secure.c
Reversed (or previously applied) patch detected!  Assume -R? [n] y
cd mariadb-client-library/mariadb_client && patch include/mysql.h < ../mysql.h.patch
patching file include/mysql.h
cd mariadb-client-library/mariadb_client && CC=cc CXX=g++ make
make[2]: Entering directory `/opt/proxysql-1.3.0-717/deps/mariadb-client-library/mariadb-connector-c-2.3.1'
make[3]: Entering directory `/opt/proxysql-1.3.0-717/deps/mariadb-client-library/mariadb-connector-c-2.3.1'
make[4]: Entering directory `/opt/proxysql-1.3.0-717/deps/mariadb-client-library/mariadb-connector-c-2.3.1'
Scanning dependencies of target mariadb_obj
...

[ 77%] Building C object libmariadb/CMakeFiles/mariadb_obj.dir/client_plugin.c.o
[ 77%] Building C object libmariadb/CMakeFiles/mariadb_obj.dir/my_auth.c.o
[ 78%] Building C object libmariadb/CMakeFiles/mariadb_obj.dir/ma_secure.c.o
/opt/proxysql-1.3.0-717/deps/mariadb-client-library/mariadb_client/libmariadb/ma_secure.c: In function ‘my_ssl_set_certs’:
/opt/proxysql-1.3.0-717/deps/mariadb-client-library/mariadb_client/libmariadb/ma_secure.c:301:1: error: expected expression before ‘static’
 static int my_verify_callback(int ok, X509_STORE_CTX *ctx)
 ^
make[4]: *** [libmariadb/CMakeFiles/mariadb_obj.dir/ma_secure.c.o] Error 1
make[4]: Leaving directory `/opt/proxysql-1.3.0-717/deps/mariadb-client-library/mariadb-connector-c-2.3.1'
make[3]: *** [libmariadb/CMakeFiles/mariadb_obj.dir/all] Error 2
make[3]: Leaving directory `/opt/proxysql-1.3.0-717/deps/mariadb-client-library/mariadb-connector-c-2.3.1'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/opt/proxysql-1.3.0-717/deps/mariadb-client-library/mariadb-connector-c-2.3.1'
make[1]: *** [mariadb-client-library/mariadb_client/include/my_config.h] Error 2
make[1]: Leaving directory `/opt/proxysql-1.3.0-717/deps'
make: *** [build_deps] Error 2

@renecannao
Copy link
Contributor

I can build a package for Ubuntu 14 later tonight and make it available so you can test it.
Thanks

@btkador
Copy link
Author

btkador commented Oct 8, 2016

perfect!

Thanks

@renecannao
Copy link
Contributor

Package for Ubuntu14 is attached.
proxysql_1.3.0-ubuntu14_amd64.deb.zip
It is up to commit 55495bf and covers also the issue in #719 .
Thanks

@btkador
Copy link
Author

btkador commented Oct 9, 2016

works. perfect! thanks. any clue when 1.3.0 will be official/stable released?

@renecannao
Copy link
Contributor

Right now 1.3 is mostly 1.2.4 with experimental support for prepared statements and few bug fixes.
So, unless you are using prepared statements, 1.3 is more stable than 1.2.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants