collatedstring_normalization.slt 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # Copyright 2015 - 2019 The Cockroach Authors. All rights reserved.
  2. # Copyright Materialize, Inc. and contributors. All rights reserved.
  3. #
  4. # Use of this software is governed by the Business Source License
  5. # included in the LICENSE file at the root of this repository.
  6. #
  7. # As of the Change Date specified in that file, in accordance with
  8. # the Business Source License, use of this software will be governed
  9. # by the Apache License, Version 2.0.
  10. #
  11. # This file is derived from the logic test suite in CockroachDB. The
  12. # original file was retrieved on June 10, 2019 from:
  13. #
  14. # https://github.com/cockroachdb/cockroach/blob/d2f7fbf5dd1fc1a099bbad790a2e1f7c60a66cc3/pkg/sql/logictest/testdata/logic_test/collatedstring_normalization
  15. #
  16. # The original source code is subject to the terms of the Apache
  17. # 2.0 license, a copy of which can be found in the LICENSE file at the
  18. # root of this repository.
  19. # not supported yet
  20. halt
  21. mode cockroach
  22. statement ok
  23. CREATE TABLE t (
  24. a STRING COLLATE fr PRIMARY KEY
  25. )
  26. # Insert Amélie in NFD form.
  27. statement ok
  28. INSERT INTO t VALUES (b'Ame\xcc\x81lie' COLLATE fr)
  29. # Retrieve Amélie in NFC form.
  30. query T
  31. SELECT a FROM t WHERE a = (b'Am\xc3\xa9lie' COLLATE fr)
  32. ----
  33. Amélie
  34. statement ok
  35. DELETE FROM t
  36. # Insert Amélie in NFC form.
  37. statement ok
  38. INSERT INTO t VALUES (b'Am\xc3\xa9lie' COLLATE fr)
  39. # Retrieve Amélie in NFD form.
  40. query T
  41. SELECT a FROM t WHERE a = (b'Ame\xcc\x81lie' COLLATE fr)
  42. ----
  43. Amélie