MySQL Forums
Forum List  »  Router & Proxy

mysql-proxy strange with default_db
Posted by: Pavel Dobryakov
Date: July 21, 2016 01:06AM

Hello, i test with such code
function read_query(packet)
local fl = io.open('/tmp/qlog',"a")
fl:write("QUERY: "..packet:sub(2).."\n")
fl:write("DB: "..proxy.connection.client.default_db.."\n")
fl:flush()
fl:close()
end

when connected via console

root@sql-crm:~# mysql -h 127.0.0.1 -P 3307
......
......
mysql> USE `test`
.....
Database changed
mysql>



and get in log

QUERY: select @@version_comment limit 1
DB:
QUERY: SELECT DATABASE()
DB:
QUERY: test
DB:
QUERY: show databases
DB: test
QUERY: show tables
DB: test
QUERY: Comment
DB: test
QUERY: User
DB: test
QUERY: client_landing
DB: test
QUERY: q
DB: test
QUERY: t1
DB: test






when connecting via IDE (mysql workbench for example) and select DB test
i see in log


QUERY: set autocommit=1
DB:
QUERY: SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ
DB:
QUERY: SHOW SESSION VARIABLES LIKE 'lower_case_table_names'
DB:
QUERY: SELECT current_user()
DB:
QUERY: SET CHARACTER SET utf8
DB:
QUERY: SET NAMES utf8
DB:
QUERY: SHOW SESSION VARIABLES LIKE 'sql_mode'
DB:
QUERY: SELECT CONNECTION_ID()
DB:
QUERY: SHOW SESSION STATUS LIKE 'Ssl_cipher'
DB:
QUERY: USE `test1`
DB:
QUERY: set autocommit=1
DB:
QUERY: set autocommit=1
DB:
QUERY: SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ
DB:
QUERY: SHOW SESSION VARIABLES LIKE 'lower_case_table_names'
DB:
QUERY: SELECT current_user()
DB:
QUERY: SET CHARACTER SET utf8
DB:
QUERY: SET NAMES utf8
DB:
QUERY: SELECT CONNECTION_ID()
DB:
QUERY: SHOW SESSION STATUS LIKE 'Ssl_cipher'
DB:
QUERY: USE `test1`
DB:
QUERY: set autocommit=1
DB:
QUERY: SHOW SESSION VARIABLES LIKE 'sql_mode'
DB:
QUERY: SHOW SESSION VARIABLES LIKE 'version_comment'
DB:
QUERY: SHOW SESSION VARIABLES LIKE 'version'
DB:
QUERY: SELECT current_user()
DB:
QUERY: SHOW SESSION VARIABLES LIKE 'lower_case_table_names'
DB:
QUERY: SHOW DATABASES
DB:
QUERY: SHOW DATABASES
DB:
QUERY: SHOW SESSION VARIABLES LIKE 'version_compile_os'
DB:
QUERY: SHOW GLOBAL VARIABLES
DB:
QUERY: SHOW ENGINES
DB:
QUERY: SHOW FULL TABLES FROM `test1`
DB:
QUERY: SELECT name, type FROM mysql.proc WHERE Db='test1'
DB:
QUERY: SHOW COLUMNS FROM `test1`.`t1`
DB:




DB:
QUERY: USE `test1`
DB:

Why mysql-proxy do not detect change default db ?

Options: ReplyQuote


Subject
Views
Written By
Posted
mysql-proxy strange with default_db
1480
July 21, 2016 01:06AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.