sysown / proxysql

High-performance MySQL proxy with a GPL license.
http://www.proxysql.com
GNU General Public License v3.0
5.98k stars 974 forks source link

Query digest doesn't handle scientific notation #3079

Open bmildren opened 4 years ago

bmildren commented 4 years ago

ProxySQL 2.10 / Ubuntu 18.04

Description:

Any query that includes a value that uses scientific notation for a double data type (or equivalent) isn't abstracted by the regex used to canonicolise the query and will therefore likely be treated as a unique fingerprint (given the supplied value ofc) leading to a bloated query_digest.

How to repeat:

A query with an insert containing a decimal value like this:

insert into test_table(col1, col2, col3, col4, col5) values ('1', 1, 1, 1, 0.0) on duplicate key update col5 = values(col5);

produces this output in the stats_mysql_query_digest table:

insert into test_table(col1, col2, col3, col4, col5) values (?, ?, ?, ?, ?.?) on duplicate key update value = values(value)

A query with an insert containing scientific notation like this:

insert into test_table(col1, col2, col3, col4, col5) values ('1', 1, 1, 1, 1.1234567e+8) on duplicate key update col5 = values(col5);

produces this output in the stats_mysql_query_digest table:

insert into test_table(col1, col2, col3, col4, col5) values (?, ?, ?, ?, ?.1234567e + ?) on duplicate key update value = values(value)

renecannao commented 4 years ago

Hi @bmildren, This is a duplicate of #2661 , fixed already in 2.1

@JavierJF : can you confirm please?

bmildren commented 3 years ago

ahh cool stuff - I did search before I created this one, clearly not very well though! 😄 Do we know roughly when 2.1 will be released? (or whether the fix will be backported to 2.0?) - just looking to plan around when/how to push out a fix for this 🙂 👍