Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-2450

LP:597742 - status_user.test fails in 5.3-based branches when ran with --ps-protocol

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Not a Bug
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      status_user.test fails in 5.3-based branches when one runs the test with --ps-protocol.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            psergey Sergei Petrunia added a comment -

            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

            Show
            psergey Sergei Petrunia added a comment - 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
            Hide
            psergey Sergei Petrunia added a comment -

            Re: status_user.test fails in 5.3-based branches when ran with --ps-protocol
            The problem doesn't occur on 5.2

            Show
            psergey Sergei Petrunia added a comment - Re: status_user.test fails in 5.3-based branches when ran with --ps-protocol The problem doesn't occur on 5.2
            Hide
            psergey Sergei Petrunia added a comment -

            Re: status_user.test fails in 5.3-based branches when ran with --ps-protocol
            I've narrowed it down to a smaller testcase:

            cat > t/_a.test << EOF
            --disable_warnings
            DROP TABLE IF EXISTS t1;
            --enable_warnings

            1. Disable logging to get right number of writes into the tables.
              set @save_general_log=@@global.general_log;
              set @@global.general_log=0;
              set @@global.userstat=1;
              flush status;

            create table t1 (a int, primary key (a), b int default 0) engine=myisam;
            insert into t1 (a) values (1),(2),(3),(4);
            update t1 set b=1;
            #update t1 set b=5 where a=2;
            #delete from t1 where a=3;

            /* Empty query */
            select * from t1 where a=999;

            drop table t1;

            select sleep(1);

            1. Ensure that the following commands doesn't change statistics

            set @@global.userstat=0;

            #

            1. Check that we got right statistics
              #
              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.client_statistics;

            EOF

            The last query will produce different results depending on whether the testcase was run with --ps-protocol or not.

            Show
            psergey Sergei Petrunia added a comment - Re: status_user.test fails in 5.3-based branches when ran with --ps-protocol I've narrowed it down to a smaller testcase: cat > t/_a.test << EOF --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings Disable logging to get right number of writes into the tables. set @save_general_log=@@global.general_log; set @@global.general_log=0; set @@global.userstat=1; flush status; create table t1 (a int, primary key (a), b int default 0) engine=myisam; insert into t1 (a) values (1),(2),(3),(4); update t1 set b=1; #update t1 set b=5 where a=2; #delete from t1 where a=3; /* Empty query */ select * from t1 where a=999; drop table t1; select sleep(1); Ensure that the following commands doesn't change statistics set @@global.userstat=0; # Check that we got right statistics # 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.client_statistics; EOF The last query will produce different results depending on whether the testcase was run with --ps-protocol or not.
            Hide
            psergey Sergei Petrunia added a comment -

            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

              1. ^^ 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

            Show
            psergey Sergei Petrunia added a comment - 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
            Hide
            psergey Sergei Petrunia added a comment -

            Re: status_user.test fails in 5.3-based branches when ran with --ps-protocol
            5.2's userstat code is different, it seems this particular failure was in 5.2 and was fixed by this change:

            Revision Id: sergii@pisem.net-20100316123835-rqwdtntbiaj70ui8
            Committer: Sergei Golubchik <sergii@pisem.net>
            Branch nick: 5.2
            Timestamp: Tue 2010-03-16 13:38:35 +0100
            fixes for the status_user.test in ps protocol

            We need to merge from 5.2 to get this fix.

            Show
            psergey Sergei Petrunia added a comment - Re: status_user.test fails in 5.3-based branches when ran with --ps-protocol 5.2's userstat code is different, it seems this particular failure was in 5.2 and was fixed by this change: Revision Id: sergii@pisem.net-20100316123835-rqwdtntbiaj70ui8 Committer: Sergei Golubchik <sergii@pisem.net> Branch nick: 5.2 Timestamp: Tue 2010-03-16 13:38:35 +0100 fixes for the status_user.test in ps protocol We need to merge from 5.2 to get this fix.
            Hide
            psergey Sergei Petrunia added a comment -

            Re: status_user.test fails in 5.3-based branches when ran with --ps-protocol
            Doesn't fail any more after 5.2 -> 5.3 merge

            Show
            psergey Sergei Petrunia added a comment - Re: status_user.test fails in 5.3-based branches when ran with --ps-protocol Doesn't fail any more after 5.2 -> 5.3 merge
            Hide
            ratzpo Rasmus Johansson added a comment -

            Launchpad bug id: 597742

            Show
            ratzpo Rasmus Johansson added a comment - Launchpad bug id: 597742

              People

              • Assignee:
                psergey Sergei Petrunia
                Reporter:
                psergey Sergei Petrunia
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: