mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-22 16:00:38 +00:00
fix: set transaction variables not working in mysql protocol (#4912)
This commit is contained in:
@@ -60,6 +60,8 @@ static OTHER_NOT_SUPPORTED_STMT: Lazy<RegexSet> = Lazy::new(|| {
|
||||
"(?i)^(SET FOREIGN_KEY_CHECKS(.*))",
|
||||
"(?i)^(SET AUTOCOMMIT(.*))",
|
||||
"(?i)^(SET SQL_LOG_BIN(.*))",
|
||||
"(?i)^(SET SESSION TRANSACTION(.*))",
|
||||
"(?i)^(SET TRANSACTION(.*))",
|
||||
"(?i)^(SET sql_mode(.*))",
|
||||
"(?i)^(SET SQL_SELECT_LIMIT(.*))",
|
||||
"(?i)^(SET @@(.*))",
|
||||
|
||||
@@ -60,6 +60,7 @@ macro_rules! sql_tests {
|
||||
$service,
|
||||
|
||||
test_mysql_auth,
|
||||
test_mysql_stmts,
|
||||
test_mysql_crud,
|
||||
test_mysql_timezone,
|
||||
test_mysql_async_timestamp,
|
||||
@@ -133,6 +134,25 @@ pub async fn test_mysql_auth(store_type: StorageType) {
|
||||
guard.remove_all().await;
|
||||
}
|
||||
|
||||
pub async fn test_mysql_stmts(store_type: StorageType) {
|
||||
common_telemetry::init_default_ut_logging();
|
||||
|
||||
let (addr, mut guard, fe_mysql_server) = setup_mysql_server(store_type, "sql_crud").await;
|
||||
|
||||
let mut conn = MySqlConnection::connect(&format!("mysql://{addr}/public"))
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
conn.execute("SET SESSION TRANSACTION READ ONLY")
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
conn.execute("SET TRANSACTION READ ONLY").await.unwrap();
|
||||
|
||||
let _ = fe_mysql_server.shutdown().await;
|
||||
guard.remove_all().await;
|
||||
}
|
||||
|
||||
pub async fn test_mysql_crud(store_type: StorageType) {
|
||||
common_telemetry::init_default_ut_logging();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user