Merge branch 'fetch-one-hang' of https://github.com/Freax13/sqlx into Freax13-fetch-one-hang

This commit is contained in:
Ryan Leckey 2020-03-20 20:10:02 -07:00
commit 476b9308f2

View File

@ -210,3 +210,21 @@ async fn pool_smoke_test() -> anyhow::Result<()> {
Ok(())
}
#[cfg_attr(feature = "runtime-async-std", async_std::test)]
#[cfg_attr(feature = "runtime-tokio", tokio::test)]
async fn test_fetch_one_and_ping() -> anyhow::Result<()> {
let mut conn = new::<MySql>().await?;
let (_id,): (i32,) = sqlx::query_as("SELECT 1 as id")
.fetch_one(&mut conn)
.await?;
conn.ping().await?;
let (_id,): (i32,) = sqlx::query_as("SELECT 1 as id")
.fetch_one(&mut conn)
.await?;
Ok(())
}