diff --git a/tests-integration/tests/sql.rs b/tests-integration/tests/sql.rs index 5b9e1e2f35f3..7cff590c39eb 100644 --- a/tests-integration/tests/sql.rs +++ b/tests-integration/tests/sql.rs @@ -197,6 +197,23 @@ pub async fn test_mysql_crud(store_type: StorageType) { assert_eq!(ret, 6); } + // parameter type mismatch + let query_re = sqlx::query("select i from demo where i = ?") + .bind("test") + .fetch_all(&pool) + .await; + assert!(query_re.is_err()); + assert_eq!( + query_re + .err() + .unwrap() + .into_database_error() + .unwrap() + .downcast::() + .code(), + Some("22007") + ); + let _ = sqlx::query("delete from demo") .execute(&pool) .await