Skip to content

Commit edeb9a2

Browse files
committed
Fix extra whitespace printed before ON CONFLICT
1 parent 4cdaa40 commit edeb9a2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/ast/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3513,7 +3513,7 @@ impl fmt::Display for OnInsert {
35133513
" ON DUPLICATE KEY UPDATE {}",
35143514
display_comma_separated(expr)
35153515
),
3516-
Self::OnConflict(o) => write!(f, " {o}"),
3516+
Self::OnConflict(o) => write!(f, "{o}"),
35173517
}
35183518
}
35193519
}

tests/sqlparser_postgres.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,7 +1421,7 @@ fn parse_prepare() {
14211421
fn parse_pg_on_conflict() {
14221422
let stmt = pg_and_generic().verified_stmt(
14231423
"INSERT INTO distributors (did, dname) \
1424-
VALUES (5, 'Gizmo Transglobal'), (6, 'Associated Computing, Inc') \
1424+
VALUES (5, 'Gizmo Transglobal'), (6, 'Associated Computing, Inc') \
14251425
ON CONFLICT(did) \
14261426
DO UPDATE SET dname = EXCLUDED.dname",
14271427
);
@@ -1451,7 +1451,7 @@ fn parse_pg_on_conflict() {
14511451

14521452
let stmt = pg_and_generic().verified_stmt(
14531453
"INSERT INTO distributors (did, dname, area) \
1454-
VALUES (5, 'Gizmo Transglobal', 'Mars'), (6, 'Associated Computing, Inc', 'Venus') \
1454+
VALUES (5, 'Gizmo Transglobal', 'Mars'), (6, 'Associated Computing, Inc', 'Venus') \
14551455
ON CONFLICT(did, area) \
14561456
DO UPDATE SET dname = EXCLUDED.dname, area = EXCLUDED.area",
14571457
);
@@ -1490,7 +1490,7 @@ fn parse_pg_on_conflict() {
14901490

14911491
let stmt = pg_and_generic().verified_stmt(
14921492
"INSERT INTO distributors (did, dname) \
1493-
VALUES (5, 'Gizmo Transglobal'), (6, 'Associated Computing, Inc') \
1493+
VALUES (5, 'Gizmo Transglobal'), (6, 'Associated Computing, Inc') \
14941494
ON CONFLICT DO NOTHING",
14951495
);
14961496
match stmt {
@@ -1509,7 +1509,7 @@ fn parse_pg_on_conflict() {
15091509

15101510
let stmt = pg_and_generic().verified_stmt(
15111511
"INSERT INTO distributors (did, dname, dsize) \
1512-
VALUES (5, 'Gizmo Transglobal', 1000), (6, 'Associated Computing, Inc', 1010) \
1512+
VALUES (5, 'Gizmo Transglobal', 1000), (6, 'Associated Computing, Inc', 1010) \
15131513
ON CONFLICT(did) \
15141514
DO UPDATE SET dname = $1 WHERE dsize > $2",
15151515
);
@@ -1546,7 +1546,7 @@ fn parse_pg_on_conflict() {
15461546

15471547
let stmt = pg_and_generic().verified_stmt(
15481548
"INSERT INTO distributors (did, dname, dsize) \
1549-
VALUES (5, 'Gizmo Transglobal', 1000), (6, 'Associated Computing, Inc', 1010) \
1549+
VALUES (5, 'Gizmo Transglobal', 1000), (6, 'Associated Computing, Inc', 1010) \
15501550
ON CONFLICT ON CONSTRAINT distributors_did_pkey \
15511551
DO UPDATE SET dname = $1 WHERE dsize > $2",
15521552
);

0 commit comments

Comments
 (0)