[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.145.39.183: ~ $
#
# Test of auto_increment with offset
#
-- source include/not_ndb_default.inc
-- source include/master-slave.inc

eval create table t1 (a int not null auto_increment,b int, primary key (a)) engine=$engine_type2 auto_increment=3;
insert into t1 values (NULL,1),(NULL,2),(NULL,3);
select * from t1;

--source include/sync_slave_sql_with_master.inc
select * from t1;
connection master;
drop table t1;

eval create table t1 (a int not null auto_increment,b int, primary key (a)) engine=$engine_type2;
insert into t1 values (1,1),(NULL,2),(3,3),(NULL,4);
delete from t1 where b=4;
insert into t1 values (NULL,5),(NULL,6);
select * from t1;

--source include/sync_slave_sql_with_master.inc
select * from t1;
connection master;

drop table t1;

set @@session.auto_increment_increment=100, @@session.auto_increment_offset=10;
show variables like "%auto_inc%";

eval create table t1 (a int not null auto_increment, primary key (a)) engine=$engine_type2;
# Insert with 2 insert statements to get better testing of logging
insert into t1 values (NULL),(5),(NULL);
insert into t1 values (250),(NULL);
select * from t1;
insert into t1 values (1000);
set @@insert_id=400;
insert into t1 values(NULL),(NULL);
select * from t1;

--source include/sync_slave_sql_with_master.inc
select * from t1;
connection master;
drop table t1;

#
# Same test with innodb (as the innodb code is a bit different)
#
eval create table t1 (a int not null auto_increment, primary key (a)) engine=$engine_type;
# Insert with 2 insert statements to get better testing of logging
insert into t1 values (NULL),(5),(NULL);
insert into t1 values (250),(NULL);
select * from t1;
insert into t1 values (1000);
set @@insert_id=400;
insert into t1 values(NULL),(NULL);
select * from t1;

--source include/sync_slave_sql_with_master.inc
select * from t1;
connection master;
drop table t1;

set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
eval create table t1 (a int not null auto_increment, primary key (a)) engine=$engine_type2;
# Insert with 2 insert statements to get better testing of logging
insert into t1 values (NULL),(5),(NULL),(NULL);
insert into t1 values (500),(NULL),(502),(NULL),(NULL);
select * from t1;
set @@insert_id=600;
--error ER_DUP_ENTRY
insert into t1 values(600),(NULL),(NULL);
set @@insert_id=600;
insert ignore into t1 values(600),(NULL),(NULL),(610),(NULL);
select * from t1;

--source include/sync_slave_sql_with_master.inc
select * from t1;
connection master;
drop table t1;

#
# Test that auto-increment works when slave has rows in the table
#
set @@session.auto_increment_increment=10, @@session.auto_increment_offset=1;

eval create table t1 (a int not null auto_increment, primary key (a)) engine=$engine_type2;

--source include/sync_slave_sql_with_master.inc
insert into t1 values(2),(12),(22),(32),(42);
connection master;

insert into t1 values (NULL),(NULL);
insert into t1 values (3),(NULL),(NULL);
select * from t1;

--source include/sync_slave_sql_with_master.inc
select * from t1;

# Test for BUG#20524 "auto_increment_* not observed when inserting
# a too large value". When an autogenerated value was bigger than the
# maximum possible value of the field, it was truncated to that max
# possible value, without being "rounded down" to still honour
# auto_increment_* variables.

connection master;
drop table t1;
create table t1 (a tinyint not null auto_increment primary key) engine=myisam;
insert into t1 values(103);
set auto_increment_increment=11;
set auto_increment_offset=4;
insert into t1 values(null);
insert into t1 values(null);
--error ER_DUP_ENTRY
insert into t1 values(null);
select a, mod(a-@@auto_increment_offset,@@auto_increment_increment) from t1 order by a;

# same but with a larger value
create table t2 (a tinyint unsigned not null auto_increment primary key) engine=myisam;
set auto_increment_increment=10;
set auto_increment_offset=1;
set insert_id=1000;
insert into t2 values(null);
select a, mod(a-@@auto_increment_offset,@@auto_increment_increment) from t2 order by a;

# An offset so big that even first value does not fit
create table t3 like t1;
set auto_increment_increment=1000;
set auto_increment_offset=700;
insert into t3 values(null);
select * from t3 order by a;
--source include/sync_slave_sql_with_master.inc
select * from t1 order by a;
select * from t2 order by a;
select * from t3 order by a;

connection master;

drop table t1,t2,t3;
--source include/sync_slave_sql_with_master.inc

#
# BUG#41986 Replication slave does not pick up proper AUTO_INCREMENT value for Innodb tables
#
connection master;
set auto_increment_increment=1;
set auto_increment_offset=1;
CREATE TABLE t1 (id MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=innodb;
INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
show create table t1;

--source include/sync_slave_sql_with_master.inc
show create table t1;

connection master;
drop table t1;

#
# BUG#45999 Row based replication fails when auto_increment field = 0.  
# Store engine of Slaves auto-generates new sequence numbers for
# auto_increment fields if the values of them are 0. There is an inconsistency
# between slave and master. When MODE_NO_AUTO_VALUE_ON_ZERO are masters treat 
#
source include/rpl_reset.inc;

connection master;
--disable_warnings
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
--enable_warnings

eval CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=$engine_type;
eval CREATE TABLE t2 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=$engine_type2;
SET SQL_MODE='';
# Value of the id will be 1;
INSERT INTO t1 VALUES(NULL);
INSERT INTO t2 VALUES(NULL);
SELECT * FROM t1;
SELECT * FROM t2;
# Value of the id will be 2;
INSERT INTO t1 VALUES();
INSERT INTO t2 VALUES();
SELECT * FROM t1;
SELECT * FROM t2;
# Value of the id will be 3. The master treats 0 as NULL or empty because
# NO_AUTO_VALUE_ON_ZERO is not assign to SQL_MODE.
INSERT INTO t1 VALUES(0);
INSERT INTO t2 VALUES(0);
SELECT * FROM t1;
SELECT * FROM t2;

SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
# Value of the id will be 0. The master does not treat 0 as NULL or empty
# because NO_AUTO_VALUE_ON_ZERO has assigned to SQL_MODE.
INSERT INTO t1 VALUES(0);
INSERT INTO t2 VALUES(0);
SELECT * FROM t1;
SELECT * FROM t2;

INSERT INTO t1 VALUES(4);
INSERT INTO t2 VALUES(4);
FLUSH LOGS;
--source include/sync_slave_sql_with_master.inc

let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;

let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;

connection master;
DROP TABLE t1;
DROP TABLE t2;
--source include/sync_slave_sql_with_master.inc

connection master;
let $MYSQLD_DATADIR= `SELECT @@DATADIR`;
# Keep original binlog file
--copy_file $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.saved
# Stop slave
connection slave;
source include/stop_slave.inc;
RESET SLAVE;
RESET MASTER;
connection master;
# Force master to forget used GTIDs
RESET MASTER;
FLUSH LOGS;
connection slave;
source include/start_slave.inc;
connection master;
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.saved | $MYSQL test
--source include/sync_slave_sql_with_master.inc

let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;

let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;

# End cleanup
--connection master
DROP TABLE t1;
DROP TABLE t2;
SET SQL_MODE='';
--source include/sync_slave_sql_with_master.inc

#
# BUG#56662
# The test verifies if the assertion of "next_insert_id == 0"
# will fail in ha_external_lock() function.
#
connection master;
CREATE TABLE t1 (id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, data INT) ENGINE=innodb;

BEGIN;
--echo # Set sql_mode with NO_AUTO_VALUE_ON_ZERO for allowing
--echo # zero to fill the auto_increment field.
SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
INSERT INTO t1(id,data) VALUES(0,2);
--echo # Resetting sql_mode without NO_AUTO_VALUE_ON_ZERO to
--echo # affect the execution of the transaction on slave.
SET SQL_MODE=0;
COMMIT;
SELECT * FROM t1;
--source include/sync_slave_sql_with_master.inc
SELECT * FROM t1;

connection master;
DROP TABLE t1;
--source include/sync_slave_sql_with_master.inc

#
# WL#5872 "avoid using global heap memory to remember autoincrement
# values for statement-based binlog".
#
connection master;
eval create table t1(a int auto_increment primary key) engine=$engine_type;
insert into t1 values (null),(null),(1025),(null);
--source include/sync_slave_sql_with_master.inc
select * from t1;
let $diff_tables= master:t1, slave:t1;
--source include/diff_tables.inc
connection master;
drop table t1;
--source include/sync_slave_sql_with_master.inc

--source include/rpl_end.inc

Filemanager

Name Type Size Permission Actions
check_type.inc File 1.95 KB 0644
create_recursive_construct.inc File 17.38 KB 0644
create_recursive_construct_stmt_capable_engine.inc File 16.72 KB 0644
delayed_slave_wait_on_query.inc File 1.59 KB 0644
grep_pattern.inc File 598 B 0644
rpl_EE_err.test File 1.03 KB 0644
rpl_auto_increment.test File 8.43 KB 0644
rpl_auto_increment_insert_view.test File 1.37 KB 0644
rpl_auto_increment_invoke_trigger.test File 2.47 KB 0644
rpl_autoinc_func_invokes_trigger.test File 1.78 KB 0644
rpl_binlog_error.inc File 17.24 KB 0644
rpl_binlog_max_cache_size.test File 17.42 KB 0644
rpl_blackhole.test File 1.03 KB 0644
rpl_change_master.test File 10.5 KB 0644
rpl_change_master_bind.inc File 2.23 KB 0644
rpl_charset.test File 4.45 KB 0644
rpl_check_gtid.inc File 4.87 KB 0644
rpl_commit_after_flush.test File 296 B 0644
rpl_conflicts.test File 5.45 KB 0644
rpl_crash_safe.inc File 4.13 KB 0644
rpl_crash_safe.test File 7.61 KB 0644
rpl_db_stmts_ignored.inc File 1.7 KB 0644
rpl_ddl.test File 21.59 KB 0644
rpl_deadlock.test File 5.53 KB 0644
rpl_delete_no_where.test File 523 B 0644
rpl_do_table_filter_insensitive.inc File 492 B 0644
rpl_do_table_filter_sensitive.inc File 491 B 0644
rpl_drop_create_temp_table.inc File 29.76 KB 0644
rpl_drop_create_temp_table.test File 17.8 KB 0644
rpl_extra_col_master.test File 31.89 KB 0644
rpl_extra_col_slave.test File 28.7 KB 0644
rpl_failed_optimize.test File 666 B 0644
rpl_filters.test File 496 B 0644
rpl_flsh_tbls.test File 1.79 KB 0644
rpl_foreign_key.test File 1.7 KB 0644
rpl_generate_mts_gap.test File 1.62 KB 0644
rpl_get_master_version_and_clock.test File 2.88 KB 0644
rpl_gtid_drop_table.inc File 1.11 KB 0644
rpl_gtid_mts_relay_log_recovery.test File 3.78 KB 0644
rpl_gtid_temp_table_in_func_or_trigger.inc File 3.69 KB 0644
rpl_gtids_restart_slave_io_lost_trx.test File 3.48 KB 0644
rpl_heartbeat_2slaves.inc File 4.27 KB 0644
rpl_ignore_table_filter_insensitive.inc File 508 B 0644
rpl_ignore_table_filter_sensitive.inc File 506 B 0644
rpl_implicit_commit_binlog.test File 16.65 KB 0644
rpl_innodb.test File 4.49 KB 0644
rpl_insert_delayed.test File 4.63 KB 0644
rpl_insert_id.test File 15.12 KB 0644
rpl_insert_id_pk.test File 2.65 KB 0644
rpl_insert_ignore.test File 4.74 KB 0644
rpl_insert_ignore_gtid_on.inc File 466 B 0644
rpl_kill_query.inc File 4.14 KB 0644
rpl_loaddata.test File 8.72 KB 0644
rpl_loaddata_s.inc File 896 B 0644
rpl_loadfile.test File 1.07 KB 0644
rpl_log.test File 5.29 KB 0644
rpl_lower_case_table_names.test File 4.07 KB 0644
rpl_max_relay_size.test File 2.58 KB 0644
rpl_mixing_engines.inc File 22.85 KB 0644
rpl_mixing_engines.test File 54.43 KB 0644
rpl_mts_crash_safe.inc File 5.87 KB 0644
rpl_mts_crash_safe.test File 5.47 KB 0644
rpl_mts_execute_partial_trx_in_relay_log.inc File 1.11 KB 0644
rpl_mts_pending_events.inc File 4.91 KB 0644
rpl_mts_relay_log_recovery.test File 3.19 KB 0644
rpl_multi_query.test File 782 B 0644
rpl_multi_update.test File 805 B 0644
rpl_multi_update2.test File 1.35 KB 0644
rpl_multi_update3.test File 4.38 KB 0644
rpl_not_null.test File 10.7 KB 0644
rpl_parallel_load.test File 6.06 KB 0644
rpl_parallel_load_innodb.test File 6.96 KB 0644
rpl_partition.test File 7.88 KB 0644
rpl_record_compare.test File 2.08 KB 0644
rpl_relayrotate.test File 2.68 KB 0644
rpl_reset_slave.test File 3.45 KB 0644
rpl_rollback_to_savepoint.inc File 7.49 KB 0644
rpl_row_001.test File 1.92 KB 0644
rpl_row_UUID.test File 2.61 KB 0644
rpl_row_basic.test File 24.21 KB 0644
rpl_row_blob.test File 5.57 KB 0644
rpl_row_delayed_ins.test File 598 B 0644
rpl_row_empty_imgs.test File 5.67 KB 0644
rpl_row_event_max_size.inc File 3.76 KB 0644
rpl_row_func003.test File 3.07 KB 0644
rpl_row_idempotency.test File 8.39 KB 0644
rpl_row_img.test File 8.23 KB 0644
rpl_row_img_blobs.test File 5.82 KB 0644
rpl_row_img_diff_indexes.test File 9.11 KB 0644
rpl_row_show_relaylog_events.inc File 559 B 0644
rpl_row_sp002.test File 5.26 KB 0644
rpl_row_sp003.test File 2.01 KB 0644
rpl_row_sp006.test File 2.78 KB 0644
rpl_row_sp007.test File 1.46 KB 0644
rpl_row_tabledefs.test File 8.1 KB 0644
rpl_set_null.test File 2.85 KB 0644
rpl_show_binlog_events.inc File 364 B 0644
rpl_show_log_events_with_varying_options.inc File 364 B 0644
rpl_show_relaylog_events.inc File 1.96 KB 0644
rpl_start_stop_slave.test File 5.3 KB 0644
rpl_stm_EE_err2.test File 1.47 KB 0644
rpl_stm_create_if_not_exists.test File 6.87 KB 0644
rpl_stm_insert_delayed.inc File 394 B 0644
rpl_stm_mix_show_relaylog_events.inc File 574 B 0644
rpl_stop_middle_group.test File 5.14 KB 0644
rpl_stop_slave.test File 1.56 KB 0644
rpl_stress_test.inc File 2.22 KB 0644
rpl_sv_relay_space.test File 921 B 0644
rpl_temp_error.test File 623 B 0644
rpl_test_framework.inc File 2.42 KB 0644
rpl_tmp_table_and_DDL.test File 4.8 KB 0644
rpl_trig004.test File 1.7 KB 0644
rpl_truncate.test File 425 B 0644
rpl_truncate_helper.test File 976 B 0644
type_conversions.test File 23.47 KB 0644