wangzhigang1999 commented on code in PR #7419:
URL: https://github.com/apache/kyuubi/pull/7419#discussion_r3158267593


##########
externals/kyuubi-jdbc-engine/src/main/scala/org/apache/kyuubi/engine/jdbc/dialect/MySQLDialect.scala:
##########
@@ -122,6 +150,16 @@ class MySQLDialect extends JdbcDialect {
     query.toString()
   }
 
+  override def setSchema(conn: Connection, schema: String): Unit = {
+    // mysql-connector-j makes setCatalog/setSchema mutually exclusive based 
on the
+    // `databaseTerm` connection property: with the default CATALOG, 
setCatalog issues
+    // COM_INIT_DB and setSchema is a silent no-op; with SCHEMA it is the 
inverse.
+    // Calling both means exactly one fires regardless of how the user 
configured the
+    // URL. StarRocksDialect / DorisDialect inherit this via MySQLDialect.
+    conn.setCatalog(schema)
+    conn.setSchema(schema)

Review Comment:
   I think this comment was posted on the wrong PR?



-- 
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]

Reply via email to