Skip to content

mysql alter add inside of schema file fails #251

Closed
@jmhodges

Description

@jmhodges

Say a schema file contains

alter table people add column is_cool tinyint;
update people set is_cool = 0 where 1 = 1;

sqlc will error out with:

Failed to parse UPDATE query: Failed to determine type of a parameter's column: Column [is_cool] not found in table [people]

Since update commands (and similar) don't actually change the schema, we could get away with dropping them completely. But perhaps all we're missing is updating the right bits of memory between query parses?

(An unedited version of this was found in a codebase that's in production.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions