Skip to content
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

Readyset displays warnings after internal query #1425

Open
altmannmarcelo opened this issue Jan 24, 2025 · 1 comment
Open

Readyset displays warnings after internal query #1425

altmannmarcelo opened this issue Jan 24, 2025 · 1 comment
Labels
bug Something isn't working Low priority Created by Linear-GitHub Sync
Milestone

Comments

@altmannmarcelo
Copy link
Contributor

Description

MySQL has a diagnostic area, which is used to store error and warnings from previous commands. They can be retrieved with SHOW WARNINGS . If we execute a query that is proxied to upstream and produces an error or warning, the diagnostic area will be populated, it will only be cleaned in the next statement, however, if the client executes the next statement and the statement is a cached query, Readyset will be responsible for answering that query, if a subsequent SHOW WARNINGS is executed, it will be proxied to upstream and report the diagnostic area from the first statement:

readyset> SELECT some_error;
ERROR 1054 (42S22): Unknown column 'some_error' in 'field list'
readyset> EXPLAIN LAST STATEMENT;
+-------------------+----------------+
| Query_destination | ReadySet_error |
+-------------------+----------------+
| upstream          | ok             |
+-------------------+----------------+
1 row in set (0.00 sec)

readyset> SHOW WARNINGS;
+-------+------+---------------------------------------------+
| Level | Code | Message                                     |
+-------+------+---------------------------------------------+
| Error | 1054 | Unknown column 'some_error' in 'field list' |
+-------+------+---------------------------------------------+
1 row in set (0.00 sec)

readyset> SELECT COUNT(*) FROM dept_emp WHERE to_date = '2000-01-01';
+----------+
| count(*) |
+----------+
|       28 |
+----------+
1 row in set (0.00 sec)

readyset> EXPLAIN LAST STATEMENT;
+-------------------+----------------+
| Query_destination | ReadySet_error |
+-------------------+----------------+
| readyset          | ok             |
+-------------------+----------------+
1 row in set (0.00 sec)

readyset> SHOW WARNINGS;
+-------+------+---------------------------------------------+
| Level | Code | Message                                     |
+-------+------+---------------------------------------------+
| Error | 1054 | Unknown column 'some_error' in 'field list' |
+-------+------+---------------------------------------------+
1 row in set (0.00 sec)

Change in user-visible behavior

Requires documentation change

@altmannmarcelo
Copy link
Contributor Author

Originally raised by @ronaldbradford at #1424

@altmannmarcelo altmannmarcelo added the bug Something isn't working label Jan 24, 2025
@altmannmarcelo altmannmarcelo added this to the v.63 milestone Feb 6, 2025
@altmannmarcelo altmannmarcelo added High priority Created by Linear-GitHub Sync Medium priority Created by Linear-GitHub Sync Low priority Created by Linear-GitHub Sync and removed High priority Created by Linear-GitHub Sync Medium priority Created by Linear-GitHub Sync labels Feb 6, 2025
@altmannmarcelo altmannmarcelo modified the milestones: v.63, v.64, v.65 Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Low priority Created by Linear-GitHub Sync
Projects
None yet
Development

No branches or pull requests

1 participant