Steps to reproduce the behavior (Required)
SHOW WARNINGS (and SHOW ERRORS) always return an empty result, even when the previous statement produced warnings.
- In non-strict mode, run an
INSERT/load that filters or NULL-substitutes rows, e.g. INSERT INTO t SELECT ... where some values are out of range.
- The statement succeeds and the MySQL OK packet reports a non-zero
warning_count.
SHOW WARNINGS; → empty result. SHOW ERRORS; → empty result.
A standard JDBC client calling Statement.getWarnings() after such a statement also gets nothing back.
Expected behavior (Required)
SHOW WARNINGS returns the diagnostics (Level / Code / Message) produced by the previous statement, MySQL-compatibly, and SHOW ERRORS returns only the error-level ones. Statement.getWarnings() surfaces them.
Real behavior (Required)
Both statements always return an empty result set — the columns are correct (Level/Code/Message) but there are zero rows — so the diagnostics are silently dropped.
Root cause
ShowWarningStmt has grammar, AST and analyzer support (added by #9299 for #7978) and a Level/Code/Message result schema (ShowResultMetaFactory), but ShowExecutor has no visitShowWarningStatement. The statement therefore falls through to the default visitShowStatement, which returns an empty result set, and there is no server-side warning buffer in ConnectContext. This is an unfinished stub inherited from Apache Doris that was never wired to a warning store.
Scope
A first fix can keep this FE-local: a session warning buffer + the SHOW WARNINGS/SHOW ERRORS executor, seeded by the load/INSERT filtered-rows path. Read-path warnings (CAST/overflow/oversize → NULL, which are computed in the BE), the result-set warning_count on the EOF packet, and Arrow Flight SQL / Stream Load rendering would be natural follow-ups.
StarRocks version (Required)
main (also affects 4.x; reproduced on 4.0.4)
I already have a fix ready for the FE-local scope above and will open a PR shortly. Could a maintainer assign this to me?
Steps to reproduce the behavior (Required)
SHOW WARNINGS(andSHOW ERRORS) always return an empty result, even when the previous statement produced warnings.INSERT/load that filters or NULL-substitutes rows, e.g.INSERT INTO t SELECT ...where some values are out of range.warning_count.SHOW WARNINGS;→ empty result.SHOW ERRORS;→ empty result.A standard JDBC client calling
Statement.getWarnings()after such a statement also gets nothing back.Expected behavior (Required)
SHOW WARNINGSreturns the diagnostics (Level/Code/Message) produced by the previous statement, MySQL-compatibly, andSHOW ERRORSreturns only the error-level ones.Statement.getWarnings()surfaces them.Real behavior (Required)
Both statements always return an empty result set — the columns are correct (
Level/Code/Message) but there are zero rows — so the diagnostics are silently dropped.Root cause
ShowWarningStmthas grammar, AST and analyzer support (added by #9299 for #7978) and aLevel/Code/Messageresult schema (ShowResultMetaFactory), butShowExecutorhas novisitShowWarningStatement. The statement therefore falls through to the defaultvisitShowStatement, which returns an empty result set, and there is no server-side warning buffer inConnectContext. This is an unfinished stub inherited from Apache Doris that was never wired to a warning store.Scope
A first fix can keep this FE-local: a session warning buffer + the
SHOW WARNINGS/SHOW ERRORSexecutor, seeded by the load/INSERTfiltered-rows path. Read-path warnings (CAST/overflow/oversize → NULL, which are computed in the BE), the result-setwarning_counton the EOF packet, and Arrow Flight SQL / Stream Load rendering would be natural follow-ups.StarRocks version (Required)
main (also affects 4.x; reproduced on 4.0.4)
I already have a fix ready for the FE-local scope above and will open a PR shortly. Could a maintainer assign this to me?