uuid.slt 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. mode cockroach
  10. query T
  11. SELECT '63616665-6630-3064-6465-616462656568'::uuid
  12. ----
  13. 63616665-6630-3064-6465-616462656568
  14. query T
  15. SELECT '63616665-6630-3064-6465-616462656568'::uuid::text
  16. ----
  17. 63616665-6630-3064-6465-616462656568
  18. query T
  19. SELECT '63616665-6630-3064-6465-616462656568'::text::uuid
  20. ----
  21. 63616665-6630-3064-6465-616462656568
  22. query error invalid input syntax for type uuid
  23. SELECT 'Z3616665-6630-3064-6465-616462656568'::uuid
  24. query error does not support casting from uuid to bytea
  25. SELECT '63616665-6630-3064-6465-616462656568'::uuid::bytes
  26. query T
  27. SELECT '63616665-6630-3064-6465-616462656568'::uuid = '63616665-6630-3064-6465-616462656568'::uuid;
  28. ----
  29. true
  30. query T
  31. SELECT '63616665-6630-3064-6465-616462656568'::uuid = '86565626-4616-5646-4603-036656661636'::uuid;
  32. ----
  33. false
  34. query T
  35. SELECT '63616665-6630-3064-6465-616462656568'::uuid <> '86565626-4616-5646-4603-036656661636'::uuid;
  36. ----
  37. true
  38. query T
  39. SELECT '63616665-6630-3064-6465-616462656568'::uuid < '86565626-4616-5646-4603-036656661636'::uuid;
  40. ----
  41. true
  42. query T
  43. SELECT '63616665-6630-3064-6465-616462656568'::uuid > '86565626-4616-5646-4603-036656661636'::uuid;
  44. ----
  45. false
  46. query T
  47. SELECT '63616665-6630-3064-6465-616462656568'::uuid <= '86565626-4616-5646-4603-036656661636'::uuid;
  48. ----
  49. true
  50. query T
  51. SELECT '63616665-6630-3064-6465-616462656568'::uuid >= '86565626-4616-5646-4603-036656661636'::uuid;
  52. ----
  53. false
  54. query T
  55. select uuid_generate_v5('a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', 'foo')
  56. ----
  57. 1b849fbd-9d94-5320-bbfc-c743414612d5
  58. query T
  59. select uuid_generate_v5(NULL, 'foo')
  60. ----
  61. NULL
  62. query T
  63. select uuid_generate_v5('a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', NULL)
  64. ----
  65. NULL