diff --git a/src/servers/src/mysql/federated.rs b/src/servers/src/mysql/federated.rs index 63faa22d54..71733dcc12 100644 --- a/src/servers/src/mysql/federated.rs +++ b/src/servers/src/mysql/federated.rs @@ -60,6 +60,8 @@ static OTHER_NOT_SUPPORTED_STMT: Lazy = 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 @@(.*))", diff --git a/tests-integration/tests/sql.rs b/tests-integration/tests/sql.rs index af9374a2a8..1a481e533d 100644 --- a/tests-integration/tests/sql.rs +++ b/tests-integration/tests/sql.rs @@ -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();