8000 Bug Report: MySQL incompatibility w/aggregators in v15+ · Issue #18182 · vitessio/vitess · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Bug Report: MySQL incompatibility w/aggregators in v15+ #18182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
timvaillancourt opened this issue Apr 18, 2025 · 1 comment
Open

Bug Report: MySQL incompatibility w/aggregators in v15+ #18182

timvaillancourt opened this issue Apr 18, 2025 · 1 comment

Comments

@timvaillancourt
Copy link
Contributor
timvaillancourt commented Apr 18, 2025

Overview of the Issue

👋 when Slack migrated from v14 -> v15 we noticed a breakage in query responses: aggregators, for example COUNT(*) are returned always as lower-case count(*). This behaviour deviates from the MySQL server, which maintains the provided case (like <= v14) of aggregator "names"

This query breakage started when we upgraded vttablets, the first step in our v14->v15 upgrade. This should mean the change is in the vttablet-side of sql parser

For some languages/drivers (in our case Hacklang), this means that gathering the response-value by name, example: COUNT(*) returns no value, because the map/dictionary key became lowercase count(*) - a different map/dict key entirely

Example on v14 (the case we provided is == in response):

> select MIN(k) from sbtest1;
+--------+
| MIN(k) |
+--------+
| 170    |
+--------+
1 row in set

Example on v15+ (inconsistent case):

> select MIN(k) from sbtest1;
+--------+
| min(k) |
+--------+
| 183    |
+--------+
1 row in set

And on MySQL 8.x, we see MySQL has the pre-v15 behaviour:

> select MIN(k) from sbtest1;
+--------+
| MIN(k) |
+--------+
|    183 |
+--------+
1 row in set (0.00 sec)

> select @@version;
+-----------+
| @@version |
+-----------+
| 8.0.36-28 |
+-----------+
1 row in set (0.00 sec)

We believe this incompatibility was introduced by this PR: #10507 (#10347 may also be related), which removed the Names field that gave the parser context of what the client "named" the column. My gut feel is the only way to restore the MySQL compatibility here is to undo this change 🤔

Reproduction Steps

  1. Launch a Vitess cluster
  2. CREATE TABLE sbtest1 (k bigint)
  3. INSERT INTO sbtest1 (k) VALUES(183)
  4. SELECT MIN(k) FROM sbtest1
  5. Observe that MIN(k) is returned in lower-case, breaking MySQL compatibility

Binary Version

All versions >= v15

Operating System and Environment details

Linux

Log Fragments

@timvaillancourt timvaillancourt added Needs Triage This issue needs to be correctly labelled and triaged Type: Bug Type: Regression Component: VTGate Type: Compatibility Bug Component: VTTablet and removed Needs Triage This issue needs to be correctly labelled and triaged Component: VTGate labels Apr 18, 2025
@timvaillancourt
Copy link
Contributor Author

My recollection is this started when we upgraded vttablet, so removing vtgate label

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant
0