mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-05 21:02:58 +00:00
test: add a parameter type mismatch test case to sql integration test (#3568)
This commit is contained in:
@@ -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::<MySqlDatabaseError>()
|
||||
.code(),
|
||||
Some("22007")
|
||||
);
|
||||
|
||||
let _ = sqlx::query("delete from demo")
|
||||
.execute(&pool)
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user