Skip to content

Failed SQL generation when encountering invalid tokens for a table #25

@zhangysh1995

Description

@zhangysh1995

Description:

If I have a table without int type columns, and the grammar uses _field_int, it will throw an error and exit directly:

Example:

zhangys@xxx:~/go/bin$ ./go-randgen gensql -Y ../src/github.com/pingcap/go-randgen/examples/functions.yy   --dsn "root:@tcp(127.0.0.1:3000)/test" -Q 50
2020/07/08 07:07:50 Cache database meta info...
2020/07/08 07:07:50 Cache database meta info ok, start generate sqls by yy
2020/07/08 07:07:50 load yy from ../src/github.com/pingcap/go-randgen/examples/functions.yy
2020/07/08 07:07:50 Fatal Error: there is no int fields

Expected behavior:

It should roll back to the rule expansion to choose another one, then proceed to normal generation.

Diagnosis:

Please check for the root cause

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions