You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "cloud-fan (via GitHub)" <gi...@apache.org> on 2026/08/03 14:23:20 UTC
Re: [PR] [SPARK-58515][SQL] Exclude MySQL permission and limit errors from syntax error classification [spark]
cloud-fan commented on code in PR #57720:
URL: https://github.com/apache/spark/pull/57720#discussion_r3704773993
##########
sql/core/src/main/scala/org/apache/spark/sql/jdbc/MySQLDialect.scala:
##########
@@ -221,7 +221,35 @@ private case class MySQLDialect() extends JdbcDialect with SQLConfHelper with No
// See https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html
override def isSyntaxErrorBestEffort(exception: SQLException): Boolean = {
- "42000".equals(exception.getSQLState)
+ "42000".equals(exception.getSQLState) &&
+ !isNonSyntaxErrorBestEffort(exception)
Review Comment:
`true` must mean this is confidently a syntax error, but the denylist still lets documented non-syntax 42000 errors through. For example, [ER_BAD_DB_ERROR (1049)](https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html#error_er_bad_db_error) is `42000` with message `Unknown database`, so this path returns `true`. Please use an allowlist of vendor codes known to represent syntax errors (including 1064), and add 1049 as a regression case.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org