Skip to content

Commit

Permalink
fix: correct sqlness test
Browse files Browse the repository at this point in the history
  • Loading branch information
WenyXu committed Jan 23, 2025
1 parent 34259a2 commit a667451
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 68 deletions.
61 changes: 3 additions & 58 deletions tests/cases/standalone/common/insert/logical_metric_table.result
Original file line number Diff line number Diff line change
Expand Up @@ -127,44 +127,11 @@ SELECT * from t2;
| job1 | 1970-01-01T00:00:00 | 0.0 |
+------+-------------------------+-----+

SELECT * from phy;

+-------------------------+-----+------------+----------------------+-------+------+
| ts | val | __table_id | __tsid | host | job |
+-------------------------+-----+------------+----------------------+-------+------+
| 1970-01-01T00:00:00.001 | 1.0 | 1028 | 1128149335081630826 | host2 | |
| 1970-01-01T00:00:00 | 0.0 | 1028 | 18067404594631612786 | host1 | |
| 1970-01-01T00:00:00.001 | 1.0 | 1029 | 2176048834144407834 | | job2 |
| 1970-01-01T00:00:00 | 0.0 | 1029 | 15980333303142110493 | | job1 |
+-------------------------+-----+------------+----------------------+-------+------+

ADMIN flush_table("phy");

Error: 1004(InvalidArguments), Failed to build admin function args: unsupported function arg "phy"

SELECT * from phy;

+-------------------------+-----+------------+----------------------+-------+------+
| ts | val | __table_id | __tsid | host | job |
+-------------------------+-----+------------+----------------------+-------+------+
| 1970-01-01T00:00:00.001 | 1.0 | 1028 | 1128149335081630826 | host2 | |
| 1970-01-01T00:00:00 | 0.0 | 1028 | 18067404594631612786 | host1 | |
| 1970-01-01T00:00:00.001 | 1.0 | 1029 | 2176048834144407834 | | job2 |
| 1970-01-01T00:00:00 | 0.0 | 1029 | 15980333303142110493 | | job1 |
+-------------------------+-----+------------+----------------------+-------+------+

-- SQLNESS ARG restart=true
SELECT * from phy;

+-------------------------+-----+------------+----------------------+-------+------+
| ts | val | __table_id | __tsid | host | job |
+-------------------------+-----+------------+----------------------+-------+------+
| 1970-01-01T00:00:00.001 | 1.0 | 1028 | 1128149335081630826 | host2 | |
| 1970-01-01T00:00:00 | 0.0 | 1028 | 18067404594631612786 | host1 | |
| 1970-01-01T00:00:00.001 | 1.0 | 1029 | 2176048834144407834 | | job2 |
| 1970-01-01T00:00:00 | 0.0 | 1029 | 15980333303142110493 | | job1 |
+-------------------------+-----+------------+----------------------+-------+------+

INSERT INTO t2 VALUES ('job3', 0, 0), ('job4', 1, 1);

Affected Rows: 2
Expand All @@ -189,18 +156,9 @@ SELECT * from t2;
| job1 | 1970-01-01T00:00:00 | 0.0 |
+------+-------------------------+-----+

SELECT * from phy;
DROP TABLE t1;

+-------------------------+-----+------------+----------------------+-------+------+
| ts | val | __table_id | __tsid | host | job |
+-------------------------+-----+------------+----------------------+-------+------+
| 1970-01-01T00:00:00.001 | 1.0 | 1028 | 1128149335081630826 | host2 | |
| 1970-01-01T00:00:00 | 0.0 | 1028 | 18067404594631612786 | host1 | |
| 1970-01-01T00:00:00.001 | 1.0 | 1029 | 2176048834144407834 | | job2 |
| 1970-01-01T00:00:00 | 0.0 | 1029 | 7680092648903808529 | | job3 |
| 1970-01-01T00:00:00.001 | 1.0 | 1029 | 13460702510118052283 | | job4 |
| 1970-01-01T00:00:00 | 0.0 | 1029 | 15980333303142110493 | | job1 |
+-------------------------+-----+------------+----------------------+-------+------+
Affected Rows: 0

DROP TABLE t2;

Expand All @@ -219,20 +177,7 @@ DESC TABLE phy;
| job | String | PRI | YES | | TAG |
+------------+----------------------+-----+------+---------+---------------+

SELECT ts, val, __tsid, host, job FROM phy;

+-------------------------+-----+----------------------+-------+------+
| ts | val | __tsid | host | job |
+-------------------------+-----+----------------------+-------+------+
| 1970-01-01T00:00:00.001 | 1.0 | 1128149335081630826 | host2 | |
| 1970-01-01T00:00:00 | 0.0 | 18067404594631612786 | host1 | |
| 1970-01-01T00:00:00.001 | 1.0 | 2176048834144407834 | | job2 |
| 1970-01-01T00:00:00 | 0.0 | 7680092648903808529 | | job3 |
| 1970-01-01T00:00:00.001 | 1.0 | 13460702510118052283 | | job4 |
| 1970-01-01T00:00:00 | 0.0 | 15980333303142110493 | | job1 |
+-------------------------+-----+----------------------+-------+------+

DROP TABLE phy;

Error: 1004(InvalidArguments), Physical region 4410931412992(1027, 0) is busy, there are still some logical regions using it
Affected Rows: 0

12 changes: 2 additions & 10 deletions tests/cases/standalone/common/insert/logical_metric_table.sql
Original file line number Diff line number Diff line change
Expand Up @@ -47,27 +47,19 @@ INSERT INTO t2 VALUES ('job1', 0, 0), ('job2', 1, 1);

SELECT * from t2;

SELECT * from phy;

ADMIN flush_table("phy");

SELECT * from phy;

-- SQLNESS ARG restart=true
SELECT * from phy;

INSERT INTO t2 VALUES ('job3', 0, 0), ('job4', 1, 1);

SELECT * from t1;

SELECT * from t2;

SELECT * from phy;
DROP TABLE t1;

DROP TABLE t2;

DESC TABLE phy;

SELECT ts, val, __tsid, host, job FROM phy;

DROP TABLE phy;
DROP TABLE phy;

0 comments on commit a667451

Please sign in to comment.