Skip to content

SHOW WARNINGS / SHOW ERRORS always return an empty result (executor never implemented) #75175

Description

@ronjay1827

Steps to reproduce the behavior (Required)

SHOW WARNINGS (and SHOW ERRORS) always return an empty result, even when the previous statement produced warnings.

  1. 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.
  2. The statement succeeds and the MySQL OK packet reports a non-zero warning_count.
  3. 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?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions