Fix always uses CommentDef::WithoutEq while parsing the inline comment (#1453)

This commit is contained in:
hulk 2024-10-05 04:03:02 +08:00 committed by GitHub
parent 1e0460a7df
commit 32a126b27c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 60 additions and 19 deletions

View file

@ -713,11 +713,11 @@ fn parse_create_table_primary_and_unique_key_characteristic_test() {
#[test]
fn parse_create_table_comment() {
let canonical = "CREATE TABLE foo (bar INT) COMMENT 'baz'";
let without_equal = "CREATE TABLE foo (bar INT) COMMENT 'baz'";
let with_equal = "CREATE TABLE foo (bar INT) COMMENT = 'baz'";
for sql in [canonical, with_equal] {
match mysql().one_statement_parses_to(sql, canonical) {
for sql in [without_equal, with_equal] {
match mysql().verified_stmt(sql) {
Statement::CreateTable(CreateTable { name, comment, .. }) => {
assert_eq!(name.to_string(), "foo");
assert_eq!(comment.expect("Should exist").to_string(), "baz");