[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.128.168.219: ~ $
# ==== Purpose ====
#
# Test errors/restrictions/conditions for the following variables:
#
#  - GTID_EXECUTED
#     - readable, read-only, both session and global
#  - GTID_PURGED
#     - readable, read-only, global only
#  - GTID_OWNED
#     - readable, read-only, both session and global
#  - GTID_NEXT
#     - read-writable, session only
#     - must be set to UUID:NUMBER or AUTOMATIC (when gtid_mode=ON)
#     - only settable by SUPER
#     - not settable from sub-statement
#     - not settable from statement that also invokes sub-statement
#     - not settable inside transaction
#     - not settable when some gtid is owned
#
# Note: some variables related to GTIDs are tested in other files:
#   GTID_MODE - rpl_gtid_mode.test
#   ENFORCE_GTID_CONSISTENCY - binlog_enforce_gtid_consistency.test
#   GTID_PURGED - rpl_gtid_purged_*.test
#
# ==== Implementation ====
#
# Just try all possibilities, verify that the correct error message is
# given.
#
# ==== References ====
#
# Implemented in WL#3584: Global Transaction Identifiers

--source include/have_innodb.inc
--source include/have_log_bin.inc
--source include/have_gtid.inc
--source include/have_debug.inc

--let $ida= aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
--let $idb= bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb
--let $idc= cccccccc-cccc-cccc-cccc-cccccccccccc
--let $idd= dddddddd-dddd-dddd-dddd-dddddddddddd
--let $ide= eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee
--let $idf= ffffffff-ffff-ffff-ffff-ffffffffffff
--let $tab= `SELECT '\t'`

--echo ==== Conditions for gtid_execute ====

--echo # Readable.
SELECT @@GLOBAL.GTID_EXECUTED;
SELECT @@SESSION.GTID_EXECUTED;
--echo # Read-only.
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
eval SET @@GLOBAL.GTID_EXECUTED= '$ida:1';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
eval SET @@SESSION.GTID_EXECUTED= '$ida:2';

--echo ==== Conditions for gtid_purged ====

--echo # Readable global variable
SELECT @@GLOBAL.GTID_PURGED;
--echo # Not a session variable
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@SESSION.GTID_PURGED;
--echo # Read-only.
--error ER_GLOBAL_VARIABLE
eval SET @@SESSION.GTID_PURGED= '$ida:3';

--echo ==== Conditions for gtid_owned ====

--echo # Readable.
SELECT @@GLOBAL.GTID_OWNED;
SELECT @@SESSION.GTID_OWNED;
--echo # Read-only.
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
eval SET @@SESSION.GTID_OWNED= '$ida:5';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
eval SET @@GLOBAL.GTID_OWNED= '$ida:6#1';

--echo ==== Valid and invalid values for gtid_next ====

--echo # Default should be AUTOMATIC
SELECT @@SESSION.GTID_NEXT;

SET @@SESSION.GTID_NEXT= 'AUTOMATIC';
SELECT @@SESSION.GTID_NEXT;

eval SET @@SESSION.GTID_NEXT= '$ida:10';
SELECT @@SESSION.GTID_NEXT;
ROLLBACK;

eval SET @@SESSION.GTID_NEXT= '
    $ida $tab : $tab 10
    ';
SELECT @@SESSION.GTID_NEXT;
ROLLBACK;

eval SET @@SESSION.GTID_NEXT= '$ida:0x10';
SELECT @@SESSION.GTID_NEXT;
ROLLBACK;

eval SET @@SESSION.GTID_NEXT= '$ida:010';
SELECT @@SESSION.GTID_NEXT;
ROLLBACK;

SET @@SESSION.GTID_NEXT= 'AUTOMATIC';

--error ER_WRONG_VALUE_FOR_VAR
eval SET @@SESSION.GTID_NEXT= '$ida:10#';
SELECT @@SESSION.GTID_NEXT;

--error ER_WRONG_VALUE_FOR_VAR
eval SET @@SESSION.GTID_NEXT= '$ida:1-10';
SELECT @@SESSION.GTID_NEXT;

--error ER_WRONG_VALUE_FOR_VAR
eval SET @@SESSION.GTID_NEXT= '$ida:1:3';
SELECT @@SESSION.GTID_NEXT;

--error ER_WRONG_VALUE_FOR_VAR
eval SET @@SESSION.GTID_NEXT= '$ida:1,$ida:3';
SELECT @@SESSION.GTID_NEXT;

--error ER_WRONG_VALUE_FOR_VAR
SET @@SESSION.GTID_NEXT= NULL;
SELECT @@SESSION.GTID_NEXT;

--error ER_WRONG_TYPE_FOR_VAR
SET @@SESSION.GTID_NEXT= 10;
SELECT @@SESSION.GTID_NEXT;

--error ER_WRONG_VALUE_FOR_VAR
SET @@SESSION.GTID_NEXT= '10';
SELECT @@SESSION.GTID_NEXT;

--error ER_WRONG_VALUE_FOR_VAR
eval SET @@SESSION.GTID_NEXT= '$ida:';
SELECT @@SESSION.GTID_NEXT;

--error ER_WRONG_VALUE_FOR_VAR
eval SET @@SESSION.GTID_NEXT= '$ida:0';
SELECT @@SESSION.GTID_NEXT;

--error ER_WRONG_VALUE_FOR_VAR
eval SET @@SESSION.GTID_NEXT= '$ida:0x8000000000000000';
SELECT @@SESSION.GTID_NEXT;

--error ER_WRONG_VALUE_FOR_VAR
eval SET @@SESSION.GTID_NEXT= '$ida:-33';
SELECT @@SESSION.GTID_NEXT;

--error ER_WRONG_VALUE_FOR_VAR
eval SET @@SESSION.GTID_NEXT= '$ida:66-33';
SELECT @@SESSION.GTID_NEXT;

--error ER_WRONG_VALUE_FOR_VAR
eval SET @@SESSION.GTID_NEXT= '$ida:33 33';
SELECT @@SESSION.GTID_NEXT;

--error ER_WRONG_VALUE_FOR_VAR
eval SET @@SESSION.GTID_NEXT= '$ida-33';
SELECT @@SESSION.GTID_NEXT;

--echo ==== Conditions for gtid_next ====

--echo # Initialize
--eval CREATE FUNCTION f() RETURNS INT BEGIN RETURN 1; END
CREATE TABLE t1 (a INT) ENGINE = InnoDB;
CREATE USER nonsuper@localhost;
GRANT SELECT ON *.* TO nonsuper@localhost;
--connect (nonsuper,localhost,nonsuper,,)
--connection default

--echo # Read/write session
SELECT @@SESSION.GTID_NEXT;
eval SET @@SESSION.GTID_NEXT= '$ida:7';
ROLLBACK;
--echo # not global
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@GLOBAL.GTID_NEXT;
--error ER_LOCAL_VARIABLE
eval SET @@GLOBAL.GTID_NEXT= '$ida:8';
ROLLBACK;
SET GTID_NEXT = 'AUTOMATIC';

--echo # Can't set value from stored function
--eval CREATE FUNCTION set_var() RETURNS INT BEGIN SET @@SESSION.GTID_NEXT = '$ida:9'; RETURN 1; END
--error ER_VARIABLE_NOT_SETTABLE_IN_SF_OR_TRIGGER
SELECT set_var();
DROP FUNCTION set_var;

--echo # Can't set value from trigger
eval CREATE TRIGGER t BEFORE INSERT ON t1 FOR EACH ROW SET @@SESSION.GTID_NEXT = '$ida:10';
--error ER_VARIABLE_NOT_SETTABLE_IN_SF_OR_TRIGGER
INSERT INTO t1 VALUES (1);
DROP TRIGGER t;

--echo # Can't set value when invoking SF
--error ER_SET_STATEMENT_CANNOT_INVOKE_FUNCTION
SET @@SESSION.GTID_NEXT = f();

--echo # must be SUPER
--connection nonsuper
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
eval SET @@SESSION.GTID_NEXT = '$ida:11';
--connection default

--echo # can read even if non-SUPER
SELECT @@SESSION.GTID_NEXT;

--echo # can't set inside transaction
BEGIN;
--error ER_CANT_CHANGE_GTID_NEXT_IN_TRANSACTION_WHEN_GTID_NEXT_LIST_IS_NULL
eval SET @@SESSION.GTID_NEXT = '$ida:12';
INSERT INTO t1 VALUES (4);
ROLLBACK;

--echo # can't set while owning a GTID
eval SET @@SESSION.GTID_NEXT = '$ida:13';
--error ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID
eval SET @@SESSION.GTID_NEXT = '$ida:14';
# the above error will clean owned_gtid
eval SET @@SESSION.GTID_NEXT = 'AUTOMATIC';
ROLLBACK;

--echo # can't set while owning a GTID
eval SET @@SESSION.GTID_NEXT = '$ida:13';
--error ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID
eval SET @@SESSION.GTID_NEXT = 'AUTOMATIC';
ROLLBACK;

eval SET @@SESSION.GTID_NEXT = '$ida:14';
--echo # can't do implicit commit while gtid_next=SID:GNO
BEGIN;
--error ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET
CREATE TABLE t2 (a INT);
ROLLBACK;

eval SET GTID_NEXT = '$ida:15';
--echo # can't do implicit commit while gtid_next=SID:GNO
SET AUTOCOMMIT = 0;
INSERT INTO t1 VALUES (1);
--error ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET
CREATE TABLE t2 (a INT);
ROLLBACK;

SELECT @@SESSION.GTID_NEXT;
eval SET @@SESSION.GTID_NEXT = 'AUTOMATIC';

DROP TABLE t1;
DROP FUNCTION f;
DROP USER nonsuper@localhost;

# It is (unfortunately) possible to set the value from a stored
# procedure.  No user should do this, it's just weird, but was hard
# to prevent so instead we allow it.  Although this is unsupported, we
# have to check that at least there is no crash.
--delimiter |
eval CREATE PROCEDURE p ()
BEGIN
  SET @@SESSION.GTID_NEXT = '$ida:16';
  ROLLBACK;
  SET @@SESSION.GTID_NEXT = 'AUTOMATIC';
END|
--delimiter ;
CALL p();
DROP PROCEDURE p;

Filemanager

Name Type Size Permission Actions
binlog_base64_flag.test File 5.53 KB 0644
binlog_bug23533.test File 1.48 KB 0644
binlog_bug36391-master.opt File 32 B 0644
binlog_bug36391.test File 1.14 KB 0644
binlog_cache_write_failure-master.opt File 97 B 0644
binlog_cache_write_failure.test File 5.43 KB 0644
binlog_checksum.test File 1.04 KB 0644
binlog_crash_safe_master_checksum-master.opt File 51 B 0644
binlog_crash_safe_master_checksum.test File 2.56 KB 0644
binlog_database.test File 369 B 0644
binlog_delete_and_flush_index.test File 3.53 KB 0644
binlog_dmls_on_tmp_tables_readonly.test File 2.25 KB 0644
binlog_drop_if_exists.test File 3.47 KB 0644
binlog_enforce_gtid_consistency.test File 5.72 KB 0644
binlog_error_action-master.opt File 88 B 0644
binlog_error_action.test File 16.82 KB 0644
binlog_format_switch_in_tmp_table.test File 2.77 KB 0644
binlog_grant.test File 1.7 KB 0644
binlog_gtid_cache-master.opt File 117 B 0644
binlog_gtid_cache.test File 569 B 0644
binlog_gtid_errors-master.opt File 149 B 0644
binlog_gtid_errors.test File 7.28 KB 0644
binlog_gtid_exhausted-master.opt File 17 B 0644
binlog_gtid_exhausted.test File 2.34 KB 0644
binlog_gtid_implicit_commit.test File 121 B 0644
binlog_gtid_innodb.test File 132 B 0644
binlog_gtid_mysqlbinlog_row.test File 197 B 0644
binlog_gtid_mysqlbinlog_row_innodb.test File 707 B 0644
binlog_gtid_mysqlbinlog_row_myisam.test File 662 B 0644
binlog_gtid_mysqlbinlog_start_stop.test File 445 B 0644
binlog_gtid_row_ctype_ucs.test File 265 B 0644
binlog_gtid_simple_recovery.test File 4.7 KB 0644
binlog_gtid_stm_ctype_ucs.test File 280 B 0644
binlog_gtid_utils.test File 3.11 KB 0644
binlog_hexdump.test File 219 B 0644
binlog_implicit_commit.test File 290 B 0644
binlog_incident-master.opt File 53 B 0644
binlog_incident.test File 1.05 KB 0644
binlog_incident_ignore-master.opt File 77 B 0644
binlog_incident_ignore.test File 151 B 0644
binlog_index-master.opt File 16 B 0644
binlog_index.test File 16.48 KB 0644
binlog_innodb.test File 139 B 0644
binlog_innodb_row.test File 2.69 KB 0644
binlog_killed.test File 10.52 KB 0644
binlog_killed_simulate-master.opt File 39 B 0644
binlog_killed_simulate.test File 2.67 KB 0644
binlog_max_extension.test File 2.57 KB 0644
binlog_mixed_cache_stat.test File 276 B 0644
binlog_mixed_load_data.test File 501 B 0644
binlog_multi_engine.test File 3.18 KB 0644
binlog_mysqlbinlog-cp932-master.opt File 23 B 0644
binlog_mysqlbinlog-cp932.test File 1.07 KB 0644
binlog_mysqlbinlog_base64.test File 2.59 KB 0644
binlog_mysqlbinlog_concat.test File 4.1 KB 0644
binlog_mysqlbinlog_filter.test File 2.07 KB 0644
binlog_mysqlbinlog_raw.test File 3.53 KB 0644
binlog_mysqlbinlog_row.test File 204 B 0644
binlog_mysqlbinlog_row_innodb.test File 714 B 0644
binlog_mysqlbinlog_row_myisam.test File 669 B 0644
binlog_mysqlbinlog_row_trans.test File 4.55 KB 0644
binlog_mysqlbinlog_start_stop.test File 452 B 0644
binlog_mysqlbinlog_start_stop_slave_server_id.test File 1.96 KB 0644
binlog_old_versions.test File 5.6 KB 0644
binlog_query_filter_rules-master.opt File 40 B 0644
binlog_query_filter_rules.test File 854 B 0644
binlog_reset_master.test File 998 B 0644
binlog_rewrite.test File 3.01 KB 0644
binlog_rotate_bgc_sync.test File 3.62 KB 0644
binlog_row_binlog-master.opt File 55 B 0644
binlog_row_binlog.test File 782 B 0644
binlog_row_cache_stat.test File 273 B 0644
binlog_row_ctype_cp932.test File 267 B 0644
binlog_row_ctype_ucs.test File 272 B 0644
binlog_row_drop_tbl.test File 214 B 0644
binlog_row_drop_tmp_tbl.test File 232 B 0644
binlog_row_innodb_stat-master.opt File 26 B 0644
binlog_row_insert_select.test File 510 B 0644
binlog_row_mix_innodb_myisam-master.opt File 97 B 0644
binlog_row_mix_innodb_myisam.test File 584 B 0644
binlog_row_mysqlbinlog_db_filter.test File 4.1 KB 0644
binlog_row_mysqlbinlog_verbose.test File 5.59 KB 0644
binlog_row_query_log_events.test File 1.18 KB 0644
binlog_server_id.test File 1 KB 0644
binlog_server_start_options.test File 3.63 KB 0644
binlog_sf.test File 2.67 KB 0644
binlog_simplified_binlog_gtid_recovery-master.opt File 16 B 0644
binlog_spurious_ddl_errors-master.opt File 29 B 0644
binlog_spurious_ddl_errors.test File 4.16 KB 0644
binlog_sql_mode.test File 4.75 KB 0644
binlog_start_comment.test File 1.01 KB 0644
binlog_statement_insert_delayed.test File 500 B 0644
binlog_stm_binlog-master.opt File 55 B 0644
binlog_stm_binlog.test File 740 B 0644
binlog_stm_blackhole.test File 267 B 0644
binlog_stm_cache_stat.test File 279 B 0644
binlog_stm_ctype_cp932.test File 317 B 0644
binlog_stm_ctype_ucs.test File 287 B 0644
binlog_stm_do_db-master.opt File 38 B 0644
binlog_stm_do_db.test File 2.8 KB 0644
binlog_stm_drop_tbl.test File 229 B 0644
binlog_stm_drop_tmp_tbl.test File 247 B 0644
binlog_stm_innodb_stat-master.opt File 26 B 0644
binlog_stm_insert_select.test File 291 B 0644
binlog_stm_mix_innodb_myisam-master.opt File 145 B 0644
binlog_stm_mix_innodb_myisam.test File 551 B 0644
binlog_stm_ps.test File 866 B 0644
binlog_stm_row.test File 3.12 KB 0644
binlog_stm_unsafe_warning-master.opt File 38 B 0644
binlog_stm_unsafe_warning.test File 5.61 KB 0644
binlog_stm_user_variables.test File 3.16 KB 0644
binlog_switch_inside_trans.test File 7.6 KB 0644
binlog_tmp_table.test File 4.43 KB 0644
binlog_truncate_innodb-master.opt File 15 B 0644
binlog_truncate_kill.test File 1.96 KB 0644
binlog_truncate_myisam.test File 316 B 0644
binlog_unsafe-master.opt File 65 B 0644
binlog_unsafe.test File 26.31 KB 0644
binlog_unsafe_stmt_capable_engine-master.opt File 41 B 0644
binlog_unsafe_stmt_capable_engine.test File 12.55 KB 0644
binlog_use_gtid_skip.test File 1.03 KB 0644
binlog_variables_log_bin-master.opt File 16 B 0644
binlog_variables_log_bin.test File 135 B 0644
binlog_variables_log_bin_index-master.opt File 70 B 0644
binlog_variables_log_bin_index.test File 135 B 0644
binlog_variables_relay_log-master.opt File 24 B 0644
binlog_variables_relay_log.test File 183 B 0644
binlog_variables_relay_log_index-master.opt File 86 B 0644
binlog_variables_relay_log_index.test File 183 B 0644
binlog_write_error.test File 2.37 KB 0644
binlog_xa_handling.test File 769 B 0644
disabled.def File 404 B 0644
show_binlog_events_no_lock.test File 2.27 KB 0644