vfmt: fix segfault in update where the struct is not yet known
parent
0661273aad
commit
fa867578bc
|
@ -150,8 +150,11 @@ fn (mut p Parser) sql_stmt() ast.SqlStmt {
|
|||
// fields := info.fields.filter(it.typ in [table.string_type, table.int_type, table.bool_type])
|
||||
table_name = sym.name
|
||||
} else if kind == .update {
|
||||
idx := p.table.find_type_idx(table_name)
|
||||
table_type = table.new_type(idx)
|
||||
if !p.pref.is_fmt {
|
||||
// NB: in vfmt mode, v parses just a single file and table_name may not have been registered
|
||||
idx := p.table.find_type_idx(table_name)
|
||||
table_type = table.new_type(idx)
|
||||
}
|
||||
p.check_sql_keyword('where')
|
||||
where_expr = p.expr(0)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue