Repository navigation
fix(doris): drop MySQL routine and event probes from the schema dump - #21467
Merged
Merged
Conversation
The StarRocks/Doris driver was copied from the MySQL driver and still runs SHOW FUNCTION STATUS, SHOW PROCEDURE STATUS and SHOW EVENTS on every dump. Neither engine has MySQL routines or events: StarRocks answers the probes with an empty compatibility stub, and Doris returns PL/SQL rows in a layout the MySQL-shaped scan misreads, so the step could only ever succeed when it found nothing. Doris kernels that removed the PL/SQL grammar (SelectDB 4.0.12+/4.1.8+/5.0.5+, apache/doris#58700 on master) reject the first probe outright, which aborted the whole schema sync and left the SQL Editor object browser empty. Remove the routine and event steps and their helpers, the unused sequenceStmtFmt, and the mysqldump flag-list comment. The regression test runs Dump against a scripted server that rejects the probes the way such a kernel does and asserts the dump completes without sending them. BYT-10211 Co-Authored-By: Claude Fable 5.1 <[email protected]>
d-bytebase
approved these changes
Sep 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BYT-10211.
The StarRocks/Doris driver was copied from the MySQL driver, and its
Dumpstill runsSHOW FUNCTION STATUS,SHOW PROCEDURE STATUSandSHOW EVENTSon every schema dump. The first error aborts the dump, and the syncer never stores the table and view metadata it had already collected. A customer on ApsaraDB for SelectDB kernel 4.1.9 (Alibaba Cloud's Doris kernel, built on Apache Doris 3.1.4) hits exactly that. SelectDB's kernel release notes for 4.1.9 say "移除 PL/SQL 存储过程和 package 能力" (PL/SQL stored procedures and packages removed), and 4.1.8, 4.0.12 and 5.0.5 carry the same bullet.SHOW (PROCEDURE | FUNCTION) STATUSis a rule of that grammar in Doris, so the server answersError 1105: errCode = 2, detailMessage = no viable alternative at input 'SHOW FUNCTION'(line 1, pos 5). Every database on the instance then fails to sync, and the SQL Editor object browser stays empty with "Code 13: Internal". Apache Doris master made the same removal in apache/doris#58700 and restored an always-empty stub in apache/doris#66659 because it blocked Bytebase. No Apache Doris release lacks the rule (every 3.1, 4.0, 4.1 and 4.2 tag has it, and 2.1/3.0 accept the statement through the legacy parser); the vendor kernel does.The probes never produced anything on these engines. StarRocks has no stored procedures or events and answers with an empty MySQL-shaped set. Doris returns PL/SQL procedure rows as
ProcedureName, CatalogId, DbId, ..., which the MySQL-shaped scan misreads: a stock Doris 4.1.3 with one procedure fails the dump withfailed to call getRoutineStmt("prod_tg", "0", "1789585700466"): ... no viable alternative at input 'SHOW CREATE 1789585700466', andSHOW CREATE PROCEDUREreturns two columns where the scan expects six. Neither engine hasCREATE EVENT. The routine and event steps could only ever succeed when they found nothing, so this PR removes them and their helpers, plus the unusedsequenceStmtFmtand themysqldumpflag-list comment that no longer described the dump.Error tolerance around the probes was rejected. It would keep sending a statement the vendor declared unsupported and would mask real failures on a driver two engines share.
information_schema.routinesis not a substitute either; the same upstream removal deleted its scanner.Validation
TestDumpSendsNoRoutineOrEventProberunsDumpfor Doris and StarRocks against a scripteddatabase/sqldriver that answers the catalog queries with the column shapes a live Doris 4.1.3 returns and rejects the routine probes with the vendor's error. It fails onorigin/mainwith the customer's exact error chain and passes here, including undergo test -count=2.prod_tgthrough a MySQL-wire proxy in front of Apache Doris 4.1.3 (FE and BE alive) that rejects onlySHOW (FUNCTION|PROCEDURE) STATUS. The sync returns{}, the metadata lists the table and view, and the proxy log shows no routine or event statement. Bytebase 3.19.0 against the same proxy reproduces the customer's error.gofmt,go vet,go test ./backend/plugin/db/starrocks/...and golangci-lint v2.13.2 on the package.Two adjacent defects in the same file are left for a follow-up, because each changes stored dump text or sync results for every Doris database and deserves its own review: the Doris dump text still opens with the MySQL
SET @OLD_UNIQUE_CHECKSguard, which Doris rejects on replay, andgetServerVariablescans two columns from Doris's four-columnSHOW VARIABLESand silently fails.🤖 Generated with Claude Code