Server IP : 104.21.38.3 / Your IP : 172.68.164.168 Web Server : Apache System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /www/server/mysql/src/mysql-test/suite/binlog/t/ |
Upload File : |
# ==== Purpose ==== # # Verify that a partially failed 'GRANT' statement does not save its gtid # into @@GLOBAL.GTID_EXECUTED and is not binlogged when binlog is enabled. # # ==== Implementation ==== # # 1) Execute a partially failed 'GRANT' statement. # 2) Verify that the partially failed statement does not save its gtid # into @@GLOBAL.GTID_EXECUTED, since it is not binlogged when binlog # is enabled. # 3) Execute above two steps for all different types of statements. # # ==== References ==== # # Bug#21686749 PARTIALLY FAILED DROP OR ACL STMT FAILS TO CONSUME GTID ON BINLOGLESS SLAVE # See mysql-test/t/no_binlog_gtid_next_partially_failed_stmts.test # See mysql-test/t/no_binlog_gtid_next_partially_failed_stmts_error.test # See mysql-test/suite/binlog/t/binlog_gtid_next_partially_failed_stmts.test # See mysql-test/t/no_binlog_gtid_next_partially_failed_stmts_anonymous.test # # Test in this file is binlog format agnostic, thus no need # to rerun it for every format. --source include/have_binlog_format_row.inc --source include/have_gtid.inc # Make sure the test is repeatable RESET MASTER; call mtr.add_suppression("REVOKE/GRANT failed while storing table level and column level grants in the privilege tables. An incident event has been written to the binary log which will stop the slaves."); --let $master_uuid= `SELECT @@GLOBAL.SERVER_UUID` CREATE TABLE t1(a INT, b INT); CREATE USER u1@h; --echo # --echo # Verify that u1 is added into mysql.user. --echo # SELECT user FROM mysql.user WHERE user='u1'; --let $saved_master_pos=query_get_value('SHOW MASTER STATUS', Position, 1) --error ER_PASSWORD_NO_MATCH GRANT SELECT(a) ON t1 TO u1@h, u2@h; --echo # --echo # The SELECT privilege on column a is granted to u1@h, --echo # which means that GRANT can be failed partially when --echo # granting an available privilege to both an existent --echo # user and a non-existent user. --echo # SELECT user, column_name, column_priv FROM mysql.columns_priv; --echo # --echo # Verify that the partially failed GRANT statement is not binlogged, --echo # and it causes to log an incident event with an unique gtid, which --echo # is saved into @@GLOBAL.GTID_EXECUTED. --echo # --let $keep_gtid_events= 1 --let $binlog_start= $saved_master_pos --source include/show_binlog_events.inc --replace_result $master_uuid MASTER_UUID --let $assert_text= Generate MASTER_UUID:4 for the incident event and commit it into @@GLOBAL.GTID_EXECUTED --let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$master_uuid:1-4" --source include/assert.inc # The incident event cteated by GRANT statement will cause a failure when # calling show_binlog_events.inc again. That is the reason we put the # GRANT statement in an independent test file. You can see the error when # executing the following three lines. #--let $saved_master_pos=query_get_value('SHOW MASTER STATUS', Position, 1) #--let $binlog_start= $saved_master_pos #--source include/show_binlog_events.inc DROP USER u1@h; DROP TABLE t1;