bytebase/bytebase · error
meet unsupported table statement with into
Error message
meet unsupported table statement with into
What it means
The MySQL/OMNI query span extractor refuses TABLE ... INTO statements. TABLE statements are a shorthand for SELECT * FROM tbl, and when they carry an INTO clause they write rows to a variable or file, which the extractor cannot model for lineage. It fails closed instead of returning wrong column spans.
Source
Thrown at backend/plugin/parser/mysql/query_span_extractor_omni.go:161
return nil, err
}
q.tableSourceFrom = append(q.tableSourceFrom, fromSources...)
results, err := q.extractOmniTargetList(stmt.TargetList, fromSources)
if err != nil {
return nil, err
}
return &base.PseudoTable{
Columns: results,
}, nil
}
func (q *omniQuerySpanExtractor) extractOmniTableStmt(stmt *ast.TableStmt) (*base.PseudoTable, error) {
if stmt == nil || stmt.Table == nil {
return &base.PseudoTable{}, nil
}
if stmt.Into != nil {
return nil, errors.New("meet unsupported table statement with into")
}
tableSource, err := q.findTableSchema(stmt.Table.Schema, stmt.Table.Name)
if err != nil {
return nil, err
}
return &base.PseudoTable{Columns: tableSource.GetQuerySpanResult()}, nil
}
func (q *omniQuerySpanExtractor) extractOmniValuesStmt(stmt *ast.ValuesStmt) (*base.PseudoTable, error) {
if stmt == nil || len(stmt.Rows) == 0 {
return &base.PseudoTable{}, nil
}
var columns []base.QuerySpanResult
for _, expr := range stmt.Rows[0] {
field, err := q.extractOmniExpr(expr)
if err != nil {
return nil, err
}View on GitHub (pinned to 1870550677)
Solutions
- Remove the INTO clause from the TABLE statement
- Rewrite TABLE tbl INTO ... as the explicit form SELECT * FROM tbl (without INTO) before extraction
- Pre-scan statements for TABLE ... INTO and route them away from span extraction
Example fix
// before TABLE users INTO @rows; // after SELECT * FROM users;
Defensive patterns
Strategy: validation
Validate before calling
// reject TABLE ... INTO before extraction
if /^\s*TABLE\s+\S+\s+INTO\b/i.test(stmt) { throw new Error('TABLE ... INTO is not supported for lineage') } Try / catch
span, err := extractor.Extract(sql)
if err != nil {
if strings.Contains(err.Error(), "table statement with into") {
return nil, fmt.Errorf("rewrite %q as SELECT * FROM ...", sql)
}
return nil, err
} Prevention
- Prefer explicit SELECT * FROM tbl over TABLE shorthand
- Filter statements containing TABLE ... INTO before analysis
- Validate SQL dialect version assumptions before ingestion
When it happens
Trigger: Query span extraction encounters a *ast.TableStmt whose Into field is non-nil, e.g. TABLE users INTO @x. Reached from extractOmniSelectRoot or extractOmniSelectStmt when a TABLE statement appears as the query body or inside a set operation.
Common situations: Ingesting MySQL 8.0+ TABLE shorthand syntax through lineage tooling, especially scripts written with INTO for variable capture or file dumps.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- meet unsupported select statement with into
- result-pipe (->>) statements are not supported for query spa
- unsupported or empty SQL function body
- cannot access user and system tables at the same time
- failed to get columns for view %q
AI-assisted analysis of bytebase/bytebase@1870550677 (2026-09-06).
Data as JSON: /api/errors/406c3b315d7fdb3d.
Report an issue: GitHub.