| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- -- ============================================================
- -- Class drop 操作测试
- -- ============================================================
- -- 1. 创建临时 class 用于 drop 测试
- create class if not exists /test/aaa/test_drop (
- name varchar,
- value int,
- keys(name)
- ) with nickname='test_drop'
- ;
- -- 2. drop class 前插入数据验证
- insert into /test/aaa/test_drop (name, value) values ('before_drop', 100)
- ;
- select * from /test/aaa/test_drop where name='before_drop'
- /**
- output()
- **/
- ;
- -- 3. 删除数据后 drop class
- delete from /test/aaa/test_drop with version
- /**
- onerror(continue,'not exist','not find','not found')
- **/
- ;
- drop class if exists /test/aaa/test_drop
- ;
- -- 4. 验证已 drop 的 class(应报错)
- select * from /test/aaa/test_drop
- /**
- onerror(continue,'not exist','not find','not found')
- **/
- ;
- -- 5. 重复 drop 已删除的 class
- drop class if exists /test/aaa/test_drop
- ;
- -- 6. 删除不存在的 class
- drop class if exists /test/aaa/non_exist_drop
- ;
- -- 7. drop 带 alias 的 class
- create class if not exists /test/aaa/test_drop_alias (
- name varchar,
- keys(name)
- ) with nickname='drop_alias'
- ;
- drop class if exists /test/aaa/test_drop_alias
- ;
- -- 8. 批量创建和删除
- create class if not exists /test/aaa/test_batch_drop_1 (
- id int,
- keys(id)
- ) with nickname='test_batch_drop_1'
- ;
- create class if not exists /test/aaa/test_batch_drop_2 (
- id int,
- keys(id)
- ) with nickname='test_batch_drop_2'
- ;
- drop class if exists /test/aaa/test_batch_drop_1
- ;
- drop class if exists /test/aaa/test_batch_drop_2
- ;
|