Skip to content
This repository was archived by the owner on Apr 25, 2023. It is now read-only.

fix: pass client_found_rows on latest mysql_async #452

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/connector/mysql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,9 @@ impl MysqlUrl {
.stmt_cache_size(Some(0))
.user(Some(self.username()))
.pass(self.password())
.db_name(Some(self.dbname()));
.db_name(Some(self.dbname()))
// See https://github.com/prisma/prisma-engines/pull/3679 as to why this is needed.
.client_found_rows(true);

match self.socket() {
Some(ref socket) => {
Expand Down
20 changes: 20 additions & 0 deletions src/tests/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3564,3 +3564,23 @@ async fn overflowing_int_errors_out(api: &mut dyn TestApi) -> crate::Result<()>

Ok(())
}

// TODO: Couldn't run this test on latest MySQL because of a compile error
// TODO: Once the compile error is fixed and we get back to latest MySQL,
// TODO: Uncomment me and make sure it returns `1` for mysql on a noop update
// async fn noop_update(api: &mut dyn TestApi) -> crate::Result<()> {
// let table = api.create_temp_table("id int4 name varchar(255)").await?;
//
// let insert = Insert::multi_into(&table, vec!["id", name])
// .values(vec![1, "Romulus"])
// .values(vec![2, "Remus"]);
//
// api.conn().query(insert.into()).await?;
//
// let update = Update::table(&table).set("name", "Romulus").so_that("id".equals(1));
// let changes = api.conn().execute(update.into()).await?;
//
// assert_eq!(1, changes);
//
// Ok(())
// }