Open
Description
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