Skip to content

Compare string with collating in array tuple via binary protocol #133141

Closed
@zhixinwen

Description

@zhixinwen

Discussed in #132867

Originally posted by zhixinwen October 17, 2024
Related question to #117849, but with binary protocol.

I have a table:

   CREATE TABLE test_collate (
                id INT8 PRIMARY KEY,
                "string_field" STRING COLLATE en_US_u_ks_level2 NULL,
            )

And this would work in console

root@localhost:26257/defaultdb> PREPARE pselect3 AS SELECT * FROM "test_collate" WHERE (("id", "string_field")) = ANY($1);
PREPARE

Time: 2ms total (execution 1ms / network 1ms)

root@localhost:26257/defaultdb> EXECUTE pselect3(Array[(1, 'str_collate_1')]);
  id | string_field
-----+----------------
   1 | str_collate_1
(1 row)

However if I send the args in binary format, I will receive:

unsupported comparison: collatedstring{en_us_u_ks_level2} to string"

I write the binary encoding for tuple array myself, and uses oid 25 for collated string. It works for all other cases except collated string. Did I miss anything?

Jira issue: CRDB-43466

Metadata

Metadata

Assignees

Labels

O-communityOriginated from the communityO-supportWould prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docsP-3Issues/test failures with no fix SLAT-sql-queriesSQL Queries Teambranch-release-23.2Used to mark GA and release blockers, technical advisories, and bugs for 23.2branch-release-24.1Used to mark GA and release blockers, technical advisories, and bugs for 24.1branch-release-24.2Used to mark GA and release blockers, technical advisories, and bugs for 24.2branch-release-24.3Used to mark GA and release blockers, technical advisories, and bugs for 24.3

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions