30-OldPyCases¶
¶
OldPy: at once
test replace the at once in old cases with the count(1) window function
¶
OldPy: back quote
test back quote check
¶
OldPy: checkpoint
1. create snode
2. create stream and restart stream
3. drop snode
4. alter db replica
5. balance vgropu leader
6. drop stream
7. redistribute vgroup
8. drop snode
9. drop dnode
10. check checkpoint file
¶
OldPy: drop operations
Test drop operations on tables with special characters and batch drop operations:
1. Test [Normal Table Drop] Operations
1.1 Create and drop normal table with timestamp column
1.1.1 Create table with 20 child tables using super table
1.1.2 Insert 10 rows per child table
1.1.3 Query and verify data by timestamp column
1.1.4 Drop each child table individually
1.2 Test drop with flush database operations
1.2.1 Recreate child tables after drop
1.2.2 Insert data again and query
1.2.3 Verify data consistency after flush
1.2.4 Drop super table and recreate
2. Test [Special Character Table Names] Drop Operations
2.1 Create databases and tables with special names
2.1.1 Create databases: dbtest_0, dbtest_1 with vgroups 4
2.1.2 Create super table with Unicode name: aa¿stb0
2.1.3 Create child tables with special names: aa¿ctb0, aa¿ctb1
2.1.4 Create normal tables with special names: aa¿ntb0, aa¿ntb1
2.2 Test drop operations with special character handling
2.2.1 Insert data into tables with special names
2.2.2 Query data using backticks for table names
2.2.3 Drop tables with special character names
2.2.4 Clean up databases after testing
3. Test [Batch Drop Operations] with Super Tables
3.1 Query information_schema.ins_stables for batch operations
3.1.1 Find stable information across test databases
3.1.2 Verify stable count equals 2 (one per database)
3.1.3 Extract database and stable names for batch operations
3.2 Test batch drop with error scenarios
3.2.1 Test "drop table with" invalid table names (should error)
3.2.2 Test "drop stable with" non-existent tables (should error)
3.2.3 Test "drop stable with" space-containing names (should error)
3.2.4 Verify error message: "Cannot drop super table in batch"
4. Test [Error Handling] for Drop Operations
4.1 Test error messages for invalid drop operations
4.1.1 "Table does not exist" for invalid table drop
4.1.2 "STable not exist" for invalid stable drop
4.1.3 "Cannot drop super table in batch" for batch stable drop
4.2 Repeat error tests multiple times
4.2.1 Execute each error scenario 5 times
4.2.2 Verify consistent error handling
4.2.3 Check error message consistency
4.2.4 Validate connection stability after errors
¶
OldPy: empty identifier validation
Test empty identifier `` handling in 28 specific SQL statements and verify error code -2147473897:
1. Test [Table Operations] with Empty Identifiers
1.1 show create table `` - verify error -2147473897
1.2 show create table test.`` - verify error -2147473897
1.3 create table `` (ts timestamp, c1 int) - verify error -2147473897
1.4 drop table `` - verify error -2147473897
1.5 alter table `` add column c2 int - verify error -2147473897
1.6 select * from `` - verify error -2147473897
2. Test [Column and Tag Operations] with Empty Identifiers
2.1 alter table meters add column `` int - verify error -2147473897
2.2 alter table meters drop column `` - verify error -2147473897
2.3 alter stable meters add tag `` int - verify error -2147473897
2.4 alter stable meters rename tag cc `` - verify error -2147473897
2.5 alter stable meters drop tag `` - verify error -2147473897
3. Test [Data Manipulation] with Empty Identifiers
3.1 insert into `` select * from t0 - verify error -2147473897
3.2 insert into t100 using `` tags('', '') values(1,1,1) - verify error -2147473897
3.3 insert into `` values(1,1,1) - verify error -2147473897
4. Test [View Operations] with Empty Identifiers
4.1 create view `` as select count(*) from meters interval(10s) - verify error -2147473897
4.2 create view ``.view1 as select count(*) from meters - verify error -2147473897
4.3 drop view `` - verify error -2147473897
4.4 drop view ``.st1 - verify error -2147473897
5. Test [TSMA Operations] with Empty Identifiers
5.1 create tsma `` on meters function(count(c1)) interval(1m) - verify error -2147473897
5.2 create tsma tsma1 on `` function(count(c1)) interval(1m) - verify error -2147473897
6. Test [Stream Operations] with Empty Identifiers
6.1 create stream `` interval(10s) sliding(10s) from meters into st1 as select count(*) from meters - verify error -2147473897
6.2 create stream stream1 interval(10s) sliding(10s) from meters into `` as select count(*) from meters - verify error -2147473897
6.3 create stream stream1 interval(10s) sliding(10s) from meters into st1 as select count(*) from `` - verify error -2147473897
6.4 create stream stream1 interval(10s) sliding(10s) from meters stream_options(max_delay(100s)) into st1 as select count(*) from `` - verify error -2147473897
6.5 create stream stream1 interval(10s) sliding(10s) from `` stream_options(max_delay(100s)) into st1 as select count(*) from meters - verify error -2147473897
7. Test [Topic Operations] with Empty Identifiers
7.1 create topic `` as select count(*) from meters interval(10s) - verify error -2147473897
7.2 drop topic `` - verify error -2147473897
8. Test [Error Code Verification] for All Cases
8.1 Execute all 28 SQL statements with empty identifiers
8.2 Verify each returns exact error code -2147473897
8.3 Confirm error message consistency
8.4 Validate connection stability after errors
¶
OldPy: force window close
interval + sliding simulates the force window close trigger model.
¶
OldPy: partitionby
老用例 tests/system-test/8-stream/partition_interval.py
老的建流语句
CREATE STREAM xxx INTO xxx AS SELECT _wstart,count(val) FROM stb PARTITION BY tbname INTERVAL(10s)
新的建流语句
CREATE STREAM xxx INTERVAL(10s) SLIDING(10s) FROM stb PARTITON BY tbname INTO xxx AS SELECT _tcurrent_ts as ts,count(val) FROM %%trows;
¶
OldPy: math function
旧用例 tests/system-test/8-stream/scalar_function.py
测试在流计算中使用数学函数
旧的建流语句:
create stream XXX trigger at_once ignore expired 0 ignore update 0 fill_history 1 into XXX as select ts, log(c1, 2), log(c2, 2), c3 from scalar_tb
新的建流语句:
CREATE STREAM XXX SLIDING(10s) FROM tb INTO XXX AS SELECT ts, log(val, 2) as val FROM %%trows;
¶
OldPy: sliding
老用例 tests/system-test/8-stream/partition_interval.py
老的建流语句
CREATE STREAM xxx INTO xxx AS SELECT _wstart,count(val) FROM stb PARTITION BY tbname INTERVAL(10s)
新的建流语句
CREATE STREAM xxx SLINDING(10s) FROM stb PARTITON BY tbname INTO xxx AS SELECT _tcurrent_ts as ts,count(val) FROM %%trows;
¶
OldPy: snode
1. -
¶
OldPy: state window
迁移自老用例: tests/system-test/8-stream/state_window_case.py
¶
OldPy: basic test 1
1. test stream basic
¶
OldPy: aggregation func
1. test_Stream_Multi_Agg
¶
OldPy: string function
旧用例 tests/system-test/8-stream/scalar_function.py
测试在流计算中使用字符串函数
旧的建流语句:
create stream XXX trigger at_once ignore expired 0 ignore update 0 fill_history 1 into XXX as select ts, char_length(c3) from scalar_tb
新的建流语句:
CREATE STREAM XXX SLIDING(10s) FROM tb INTO XXX AS SELECT ts, char_length(val) as val FROM %%trows;
¶
OldPy: shell create stream
test taosd shell command