Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: oceanbase query (#8677)

Danny Xu1efd9a6599a6
diff --git a/backend/plugin/db/mysql/query.go b/backend/plugin/db/mysql/query.go
index fdc5af9af2..5be015b72d 100644
--- a/backend/plugin/db/mysql/query.go
+++ b/backend/plugin/db/mysql/query.go
@@ -15,13 +15,11 @@ import (
func (driver *Driver) getStatementWithResultLimit(stmt string, limit int) (string, error) {
switch driver.dbType {
- case storepb.Engine_MYSQL, storepb.Engine_MARIADB:
- // MySQL 5.7 doesn't support WITH clause.
- return fmt.Sprintf("SELECT * FROM (%s) result LIMIT %d;", stmt, limit), nil
case storepb.Engine_TIDB:
return getStatementWithResultLimitForTiDB(stmt, limit)
default:
- return "", errors.Errorf("unsupported database type %s", driver.dbType)
+ // MySQL 5.7 doesn't support WITH clause.
+ return fmt.Sprintf("SELECT * FROM (%s) result LIMIT %d;", stmt, limit), nil
}
}