When client execute a SET statement, QueryCtx first parse the statement and check if it is a set session variable statement. Then the variables are stored in QueryCtx. When client execute a query SQL, QueryCtx forward the variables to backend connection, the connection first restore the SetStmt to a SET statement and execute, if execution is success, backend connection is used to execute query statement.
What problem does this PR solve?
6 support set session system variables
What is changed and how it works?
When client execute a SET statement, QueryCtx first parse the statement and check if it is a set session variable statement. Then the variables are stored in QueryCtx. When client execute a query SQL, QueryCtx forward the variables to backend connection, the connection first restore the SetStmt to a SET statement and execute, if execution is success, backend connection is used to execute query statement.
Check List
Tests