Skip to content

Commit

Permalink
Update update.rs
Browse files Browse the repository at this point in the history
Remove multiple statements
  • Loading branch information
peter-scholtens authored Nov 22, 2023
1 parent e71332c commit a1d03d2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions diesel_tests/tests/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,7 @@ fn upsert_with_sql_literal_for_target() {
let connection = &mut connection();
// This index needs to happen before the insert or we'll get a deadlock
// with any transactions that are trying to get the row lock from insert
// As tests can run concurrently, lock the table of interest.
diesel::sql_query("BEGIN; LOCK TABLE users; CREATE UNIQUE INDEX ON users (name) WHERE name != 'Tess'; COMMIT;")
diesel::sql_query("CREATE UNIQUE INDEX ON users (name) WHERE name != 'Tess'")
.execute(connection)
.unwrap();
insert_sean_and_tess_into_users_table(connection);
Expand Down Expand Up @@ -370,8 +369,7 @@ fn upsert_with_sql_literal_for_target_with_condition() {
let connection = &mut connection();
// This index needs to happen before the insert or we'll get a deadlock
// with any transactions that are trying to get the row lock from insert
// As tests can run concurrently, lock the table of interest.
diesel::sql_query("BEGIN; LOCK TABLE users; CREATE UNIQUE INDEX ON users (name) WHERE name != 'Tess'; COMMIT;")
diesel::sql_query("CREATE UNIQUE INDEX ON users (name) WHERE name != 'Tess'")
.execute(connection)
.unwrap();
insert_sean_and_tess_into_users_table(connection);
Expand Down

0 comments on commit a1d03d2

Please sign in to comment.