zclllyybb commented on code in PR #58998: URL: https://github.com/apache/doris/pull/58998#discussion_r2618906339
########## regression-test/suites/query_p0/set/test_mysql_compat_var_whitelist.groovy: ########## @@ -0,0 +1,82 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +suite("test_mysql_compat_var_whitelist") { + + // Test 1: Verify unknown variables throw errors (default behavior) + // This ensures the whitelist doesn't break normal error handling + test { + sql "set unknown_variable_12345 = 1" + exception "Unknown system variable" + } + + test { + sql "set @@nonexistent_var = 0" + exception "Unknown system variable" + } + + // Test 2: Verify normal Doris variables still work correctly + def originalTimeout = sql "show variables where variable_name = 'query_timeout'" + sql "set query_timeout = 999" + def modifiedTimeout = sql "show variables where variable_name = 'query_timeout'" + assertTrue(modifiedTimeout[0][1] == "999") + sql "set query_timeout = ${originalTimeout[0][1]}" + + // Test 3: If whitelist is configured, test whitelisted variables + // To enable these tests, configure fe.conf with: + // mysql_compat_var_whitelist = foreign_key_checks,unique_checks,sql_notes + // Then set environment variable: export TEST_MYSQL_COMPAT_WHITELIST=true + + if (System.getenv("TEST_MYSQL_COMPAT_WHITELIST") == "true") { Review Comment: what's this? you should admin set frontend config `mysql_compat_var_whitelist`. and remember to make this case nonConcurrent -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
