Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

29.3 KB
Raw Blame
- statement: CREATE TABLE t(a date default '');
  ignore_case_sensitive: false
  want: ''
  advice:
    status: 1
    code: 423
    title: '[types:1292]Incorrect datetime value: '''''
    content: '[types:1292]Incorrect datetime value: '''''
    startPosition:
      line: 1
- statement: 'CREATE TABLE t(a TEXT);

    ALTER TABLE T ALTER COLUMN a SET DEFAULT ''1'';'
  ignore_case_sensitive: true
  want: ''
  advice:
    status: 1
    code: 423
    title: BLOB, TEXT, GEOMETRY or JSON column `a` can't have a default value
    content: BLOB, TEXT, GEOMETRY or JSON column `a` can't have a default value
    startPosition:
      line: 2
- statement: '      CREATE TABLE t(a TEXT DEFAULT ''1'')'
  ignore_case_sensitive: false
  want: ''
  advice:
    status: 1
    code: 423
    title: BLOB, TEXT, GEOMETRY or JSON column `a` can't have a default value
    content: BLOB, TEXT, GEOMETRY or JSON column `a` can't have a default value
    startPosition:
      line: 1
- statement: 'CREATE TABLE t(a INT NOT NULL);

    ALTER TABLE t ALTER COLUMN a SET DEFAULT NULL;'
  ignore_case_sensitive: false
  want: ''
  advice:
    status: 1
    code: 428
    title: Invalid default value for column `a`
    content: Invalid default value for column `a`
    startPosition:
      line: 2
- statement: '      CREATE TABLE t(a INT NOT NULL DEFAULT NULL)'
  ignore_case_sensitive: false
  want: ''
  advice:
    status: 1
    code: 428
    title: Invalid default value for column `a`
    content: Invalid default value for column `a`
    startPosition:
      line: 1
- statement: '      CREATE TABLE t(a int ON UPDATE NOW())'
  ignore_case_sensitive: false
  want: ''
  advice:
    status: 1
    code: 427
    title: Column `a` use ON UPDATE but is not DATETIME or TIMESTAMP
    content: Column `a` use ON UPDATE but is not DATETIME or TIMESTAMP
    startPosition:
      line: 1
- statement: '      CREATE TABLE t(a int auto_increment, b int auto_increment);'
  ignore_case_sensitive: false
  want: ''
  advice:
    status: 1
    code: 426
    title: There can be only one auto column for table `t`
    content: There can be only one auto column for table `t`
    startPosition:
      line: 1
- statement: '      CREATE TABLE t as select * from t1;'
  ignore_case_sensitive: false
  want: ''
  advice:
    status: 2
    code: 205
    title: CREATE TABLE AS statement is used in "CREATE TABLE t as select * from t1;"
    content: CREATE TABLE AS statement is used in "CREATE TABLE t as select * from
      t1;"
    startPosition:
      line: 1
- statement: "\n\t\t\t\tCREATE TABLE t(a int, b int); \n\t\t\t\tCREATE INDEX idx_c\
    \ on t(c);\n\t\t\t"
  ignore_case_sensitive: false
  want: ''
  advice:
    status: 1
    code: 405
    title: Column `c` does not exist in table `t`
    content: Column `c` does not exist in table `t`
    startPosition:
      line: 3
- statement: "\n\t\t\t\tCREATE TABLE t(a int, b int); \n\t\t\t\tALTER TABLE t MODIFY\
    \ COLUMN c int;\n\t\t\t"
  ignore_case_sensitive: false
  want: ''
  advice:
    status: 1
    code: 405
    title: Column `c` does not exist in table `t`
    content: Column `c` does not exist in table `t`
    startPosition:
      line: 3
- statement: "\n\t\t\t\tCREATE TABLE t(a int, b int); \n\t\t\t\tALTER TABLE t CHANGE\
    \ COLUMN c aa int;\n\t\t\t"
  ignore_case_sensitive: false
  want: ''
  advice:
    status: 1
    code: 405
    title: Column `c` does not exist in table `t`
    content: Column `c` does not exist in table `t`
    startPosition:
      line: 3
- statement: "\n\t\t\t\tCREATE TABLE t(a int, b int); \n\t\t\t\tALTER TABLE t DROP\
    \ COLUMN c;\n\t\t\t"
  ignore_case_sensitive: false
  want: ''
  advice:
    status: 1
    code: 405
    title: Column `c` does not exist in table `t`
    content: Column `c` does not exist in table `t`
    startPosition:
      line: 3
- statement: "\n\t\t\t\tCREATE TABLE t(a int, b int); \n\t\t\t\tALTER TABLE t RENAME\
    \ COLUMN c TO cc;\n\t\t\t"
  ignore_case_sensitive: false
  want: ''
  advice:
    status: 1
    code: 405
    title: Column `c` does not exist in table `t`
    content: Column `c` does not exist in table `t`
    startPosition:
      line: 3
- statement: "\n\t\t\t\tCREATE TABLE t(a int, b int); \n\t\t\t\tALTER TABLE t RENAME\
    \ COLUMN c TO cc;\n\t\t\t"
  ignore_case_sensitive: false
  want: ''
  advice:
    status: 1
    code: 405
    title: Column `c` does not exist in table `t`
    content: Column `c` does not exist in table `t`
    startPosition:
      line: 3
- statement: "\n\t\t\t\tCREATE TABLE t(a int, b int); \n\t\t\t\tALTER TABLE t ALTER\
    \ COLUMN c DROP DEFAULT;\n\t\t\t"
  ignore_case_sensitive: false
  want: ''
  advice:
    status: 1
    code: 405
    title: Column `c` does not exist in table `t`
    content: Column `c` does not exist in table `t`
    startPosition:
      line: 3
- statement: 'ALTER DATABASE CHARACTER SET = utf8mb4;

    ALTER DATABASE test COLLATE utf8mb4_polish_ci;'
  ignore_case_sensitive: false
  want: "{\n  \"name\": \"test\",\n  \"schemas\": [\n    {}\n  ],\n  \"characterSet\"\
    : \"utf8mb4\",\n  \"collation\": \"utf8mb4_polish_ci\"\n}"
  advice: null
- statement: "CREATE TABLE t(\n  a int PRIMARY KEY DEFAULT 1,\n  b varchar(200) CHARACTER\
    \ SET utf8mb4 NOT NULL UNIQUE,\n  c int auto_increment NULL COMMENT 'This is a\
    \ comment' DEFAULT NULL,\n  d varchar(10) COLLATE utf8mb4_polish_ci,\n  KEY idx_a\
    \ (a),\n  INDEX (b, a),\n  UNIQUE (b, c, d),\n  FULLTEXT (b, d) WITH PARSER ngram\
    \ INVISIBLE\n);\nCREATE TABLE t_copy like t;"
  ignore_case_sensitive: false
  want: "{\n  \"name\": \"test\",\n  \"schemas\": [\n    {\n      \"tables\": [\n\
    \        {\n          \"name\": \"t\",\n          \"columns\": [\n           \
    \ {\n              \"name\": \"a\",\n              \"position\": 1,\n        \
    \      \"default\": \"1\",\n              \"type\": \"int(11)\"\n            },\n\
    \            {\n              \"name\": \"b\",\n              \"position\": 2,\n\
    \              \"type\": \"varchar(200)\",\n              \"characterSet\": \"\
    utf8mb4\"\n            },\n            {\n              \"name\": \"c\",\n   \
    \           \"position\": 3,\n              \"nullable\": true,\n            \
    \  \"type\": \"int(11)\",\n              \"comment\": \"This is a comment\"\n\
    \            },\n            {\n              \"name\": \"d\",\n             \
    \ \"position\": 4,\n              \"nullable\": true,\n              \"type\"\
    : \"varchar(10)\",\n              \"collation\": \"utf8mb4_polish_ci\"\n     \
    \       }\n          ],\n          \"indexes\": [\n            {\n           \
    \   \"name\": \"PRIMARY\",\n              \"expressions\": [\n               \
    \ \"a\"\n              ],\n              \"type\": \"BTREE\",\n              \"\
    unique\": true,\n              \"primary\": true,\n              \"visible\":\
    \ true\n            },\n            {\n              \"name\": \"b\",\n      \
    \        \"expressions\": [\n                \"b\"\n              ],\n       \
    \       \"type\": \"BTREE\",\n              \"unique\": true,\n              \"\
    visible\": true\n            },\n            {\n              \"name\": \"b_2\"\
    ,\n              \"expressions\": [\n                \"b\",\n                \"\
    a\"\n              ],\n              \"type\": \"BTREE\",\n              \"visible\"\
    : true\n            },\n            {\n              \"name\": \"b_3\",\n    \
    \          \"expressions\": [\n                \"b\",\n                \"c\",\n\
    \                \"d\"\n              ],\n              \"type\": \"BTREE\",\n\
    \              \"unique\": true,\n              \"visible\": true\n          \
    \  },\n            {\n              \"name\": \"b_4\",\n              \"expressions\"\
    : [\n                \"b\",\n                \"d\"\n              ],\n       \
    \       \"type\": \"FULLTEXT\"\n            },\n            {\n              \"\
    name\": \"idx_a\",\n              \"expressions\": [\n                \"a\"\n\
    \              ],\n              \"type\": \"BTREE\",\n              \"visible\"\
    : true\n            }\n          ]\n        },\n        {\n          \"name\"\
    : \"t_copy\",\n          \"columns\": [\n            {\n              \"name\"\
    : \"a\",\n              \"position\": 1,\n              \"default\": \"1\",\n\
    \              \"type\": \"int(11)\"\n            },\n            {\n        \
    \      \"name\": \"b\",\n              \"position\": 2,\n              \"type\"\
    : \"varchar(200)\",\n              \"characterSet\": \"utf8mb4\"\n           \
    \ },\n            {\n              \"name\": \"c\",\n              \"position\"\
    : 3,\n              \"nullable\": true,\n              \"type\": \"int(11)\",\n\
    \              \"comment\": \"This is a comment\"\n            },\n          \
    \  {\n              \"name\": \"d\",\n              \"position\": 4,\n       \
    \       \"nullable\": true,\n              \"type\": \"varchar(10)\",\n      \
    \        \"collation\": \"utf8mb4_polish_ci\"\n            }\n          ],\n \
    \         \"indexes\": [\n            {\n              \"name\": \"PRIMARY\",\n\
    \              \"expressions\": [\n                \"a\"\n              ],\n \
    \             \"type\": \"BTREE\",\n              \"unique\": true,\n        \
    \      \"primary\": true,\n              \"visible\": true\n            },\n \
    \           {\n              \"name\": \"b\",\n              \"expressions\":\
    \ [\n                \"b\"\n              ],\n              \"type\": \"BTREE\"\
    ,\n              \"unique\": true,\n              \"visible\": true\n        \
    \    },\n            {\n              \"name\": \"b_2\",\n              \"expressions\"\
    : [\n                \"b\",\n                \"a\"\n              ],\n       \
    \       \"type\": \"BTREE\",\n              \"visible\": true\n            },\n\
    \            {\n              \"name\": \"b_3\",\n              \"expressions\"\
    : [\n                \"b\",\n                \"c\",\n                \"d\"\n \
    \             ],\n              \"type\": \"BTREE\",\n              \"unique\"\
    : true,\n              \"visible\": true\n            },\n            {\n    \
    \          \"name\": \"b_4\",\n              \"expressions\": [\n            \
    \    \"b\",\n                \"d\"\n              ],\n              \"type\":\
    \ \"FULLTEXT\"\n            },\n            {\n              \"name\": \"idx_a\"\
    ,\n              \"expressions\": [\n                \"a\"\n              ],\n\
    \              \"type\": \"BTREE\",\n              \"visible\": true\n       \
    \     }\n          ]\n        }\n      ]\n    }\n  ]\n}"
  advice: null
- statement: "CREATE TABLE t(\n  a int PRIMARY KEY DEFAULT 1,\n  b varchar(200) CHARACTER\
    \ SET utf8mb4 NOT NULL UNIQUE,\n  c int auto_increment NULL COMMENT 'This is a\
    \ comment',\n  d varchar(10) COLLATE utf8mb4_polish_ci,\n  KEY idx_a (a),\n  INDEX\
    \ (b, a),\n  UNIQUE (b, c, d),\n  FULLTEXT (b, d) WITH PARSER ngram INVISIBLE\n\
    )"
  ignore_case_sensitive: false
  want: "{\n  \"name\": \"test\",\n  \"schemas\": [\n    {\n      \"tables\": [\n\
    \        {\n          \"name\": \"t\",\n          \"columns\": [\n           \
    \ {\n              \"name\": \"a\",\n              \"position\": 1,\n        \
    \      \"default\": \"1\",\n              \"type\": \"int(11)\"\n            },\n\
    \            {\n              \"name\": \"b\",\n              \"position\": 2,\n\
    \              \"type\": \"varchar(200)\",\n              \"characterSet\": \"\
    utf8mb4\"\n            },\n            {\n              \"name\": \"c\",\n   \
    \           \"position\": 3,\n              \"nullable\": true,\n            \
    \  \"type\": \"int(11)\",\n              \"comment\": \"This is a comment\"\n\
    \            },\n            {\n              \"name\": \"d\",\n             \
    \ \"position\": 4,\n              \"nullable\": true,\n              \"type\"\
    : \"varchar(10)\",\n              \"collation\": \"utf8mb4_polish_ci\"\n     \
    \       }\n          ],\n          \"indexes\": [\n            {\n           \
    \   \"name\": \"PRIMARY\",\n              \"expressions\": [\n               \
    \ \"a\"\n              ],\n              \"type\": \"BTREE\",\n              \"\
    unique\": true,\n              \"primary\": true,\n              \"visible\":\
    \ true\n            },\n            {\n              \"name\": \"b\",\n      \
    \        \"expressions\": [\n                \"b\"\n              ],\n       \
    \       \"type\": \"BTREE\",\n              \"unique\": true,\n              \"\
    visible\": true\n            },\n            {\n              \"name\": \"b_2\"\
    ,\n              \"expressions\": [\n                \"b\",\n                \"\
    a\"\n              ],\n              \"type\": \"BTREE\",\n              \"visible\"\
    : true\n            },\n            {\n              \"name\": \"b_3\",\n    \
    \          \"expressions\": [\n                \"b\",\n                \"c\",\n\
    \                \"d\"\n              ],\n              \"type\": \"BTREE\",\n\
    \              \"unique\": true,\n              \"visible\": true\n          \
    \  },\n            {\n              \"name\": \"b_4\",\n              \"expressions\"\
    : [\n                \"b\",\n                \"d\"\n              ],\n       \
    \       \"type\": \"FULLTEXT\"\n            },\n            {\n              \"\
    name\": \"idx_a\",\n              \"expressions\": [\n                \"a\"\n\
    \              ],\n              \"type\": \"BTREE\",\n              \"visible\"\
    : true\n            }\n          ]\n        }\n      ]\n    }\n  ]\n}"
  advice: null
- statement: "CREATE TABLE t(\n  a int,\n  b int,\n  PRIMARY KEY (a, b)\n)"
  ignore_case_sensitive: false
  want: "{\n  \"name\": \"test\",\n  \"schemas\": [\n    {\n      \"tables\": [\n\
    \        {\n          \"name\": \"t\",\n          \"columns\": [\n           \
    \ {\n              \"name\": \"a\",\n              \"position\": 1,\n        \
    \      \"type\": \"int(11)\"\n            },\n            {\n              \"\
    name\": \"b\",\n              \"position\": 2,\n              \"type\": \"int(11)\"\
    \n            }\n          ],\n          \"indexes\": [\n            {\n     \
    \         \"name\": \"PRIMARY\",\n              \"expressions\": [\n         \
    \       \"a\",\n                \"b\"\n              ],\n              \"type\"\
    : \"BTREE\",\n              \"unique\": true,\n              \"primary\": true,\n\
    \              \"visible\": true\n            }\n          ]\n        }\n    \
    \  ]\n    }\n  ]\n}"
  advice: null
- statement: 'CREATE TABLE t1(a int, b int, c int);

    CREATE TABLE t2(a int);

    DROP TABLE t1, t2'
  ignore_case_sensitive: false
  want: "{\n  \"name\": \"test\",\n  \"schemas\": [\n    {}\n  ]\n}"
  advice: null
- statement: '      DROP TABLE t1, t2'
  ignore_case_sensitive: false
  want: ''
  advice:
    status: 1
    code: 604
    title: Table `t1` does not exist
    content: Table `t1` does not exist
    startPosition:
      line: 1
- statement: 'CREATE TABLE t(a int);

    RENAME TABLE t to other_db.t1'
  ignore_case_sensitive: false
  want: "{\n  \"name\": \"test\",\n  \"schemas\": [\n    {}\n  ]\n}"
  advice: null
- statement: 'CREATE TABLE t(a int);

    RENAME TABLE t to test.t1'
  ignore_case_sensitive: false
  want: "{\n  \"name\": \"test\",\n  \"schemas\": [\n    {\n      \"tables\": [\n\
    \        {\n          \"name\": \"t1\",\n          \"columns\": [\n          \
    \  {\n              \"name\": \"a\",\n              \"position\": 1,\n       \
    \       \"nullable\": true,\n              \"type\": \"int(11)\"\n           \
    \ }\n          ]\n        }\n      ]\n    }\n  ]\n}"
  advice: null
- statement: "-- this is comment\n        DROP DATABASE test;\n        CREATE TABLE\
    \ t(a int);"
  ignore_case_sensitive: false
  want: ''
  advice:
    status: 1
    code: 703
    title: Database `test` is deleted
    content: Database `test` is deleted
    startPosition:
      line: 3
- statement: "CREATE TABLE t(\n  a int PRIMARY KEY DEFAULT 1,\n  b varchar(200) CHARACTER\
    \ SET utf8mb4 NOT NULL UNIQUE,\n  c int auto_increment NULL COMMENT 'This is a\
    \ comment',\n  d varchar(10) COLLATE utf8mb4_polish_ci,\n  e int,\n  KEY idx_a\
    \ (a),\n  INDEX (b, a),\n  UNIQUE (b, c, d),\n  FULLTEXT (b, d) WITH PARSER ngram\
    \ INVISIBLE\n);\nALTER TABLE t COLLATE utf8mb4_0900_ai_ci, ENGINE = INNODB, COMMENT\
    \ 'This is a table comment';\nALTER TABLE t ADD COLUMN a1 int AFTER a;\nALTER\
    \ TABLE t ADD INDEX idx_a_b (a, b);\nALTER TABLE t DROP COLUMN c;\nALTER TABLE\
    \ t DROP PRIMARY KEY;\nALTER TABLE t DROP INDEX b_2;\nALTER TABLE t MODIFY COLUMN\
    \ b varchar(20) FIRST;\nALTER TABLE t CHANGE COLUMN d d_copy varchar(10) COLLATE\
    \ utf8mb4_polish_ci;\nALTER TABLE t RENAME COLUMN a to a_copy;\nALTER TABLE t\
    \ RENAME TO t_copy;\nALTER TABLE t_copy ALTER COLUMN a_copy DROP DEFAULT;\nALTER\
    \ TABLE t_copy RENAME INDEX b TO idx_b;\nALTER TABLE t_copy ALTER INDEX b_3 INVISIBLE;"
  ignore_case_sensitive: false
  want: "{\n  \"name\": \"test\",\n  \"schemas\": [\n    {\n      \"tables\": [\n\
    \        {\n          \"name\": \"t_copy\",\n          \"columns\": [\n      \
    \      {\n              \"name\": \"b\",\n              \"position\": 1,\n   \
    \           \"nullable\": true,\n              \"type\": \"varchar(20)\"\n   \
    \         },\n            {\n              \"name\": \"a_copy\",\n           \
    \   \"position\": 2,\n              \"type\": \"int(11)\"\n            },\n  \
    \          {\n              \"name\": \"a1\",\n              \"position\": 3,\n\
    \              \"nullable\": true,\n              \"type\": \"int(11)\"\n    \
    \        },\n            {\n              \"name\": \"d_copy\",\n            \
    \  \"position\": 4,\n              \"nullable\": true,\n              \"type\"\
    : \"varchar(10)\",\n              \"collation\": \"utf8mb4_polish_ci\"\n     \
    \       },\n            {\n              \"name\": \"e\",\n              \"position\"\
    : 5,\n              \"nullable\": true,\n              \"type\": \"int(11)\"\n\
    \            }\n          ],\n          \"indexes\": [\n            {\n      \
    \        \"name\": \"b_3\",\n              \"expressions\": [\n              \
    \  \"b\",\n                \"d_copy\"\n              ],\n              \"type\"\
    : \"BTREE\",\n              \"unique\": true\n            },\n            {\n\
    \              \"name\": \"b_4\",\n              \"expressions\": [\n        \
    \        \"b\",\n                \"d_copy\"\n              ],\n              \"\
    type\": \"FULLTEXT\"\n            },\n            {\n              \"name\": \"\
    idx_a\",\n              \"expressions\": [\n                \"a_copy\"\n     \
    \         ],\n              \"type\": \"BTREE\",\n              \"visible\": true\n\
    \            },\n            {\n              \"name\": \"idx_a_b\",\n       \
    \       \"expressions\": [\n                \"a_copy\",\n                \"b\"\
    \n              ],\n              \"type\": \"BTREE\",\n              \"visible\"\
    : true\n            },\n            {\n              \"name\": \"idx_b\",\n  \
    \            \"expressions\": [\n                \"b\"\n              ],\n   \
    \           \"type\": \"BTREE\",\n              \"unique\": true,\n          \
    \    \"visible\": true\n            }\n          ],\n          \"engine\": \"\
    INNODB\",\n          \"collation\": \"utf8mb4_0900_ai_ci\",\n          \"comment\"\
    : \"This is a table comment\"\n        }\n      ]\n    }\n  ]\n}"
  advice: null
- statement: "CREATE TABLE t(\n  a int PRIMARY KEY DEFAULT 1,\n  b varchar(200) CHARACTER\
    \ SET utf8mb4 NOT NULL UNIQUE,\n  c int auto_increment NULL COMMENT 'This is a\
    \ comment',\n  d varchar(10) COLLATE utf8mb4_polish_ci\n);\nCREATE INDEX idx_a\
    \ on t(a);\nCREATE INDEX b_2 on t(b, a);\nCREATE UNIQUE INDEX b_3 on t(b, c, d);\n\
    CREATE FULLTEXT INDEX b_4 on t(b, d) WITH PARSER ngram INVISIBLE;"
  ignore_case_sensitive: false
  want: "{\n  \"name\": \"test\",\n  \"schemas\": [\n    {\n      \"tables\": [\n\
    \        {\n          \"name\": \"t\",\n          \"columns\": [\n           \
    \ {\n              \"name\": \"a\",\n              \"position\": 1,\n        \
    \      \"default\": \"1\",\n              \"type\": \"int(11)\"\n            },\n\
    \            {\n              \"name\": \"b\",\n              \"position\": 2,\n\
    \              \"type\": \"varchar(200)\",\n              \"characterSet\": \"\
    utf8mb4\"\n            },\n            {\n              \"name\": \"c\",\n   \
    \           \"position\": 3,\n              \"nullable\": true,\n            \
    \  \"type\": \"int(11)\",\n              \"comment\": \"This is a comment\"\n\
    \            },\n            {\n              \"name\": \"d\",\n             \
    \ \"position\": 4,\n              \"nullable\": true,\n              \"type\"\
    : \"varchar(10)\",\n              \"collation\": \"utf8mb4_polish_ci\"\n     \
    \       }\n          ],\n          \"indexes\": [\n            {\n           \
    \   \"name\": \"PRIMARY\",\n              \"expressions\": [\n               \
    \ \"a\"\n              ],\n              \"type\": \"BTREE\",\n              \"\
    unique\": true,\n              \"primary\": true,\n              \"visible\":\
    \ true\n            },\n            {\n              \"name\": \"b\",\n      \
    \        \"expressions\": [\n                \"b\"\n              ],\n       \
    \       \"type\": \"BTREE\",\n              \"unique\": true,\n              \"\
    visible\": true\n            },\n            {\n              \"name\": \"b_2\"\
    ,\n              \"expressions\": [\n                \"b\",\n                \"\
    a\"\n              ],\n              \"type\": \"BTREE\",\n              \"visible\"\
    : true\n            },\n            {\n              \"name\": \"b_3\",\n    \
    \          \"expressions\": [\n                \"b\",\n                \"c\",\n\
    \                \"d\"\n              ],\n              \"type\": \"BTREE\",\n\
    \              \"unique\": true,\n              \"visible\": true\n          \
    \  },\n            {\n              \"name\": \"b_4\",\n              \"expressions\"\
    : [\n                \"b\",\n                \"d\"\n              ],\n       \
    \       \"type\": \"FULLTEXT\"\n            },\n            {\n              \"\
    name\": \"idx_a\",\n              \"expressions\": [\n                \"a\"\n\
    \              ],\n              \"type\": \"BTREE\",\n              \"visible\"\
    : true\n            }\n          ]\n        }\n      ]\n    }\n  ]\n}"
  advice: null
- statement: "CREATE TABLE t(\n  a int PRIMARY KEY DEFAULT 1,\n  b varchar(200) CHARACTER\
    \ SET utf8mb4 NOT NULL UNIQUE\n);\nDROP INDEX IF EXISTS nonexistent on t;"
  ignore_case_sensitive: false
  want: "{\n  \"name\": \"test\",\n  \"schemas\": [\n    {\n      \"tables\": [\n\
    \        {\n          \"name\": \"t\",\n          \"columns\": [\n           \
    \ {\n              \"name\": \"a\",\n              \"position\": 1,\n        \
    \      \"default\": \"1\",\n              \"type\": \"int(11)\"\n            },\n\
    \            {\n              \"name\": \"b\",\n              \"position\": 2,\n\
    \              \"type\": \"varchar(200)\",\n              \"characterSet\": \"\
    utf8mb4\"\n            }\n          ],\n          \"indexes\": [\n           \
    \ {\n              \"name\": \"PRIMARY\",\n              \"expressions\": [\n\
    \                \"a\"\n              ],\n              \"type\": \"BTREE\",\n\
    \              \"unique\": true,\n              \"primary\": true,\n         \
    \     \"visible\": true\n            },\n            {\n              \"name\"\
    : \"b\",\n              \"expressions\": [\n                \"b\"\n          \
    \    ],\n              \"type\": \"BTREE\",\n              \"unique\": true,\n\
    \              \"visible\": true\n            }\n          ]\n        }\n     \
    \ ]\n    }\n  ]\n}"
  advice: null
- statement: "CREATE TABLE t(\n  a int PRIMARY KEY DEFAULT 1,\n  b varchar(200) CHARACTER\
    \ SET utf8mb4 NOT NULL UNIQUE\n);\nDROP INDEX nonexistent on t;"
  ignore_case_sensitive: false
  want: ''
  advice:
    status: 1
    code: 809
    title: index "nonexistent" does not exist in table "t"
    content: index "nonexistent" does not exist in table "t"
    startPosition:
      line: 0
- statement: "CREATE TABLE t(\n  a int PRIMARY KEY DEFAULT 1,\n  b varchar(200) CHARACTER\
    \ SET utf8mb4 NOT NULL UNIQUE\n);\nDROP INDEX b on t;"
  ignore_case_sensitive: false
  want: "{\n  \"name\": \"test\",\n  \"schemas\": [\n    {\n      \"tables\": [\n\
    \        {\n          \"name\": \"t\",\n          \"columns\": [\n           \
    \ {\n              \"name\": \"a\",\n              \"position\": 1,\n        \
    \      \"default\": \"1\",\n              \"type\": \"int(11)\"\n            },\n\
    \            {\n              \"name\": \"b\",\n              \"position\": 2,\n\
    \              \"type\": \"varchar(200)\",\n              \"characterSet\": \"\
    utf8mb4\"\n            }\n          ],\n          \"indexes\": [\n           \
    \ {\n              \"name\": \"PRIMARY\",\n              \"expressions\": [\n\
    \                \"a\"\n              ],\n              \"type\": \"BTREE\",\n\
    \              \"unique\": true,\n              \"primary\": true,\n         \
    \     \"visible\": true\n            }\n          ]\n        }\n      ]\n    }\n\
    \  ]\n}"
  advice: null
- statement: |
    CREATE TABLE t(a int);
    ALTER TABLE t ADD COLUMN IF NOT EXISTS a int;
  ignore_case_sensitive: false
  want: |-
    {
      "name": "test",
      "schemas": [
        {
          "tables": [
            {
              "name": "t",
              "columns": [
                {
                  "name": "a",
                  "position": 1,
                  "nullable": true,
                  "type": "int(11)"
                }
              ]
            }
          ]
        }
      ]
    }
  advice: null
- statement: |
    CREATE TABLE t(a int);
    ALTER TABLE t ADD COLUMN a int;
  ignore_case_sensitive: false
  want: ''
  advice:
    status: 1
    code: 412
    title: Column `a` already exists in table `t`
    content: Column `a` already exists in table `t`
    startPosition:
      line: 0
- statement: |
    CREATE TABLE t(a int);
    ALTER TABLE t DROP COLUMN IF EXISTS b;
  ignore_case_sensitive: false
  want: |-
    {
      "name": "test",
      "schemas": [
        {
          "tables": [
            {
              "name": "t",
              "columns": [
                {
                  "name": "a",
                  "position": 1,
                  "nullable": true,
                  "type": "int(11)"
                }
              ]
            }
          ]
        }
      ]
    }
  advice: null
- statement: |
    CREATE TABLE t(a int);
    ALTER TABLE t DROP INDEX IF EXISTS idx_nonexistent;
  ignore_case_sensitive: false
  want: |-
    {
      "name": "test",
      "schemas": [
        {
          "tables": [
            {
              "name": "t",
              "columns": [
                {
                  "name": "a",
                  "position": 1,
                  "nullable": true,
                  "type": "int(11)"
                }
              ]
            }
          ]
        }
      ]
    }
  advice: null
- statement: |
    CREATE TABLE t(a int);
    CREATE INDEX idx_a ON t(a);
    CREATE INDEX IF NOT EXISTS idx_a ON t(a);
  ignore_case_sensitive: false
  want: |-
    {
      "name": "test",
      "schemas": [
        {
          "tables": [
            {
              "name": "t",
              "columns": [
                {
                  "name": "a",
                  "position": 1,
                  "nullable": true,
                  "type": "int(11)"
                }
              ],
              "indexes": [
                {
                  "name": "idx_a",
                  "expressions": [
                    "a"
                  ],
                  "type": "BTREE",
                  "visible": true
                }
              ]
            }
          ]
        }
      ]
    }
  advice: null
- statement: |
    CREATE TABLE t(a int);
    CREATE INDEX idx_a ON t(a);
    CREATE INDEX idx_a ON t(a);
  ignore_case_sensitive: false
  want: ''
  advice:
    status: 1
    code: 805
    title: Index `idx_a` already exists in table `t`
    content: Index `idx_a` already exists in table `t`
    startPosition:
      line: 0
- statement: |
    CREATE TABLE t(a int);
    CREATE INDEX idx_a ON t(a);
    ALTER TABLE t ADD INDEX IF NOT EXISTS idx_a (a);
  ignore_case_sensitive: false
  want: |-
    {
      "name": "test",
      "schemas": [
        {
          "tables": [
            {
              "name": "t",
              "columns": [
                {
                  "name": "a",
                  "position": 1,
                  "nullable": true,
                  "type": "int(11)"
                }
              ],
              "indexes": [
                {
                  "name": "idx_a",
                  "expressions": [
                    "a"
                  ],
                  "type": "BTREE",
                  "visible": true
                }
              ]
            }
          ]
        }
      ]
    }
  advice: null