12valid.mql 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. -- ============================================================
  2. -- 跨命名空间操作验证测试
  3. -- ============================================================
  4. -- 1. 跨命名空间查询
  5. select * from /test/bbb/test_cross where x_name='cross_001'
  6. /**
  7. output()
  8. match("x_value","100")
  9. **/
  10. ;
  11. -- 2. 跨命名空间插入
  12. insert into /test/bbb/test_cross (x_name, x_value) values ('cross_from_aaa', 999)
  13. ;
  14. select * from /test/bbb/test_cross where x_name='cross_from_aaa'
  15. /**
  16. output()
  17. match("x_value","999")
  18. **/
  19. ;
  20. -- 3. 跨命名空间更新
  21. update /test/bbb/test_cross set x_value=555 where x_name='cross_001'
  22. ;
  23. select x_value from /test/bbb/test_cross where x_name='cross_001'
  24. /**
  25. output()
  26. match("x_value","555")
  27. **/
  28. ;
  29. -- 4. 跨命名空间删除
  30. delete from /test/ccc/test_cross_another
  31. /**
  32. onerror(continue,'not exist','not find','not found')
  33. **/
  34. ;
  35. drop class if exists /test/ccc/test_cross_another
  36. ;
  37. -- 5. 验证不存在的跨命名空间 class
  38. select * from /test/bbb/non_exist_cross
  39. /**
  40. onerror(continue,'not exist','not find','not found')
  41. **/
  42. ;