readysettech / readyset

Readyset is a MySQL and Postgres wire-compatible caching layer that sits in front of existing databases to speed up queries and horizontally scale read throughput. Under the hood, ReadySet caches the results of cached select statements and incrementally updates these results over time as the underlying data changes.
https://readyset.io
Other
4.55k stars 126 forks source link

MySQL Lookup BINARY fields not working #1259

Open altmannmarcelo opened 6 months ago

altmannmarcelo commented 6 months ago

Description

Lookup on fields of type Binary are not working properly:

CREATE TABLE t (ID INT PRIMARY KEY, b BINARY(1));
INSERT INTO t VALUES (1, 'A');
CREATE CACHE FROM SELECT COUNT(*) FROM t WHERE b = 'A';
SELECT count(*) FROM t3 WHERE b = 'A';
+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set (0.00 sec)

Internally, we are storing the data as 65 (A):

Key: [2, 1, 2], Value: [2, 1, 2, 3, 0, 1, 65]

And when asking for replay, we are asking for this correct key:

Handling packet: Packet::RequestReaderReplay([Equal([ByteArray([65])])])

PG Conector works fine.

Change in user-visible behavior

Requires documentation change