12float.mql 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. -- ============================================================
  2. -- float 类型搜索测试
  3. -- ============================================================
  4. -- 1. 等值搜索 float
  5. select * from /test/aaa/test_search where s_float=10.5
  6. /**
  7. output()
  8. count(1)
  9. match("s_name","search_int_001")
  10. **/
  11. ;
  12. -- 2. 大于搜索 float
  13. select * from /test/aaa/test_search where s_float>30.0
  14. /**
  15. output()
  16. match("search_int_004")
  17. match("search_int_005")
  18. **/
  19. ;
  20. -- 3. 小于搜索 float
  21. select * from /test/aaa/test_search where s_float<1.0
  22. /**
  23. output()
  24. match("search_string_001")
  25. match("search_string_002")
  26. match("search_string_003")
  27. **/
  28. ;
  29. -- 4. 区间搜索 float
  30. select * from /test/aaa/test_search where s_float>=10.0 and s_float<=60.0
  31. /**
  32. output()
  33. **/
  34. ;
  35. -- 5. double 类型搜索
  36. select * from /test/aaa/test_search where s_double=10.555
  37. /**
  38. output()
  39. count(1)
  40. **/
  41. ;
  42. -- 6. 搜索不存在的 float 值
  43. select * from /test/aaa/test_search where s_float=99999.99
  44. /**
  45. output()
  46. count(0)
  47. **/
  48. ;
  49. -- 7. 搜索浮点范围的边界值
  50. select * from /test/aaa/test_search where s_double<1.0
  51. /**
  52. output()
  53. **/
  54. ;