mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 14:02:32 +01:00
765caec21a
into hynda.mysql.fi:/home/my/mysql-maria include/my_sys.h: Auto merged include/myisam.h: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/r/binlog_unsafe.result: Auto merged mysql-test/suite/rpl/t/rpl_innodb_bug28430.test: Auto merged mysys/my_write.c: Auto merged sql/handler.cc: Auto merged sql/handler.h: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_plugin.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_select.h: Auto merged sql/sql_show.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_union.cc: Auto merged sql/sql_update.cc: Auto merged storage/myisam/ha_myisam.cc: Auto merged storage/myisam/ha_myisam.h: Auto merged storage/myisam/mi_check.c: Auto merged storage/myisam/mi_open.c: Auto merged include/my_base.h: Manual merge. New error code.
155 lines
5.2 KiB
Text
155 lines
5.2 KiB
Text
--source include/big_test.inc
|
|
--source include/have_innodb.inc
|
|
--source include/have_partition.inc
|
|
--source include/have_binlog_format_mixed_or_row.inc
|
|
--source include/master-slave.inc
|
|
|
|
# Set the default connection to 'master'
|
|
|
|
--vertical_results
|
|
|
|
let $engine_type= 'innodb';
|
|
|
|
######## Creat Table Section #########
|
|
use test;
|
|
|
|
eval CREATE TABLE test.regular_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
|
|
dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
|
|
fkid MEDIUMINT, filler VARCHAR(255),
|
|
PRIMARY KEY(id)) ENGINE=$engine_type;
|
|
|
|
eval CREATE TABLE test.bykey_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
|
|
dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
|
|
fkid MEDIUMINT, filler VARCHAR(255),
|
|
PRIMARY KEY(id)) ENGINE=$engine_type
|
|
PARTITION BY KEY(id) partitions 5;
|
|
|
|
eval CREATE TABLE test.byrange_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
|
|
dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
|
|
fkid MEDIUMINT, filler VARCHAR(255),
|
|
PRIMARY KEY(id)) ENGINE=$engine_type
|
|
PARTITION BY RANGE(id)
|
|
SUBPARTITION BY hash(id) subpartitions 2
|
|
(PARTITION pa1 values less than (10),
|
|
PARTITION pa2 values less than (20),
|
|
PARTITION pa3 values less than (30),
|
|
PARTITION pa4 values less than (40),
|
|
PARTITION pa5 values less than (50),
|
|
PARTITION pa6 values less than (60),
|
|
PARTITION pa7 values less than (70),
|
|
PARTITION pa8 values less than (80),
|
|
PARTITION pa9 values less than (90),
|
|
PARTITION pa10 values less than (100),
|
|
PARTITION pa11 values less than MAXVALUE);
|
|
|
|
######## Create SPs, Functions, Views and Triggers Section ##############
|
|
|
|
delimiter |;
|
|
CREATE PROCEDURE test.proc_norm()
|
|
BEGIN
|
|
DECLARE ins_count INT DEFAULT 1000;
|
|
DECLARE del_count INT;
|
|
DECLARE cur_user VARCHAR(255);
|
|
DECLARE local_uuid VARCHAR(255);
|
|
DECLARE local_time TIMESTAMP;
|
|
|
|
SET local_time= NOW();
|
|
SET cur_user= CURRENT_USER();
|
|
SET local_uuid= UUID();
|
|
|
|
WHILE ins_count > 0 DO
|
|
INSERT INTO test.regular_tbl VALUES (NULL, NOW(), USER() , UUID(),
|
|
ins_count,'Going to test MBR for MySQL');
|
|
SET ins_count = ins_count - 1;
|
|
END WHILE;
|
|
|
|
SELECT MAX(id) FROM test.regular_tbl INTO del_count;
|
|
WHILE del_count > 0 DO
|
|
DELETE FROM test.regular_tbl WHERE id = del_count;
|
|
SET del_count = del_count - 2;
|
|
END WHILE;
|
|
END|
|
|
|
|
CREATE PROCEDURE test.proc_bykey()
|
|
BEGIN
|
|
DECLARE ins_count INT DEFAULT 1000;
|
|
DECLARE del_count INT;
|
|
DECLARE cur_user VARCHAR(255);
|
|
DECLARE local_uuid VARCHAR(255);
|
|
DECLARE local_time TIMESTAMP;
|
|
|
|
SET local_time= NOW();
|
|
SET cur_user= CURRENT_USER();
|
|
SET local_uuid= UUID();
|
|
|
|
WHILE ins_count > 0 DO
|
|
INSERT INTO test.bykey_tbl VALUES (NULL, NOW(), USER() , UUID(),
|
|
ins_count,'Going to test MBR for MySQL');
|
|
SET ins_count = ins_count - 1;
|
|
END WHILE;
|
|
|
|
SELECT MAX(id) FROM test.bykey_tbl INTO del_count;
|
|
WHILE del_count > 0 DO
|
|
DELETE FROM test.bykey_tbl WHERE id = del_count;
|
|
SET del_count = del_count - 2;
|
|
END WHILE;
|
|
END|
|
|
|
|
CREATE PROCEDURE test.proc_byrange()
|
|
BEGIN
|
|
DECLARE ins_count INT DEFAULT 1000;
|
|
DECLARE del_count INT;
|
|
DECLARE cur_user VARCHAR(255);
|
|
DECLARE local_uuid VARCHAR(255);
|
|
DECLARE local_time TIMESTAMP;
|
|
|
|
SET local_time= NOW();
|
|
SET cur_user = CURRENT_USER();
|
|
SET local_uuid=UUID();
|
|
|
|
WHILE ins_count > 0 DO
|
|
INSERT INTO test.byrange_tbl VALUES (NULL, NOW(), USER(), UUID(),
|
|
ins_count,'Going to test MBR for MySQL');
|
|
SET ins_count = ins_count - 1;
|
|
END WHILE;
|
|
|
|
SELECT MAX(id) FROM test.byrange_tbl INTO del_count;
|
|
WHILE del_count > 0 DO
|
|
DELETE FROM test.byrange_tbl WHERE id = del_count;
|
|
SET del_count = del_count - 2;
|
|
END WHILE;
|
|
END|
|
|
|
|
delimiter ;|
|
|
|
|
############ Finish Setup Section ###################
|
|
|
|
|
|
############ Test Section ###################
|
|
|
|
CALL test.proc_norm();
|
|
SELECT count(*) as "Master regular" FROM test.regular_tbl;
|
|
CALL test.proc_bykey();
|
|
SELECT count(*) as "Master bykey" FROM test.bykey_tbl;
|
|
CALL test.proc_byrange();
|
|
SELECT count(*) as "Master byrange" FROM test.byrange_tbl;
|
|
|
|
--sync_slave_with_master
|
|
connection slave;
|
|
show create table test.byrange_tbl;
|
|
source include/show_slave_status.inc;
|
|
SELECT count(*) "Slave norm" FROM test.regular_tbl;
|
|
SELECT count(*) "Slave bykey" FROM test.bykey_tbl;
|
|
SELECT count(*) "Slave byrange" FROM test.byrange_tbl;
|
|
|
|
###### CLEAN UP SECTION ##############
|
|
|
|
connection master;
|
|
DROP PROCEDURE test.proc_norm;
|
|
DROP PROCEDURE test.proc_bykey;
|
|
DROP PROCEDURE test.proc_byrange;
|
|
DROP TABLE test.regular_tbl;
|
|
DROP TABLE test.bykey_tbl;
|
|
DROP TABLE test.byrange_tbl;
|
|
|
|
--source include/master-slave-end.inc
|