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

[Feature Request] Some querys,such as 'set variables' or 'select @',can disabe query rules like disabling multiplexing #1414

Open DevinYu123 opened 6 years ago

DevinYu123 commented 6 years ago

Hi I’m very glad to use ProxySQL.

Now I use simple query rules ('^SELECT.*FOR UPDATE','^SELECT') for reading and writing separation. As you know,some variables setted by session in WRITE group will not be setted in READ group when SELECT query route to the READ group. So this may bring some problems if I can't control our application. The problem will be solved if those querys,such as 'set variables' or 'select @', can disabe query rules like disabling multiplexing.

Thany you, Devin

renecannao commented 6 years ago

Hi Devin,

What you are asking is the implementation of sticky_conn feature , that is still marked as not implemented yet.

Although, I would rather track as much variables as possible and ensure that they are correctly applied, instead of disabling routing.

Do you have some examples of variables st by your application, and what queries are being used?

DevinYu123 commented 6 years ago

Hi Rene,

Thanks for your reply, I am looking forward to the new feature. Our App has not found problems with below "set command" yet, but I'm worried that one day some problems will appear.

Got query digest from stats_mysql_query_digest

SET TIME_ZONE='+00:00' SET CHARACTER SET utf8 SET SQL_SAFE_UPDATES=? SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ SET @OLD_LOCAL_SQL_MODE=@@SQL_MODE, SQL_MODE='' SET SESSION character_set_results = ? set optimizer_switch=? SET @@SQL_MODE='' SET character_set_results = NULL SET SQL_QUOTE_SHOW_CREATE=? SET SESSION SQL_AUTO_IS_NULL=? SET SQL_MODE=IFNULL(@OLD_LOCAL_SQL_MODE, '') 'SET NAMES utf8' 'SET autocommit=0' 'set lock_wait_timeout=5'

Thanks again, Devin