You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[KYUUBI #2047] Support more MySQL JDBC driver versions
### _Why are the changes needed?_
Support more MySQL JDBC driver versions.
The user may use the 5.x mysql driver to connect to the kyuubi server.
#2047
### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
- [ ] Add screenshots for manual tests if appropriate
- [x] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request
Closes#2048 from cxzl25/KYUUBI-2047.
Closes#204703cd15f [sychen] Support more MySQL JDBC driver versions
Authored-by: sychen <sychen@trip.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
(cherry picked from commit 109569b)
Signed-off-by: Cheng Pan <chengpan@apache.org>
Copy file name to clipboardExpand all lines: kyuubi-server/src/main/scala/org/apache/kyuubi/server/mysql/MySQLDialectHelper.scala
+48-26Lines changed: 48 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -41,33 +41,14 @@ object MySQLDialectHelper {
41
41
| 'utf8mb4' as `@@character_set_server`,
42
42
| 'utf8mb4' as `@@character_set_database`
43
43
|""".stripMargin
44
-
// mysql-connector-java:8 initialized query
45
-
case sql
46
-
if sql.contains("select @@session.auto_increment_increment as auto_increment_increment, @@character_set_client as character_set_client, @@character_set_connection as character_set_connection, @@character_set_results as character_set_results, @@character_set_server as character_set_server, @@collation_server as collation_server, @@collation_connection as collation_connection, @@init_connect as init_connect, @@interactive_timeout as interactive_timeout, @@license as license, @@lower_case_table_names as lower_case_table_names, @@max_allowed_packet as max_allowed_packet, @@net_write_timeout as net_write_timeout, @@performance_schema as performance_schema, @@query_cache_size as query_cache_size, @@query_cache_type as query_cache_type, @@sql_mode as sql_mode, @@system_time_zone as system_time_zone, @@time_zone as time_zone, @@transaction_isolation as transaction_isolation, @@wait_timeout as wait_timeout") =>
47
-
"""SELECT
48
-
| 1 AS auto_increment_increment,
49
-
| 'utf8mb4' AS character_set_client,
50
-
| 'utf8mb4' AS character_set_connection,
51
-
| 'utf8mb4' AS character_set_results,
52
-
| 'utf8mb4' AS character_set_server,
53
-
| 'utf8mb4_general_ci' AS collation_server,
54
-
| 'utf8mb4_general_ci' AS collation_connection,
55
-
| '' AS init_connect,
56
-
| 28800 AS interactive_timeout,
57
-
| 'Apache License 2.0' AS license,
58
-
| 0 AS lower_case_table_names,
59
-
| 4194304 AS max_allowed_packet,
60
-
| 60 AS net_write_timeout,
61
-
| 0 AS performance_schema,
62
-
| 1048576 AS query_cache_size,
63
-
| 'OFF' AS query_cache_type,
64
-
| 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' AS sql_mode,
65
-
| 'UTC' AS system_time_zone,
66
-
| 'SYSTEM' AS time_zone,
67
-
| 'REPEATABLE-READ' AS transaction_isolation,
68
-
| '28800' AS wait_timeout
69
-
|""".stripMargin
70
44
// scalastyle:on line.size.limit
45
+
// mysql-connector-java:[5-8] version initialized query
46
+
case sql
47
+
if sql.contains("select @@session.auto_increment_increment") ||
0 commit comments