3077 Jon Olav Hauglid 2010-07-07
Bug #37521 Row inserted through view not always visible in base
table immediately after
The problem was that rows inserted in a table by one connection was
not immediately visible if another connection queried the table,
even if the insert had committed.
The reason for the problem was that the server sent a status reply
to the client before it actually did the commit. Therefore it was
possible to get an OK from the server before the changes were made
permanent and visible to other connections.
This patch fixes the problem by not sending status messages to the
server until any changes made have been committed. No test case added
as reproducing the error requires very specific timing betweeen the
server and two or more clients.
This patch also fixes the following (duplicate) bugs:
Bug #29334 pseudo-finished SHOW GLOBAL STATUS
Bug #36618 myisam insert not immediately visible to select from another client
Bug #45864 insert on one connection, immediate query on another produces no result
Bug #51329 Inserts from one connection not immediately visible in second
connection
Bug #41516 Assertion fails when error returned from
handler::external_lock(thd, F_UNLCK)
modified:
sql/sql_parse.cc
3076 Jon Olav Hauglid 2010-07-05
Bug #54401 assert in Diagnostics_area::set_eof_status , HANDLER
This assert checks that the server does not try to send EOF to the
client if there has been some error during processing. This to make
sure that the error is in fact sent to the client.
The problem was that any errors during processing of WHERE conditions
in HANDLER ... READ statements where not detected by the handler code.
The handler code therefore still tried to send EOF to the client,
triggering the assert. The bug was only noticeable in debug builds.
This patch fixes the problem by making sure that the handler code
checks for errors during condition processing and acts accordingly.
modified:
mysql-test/include/handler.inc
mysql-test/r/handler_innodb.result
mysql-test/r/handler_myisam.result
sql/sql_handler.cc
=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc 2010-07-01 13:53:46 +0000
+++ b/sql/sql_parse.cc 2010-07-07 13:20:07 +0000
@@ -1511,13 +1511,13 @@ bool dispatch_command(enum enum_server_c
thd->transaction.stmt.reset();
- thd->protocol->end_statement();
- query_cache_end_of_result(thd);
-
thd->proc_info= "closing tables";
/* Free tables */
close_thread_tables(thd);
+ thd->protocol->end_statement();
+ query_cache_end_of_result(thd);
+
if (!thd->is_error() && !thd->killed_errno())
mysql_audit_general(thd, MYSQL_AUDIT_GENERAL_RESULT, 0, 0);
Attachment: [text/bzr-bundle] bzr/jon.hauglid@oracle.com-20100707132007-v38p0em5tdqwtj2v.bundle
| Thread |
|---|
| • bzr push into mysql-trunk-runtime branch (jon.hauglid:3076 to 3077) Bug#37521 | Jon Olav Hauglid | 7 Jul |