@@ -106,33 +106,44 @@ fn parse_insert_values() {
106106 let rows2 = vec![row.clone(), row];
107107
108108 let sql = "INSERT customer VALUES (1, 2, 3)";
109- check_one(sql, "customer", &[], &rows1);
109+ check_one(sql, "customer", &[], &rows1, false );
110110
111111 let sql = "INSERT INTO customer VALUES (1, 2, 3)";
112- check_one(sql, "customer", &[], &rows1);
112+ check_one(sql, "customer", &[], &rows1, false );
113113
114114 let sql = "INSERT INTO customer VALUES (1, 2, 3), (1, 2, 3)";
115- check_one(sql, "customer", &[], &rows2);
115+ check_one(sql, "customer", &[], &rows2, false );
116116
117117 let sql = "INSERT INTO public.customer VALUES (1, 2, 3)";
118- check_one(sql, "public.customer", &[], &rows1);
118+ check_one(sql, "public.customer", &[], &rows1, false );
119119
120120 let sql = "INSERT INTO db.public.customer VALUES (1, 2, 3)";
121- check_one(sql, "db.public.customer", &[], &rows1);
121+ check_one(sql, "db.public.customer", &[], &rows1, false );
122122
123123 let sql = "INSERT INTO public.customer (id, name, active) VALUES (1, 2, 3)";
124124 check_one(
125125 sql,
126126 "public.customer",
127127 &["id".to_string(), "name".to_string(), "active".to_string()],
128128 &rows1,
129+ false,
130+ );
131+
132+ let sql = r"INSERT INTO t (id, name, active) VALUE (1, 2, 3)";
133+ check_one(
134+ sql,
135+ "t",
136+ &["id".to_string(), "name".to_string(), "active".to_string()],
137+ &rows1,
138+ true,
129139 );
130140
131141 fn check_one(
132142 sql: &str,
133143 expected_table_name: &str,
134144 expected_columns: &[String],
135145 expected_rows: &[Vec<Expr>],
146+ expected_value_keyword: bool,
136147 ) {
137148 match verified_stmt(sql) {
138149 Statement::Insert(Insert {
@@ -147,8 +158,13 @@ fn parse_insert_values() {
147158 assert_eq!(column, &Ident::new(expected_columns[index].clone()));
148159 }
149160 match *source.body {
150- SetExpr::Values(Values { rows, .. }) => {
151- assert_eq!(rows.as_slice(), expected_rows)
161+ SetExpr::Values(Values {
162+ rows,
163+ value_keyword,
164+ ..
165+ }) => {
166+ assert_eq!(rows.as_slice(), expected_rows);
167+ assert!(value_keyword == expected_value_keyword);
152168 }
153169 _ => unreachable!(),
154170 }
@@ -9908,6 +9924,7 @@ fn parse_merge() {
99089924 action: MergeAction::Insert(MergeInsertExpr {
99099925 columns: vec![Ident::new("A"), Ident::new("B"), Ident::new("C")],
99109926 kind: MergeInsertKind::Values(Values {
9927+ value_keyword: false,
99119928 explicit_row: false,
99129929 rows: vec![vec![
99139930 Expr::CompoundIdentifier(vec![
0 commit comments