mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-26 09:50:40 +00:00
chore: add more tests
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user