chore: add more tests

This commit is contained in:
Ning Sun
2026-03-18 18:29:04 +08:00
parent 4d62f94830
commit 3151c65f50
3 changed files with 29 additions and 1 deletions

View File

@@ -36,7 +36,7 @@ pub struct PartitionCount {
}
pub async fn count_partitions(db: &MySqlPool, datanode_id: u64) -> Result<PartitionCount> {
let sql = "select count(1) as count from information_schema.region_peers where peer_id == ?";
let sql = "select count(1) as count from information_schema.region_peers where peer_id = ?";
sqlx::query_as::<_, PartitionCount>(sql)
.bind(datanode_id)
.fetch_one(db)

View File

@@ -124,6 +124,25 @@ DEALLOCATE stmt;
affected_rows: 0
-- SQLNESS PROTOCOL MYSQL
PREPARE stmt FROM 'SELECT table_name, table_schema FROM information_schema.tables WHERE table_name = ?';
affected_rows: 0
-- SQLNESS PROTOCOL MYSQL
EXECUTE stmt USING 'cake';
+------------+--------------+
| table_name | table_schema |
+------------+--------------+
| cake | public |
+------------+--------------+
-- SQLNESS PROTOCOL MYSQL
DEALLOCATE stmt;
affected_rows: 0
-- SQLNESS PROTOCOL MYSQL
DROP TABLE cake;

View File

@@ -72,5 +72,14 @@ EXECUTE stmt USING 'happy', 42, 0;
-- SQLNESS PROTOCOL MYSQL
DEALLOCATE stmt;
-- SQLNESS PROTOCOL MYSQL
PREPARE stmt FROM 'SELECT table_name, table_schema FROM information_schema.tables WHERE table_name = ?';
-- SQLNESS PROTOCOL MYSQL
EXECUTE stmt USING 'cake';
-- SQLNESS PROTOCOL MYSQL
DEALLOCATE stmt;
-- SQLNESS PROTOCOL MYSQL
DROP TABLE cake;