Re: status_user.test fails in 5.3-based branches when ran with --ps-protocol
In particular, we'll get ROWS_INSERTED=4 without --ps-protocol (correct), and ROWS_INSERTED=8 with --ps-protocol (incorrect).
Investigation reveals that ROWS_INSERTED gets incremented twice:
- first time on COM_STMT_EXECUTE
- second time on COM_STMT_CLOSE:
Breakpoint 12, dispatch_command (command=COM_STMT_EXECUTE, thd=0xb8a7300, packet=0xb9598d9 "\002", packet_length=9) at sql_parse.cc:991
-
- ^^ This is the INSERT statement.
...
Breakpoint 10, update_global_user_stats_with_user (thd=0xb8a7300, user_stats=0xb93f768, now=1277408205) at sql_connect.cc:948
$204 = 0
Breakpoint 11, update_global_user_stats_with_user (thd=0xb8a7300, user_stats=0xb93f768, now=1277408205) at sql_connect.cc:954
$205 = 4
...
Breakpoint 12, dispatch_command (command=COM_STMT_CLOSE, thd=0xb8a7300, packet=0xb9598d9 "\002", packet_length=4) at sql_parse.cc:991
Breakpoint 10, update_global_user_stats_with_user (thd=0xb8a7300, user_stats=0xb93f768, now=1277408262) at sql_connect.cc:948
$208 = 4
(gdb) next
(gdb) next
(gdb) next
Breakpoint 11, update_global_user_stats_with_user (thd=0xb8a7300, user_stats=0xb93f768, now=1277408262) at sql_connect.cc:954
$209 = 8
Re: status_user.test fails in 5.3-based branches when ran with --ps-protocol
The failure looks like this: http://buildbot.askmonty.org/buildbot/builders/debian5-i386-fulltest/builds/387/steps/test_4/logs/stdio:
main.status_user w2 [ fail ]
Test ended at 2010-06-11 20:34:32
CURRENT_TEST: main.status_user
— /var/lib/buildbot/maria-slave/debian5-i386-fulltest/build/mysql-test/r/status_user.result 2010-06-11 18:27:08.000000000 -0400
+++ /var/lib/buildbot/maria-slave/debian5-i386-fulltest/build/mysql-test/r/status_user.reject 2010-06-11 20:34:32.000000000 -0400
@@ -133,14 +133,14 @@
ROLLBACK_TRANSACTIONS, DENIED_CONNECTIONS, LOST_CONNECTIONS,
ACCESS_DENIED, EMPTY_QUERIES from information_schema.client_statistics;
TOTAL_CONNECTIONS CONCURRENT_CONNECTIONS ROWS_READ ROWS_SENT ROWS_DELETED ROWS_INSERTED ROWS_UPDATED SELECT_COMMANDS UPDATE_COMMANDS OTHER_COMMANDS COMMIT_TRANSACTIONS ROLLBACK_TRANSACTIONS DENIED_CONNECTIONS LOST_CONNECTIONS ACCESS_DENIED EMPTY_QUERIES
-1 0 6 2 1 8 5 3 11 9 10 2 0 0 0 1
+1 0 11 2 1 12 10 1 2 9 10 2 0 0 0 1
select TOTAL_CONNECTIONS, CONCURRENT_CONNECTIONS, ROWS_READ, ROWS_SENT,
ROWS_DELETED, ROWS_INSERTED, ROWS_UPDATED, SELECT_COMMANDS,
UPDATE_COMMANDS, OTHER_COMMANDS, COMMIT_TRANSACTIONS,
ROLLBACK_TRANSACTIONS, DENIED_CONNECTIONS, LOST_CONNECTIONS,
ACCESS_DENIED, EMPTY_QUERIES from information_schema.user_statistics;
TOTAL_CONNECTIONS CONCURRENT_CONNECTIONS ROWS_READ ROWS_SENT ROWS_DELETED ROWS_INSERTED ROWS_UPDATED SELECT_COMMANDS UPDATE_COMMANDS OTHER_COMMANDS COMMIT_TRANSACTIONS ROLLBACK_TRANSACTIONS DENIED_CONNECTIONS LOST_CONNECTIONS ACCESS_DENIED EMPTY_QUERIES
-1 0 6 2 1 8 5 3 11 9 10 2 0 0 0 1
+1 0 11 2 1 12 10 1 2 9 10 2 0 0 0 1
flush table_statistics;
flush index_statistics;
select * from information_schema.index_statistics;
mysqltest: Result length mismatch