config root man

Current Path : /home/usr.opt/mysql57/mysql-test/t/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //home/usr.opt/mysql57/mysql-test/t/partition_locking_4.test

--source include/have_partition.inc
--source include/have_innodb.inc

SET @old_autocommit = @@global.autocommit;
SET @@global.autocommit = 0;
SET @old_lock_wait_timeout= @@global.lock_wait_timeout;
SET @@global.lock_wait_timeout = 1;
SET @old_innodb_lock_wait_timeout= @@global.innodb_lock_wait_timeout;
SET @@global.innodb_lock_wait_timeout = 1;

USE test;

CREATE USER 'mysqltest1'@'localhost';
CREATE USER 'mysqltest2'@'localhost';
GRANT ALL PRIVILEGES ON test.* TO 'mysqltest1'@'localhost';
GRANT ALL PRIVILEGES ON test.* TO 'mysqltest2'@'localhost';

CREATE TABLE t1 (a int PRIMARY KEY, b varchar(128), KEY (b))
ENGINE = InnoDB
PARTITION BY HASH (a) PARTITIONS 13;

INSERT INTO t1 VALUES (11, 'First row, p11');
INSERT INTO t1 VALUES (12, 'First row, p12');

--enable_connect_log
connect (test1,localhost,mysqltest1,,test);
connect (test2,localhost,mysqltest2,,test);

connection test1;
INSERT INTO t1 VALUES (13+11, 'Second row, p11');
INSERT INTO t1 VALUES (13+12, 'Second row, p12');
SELECT * FROM t1 ORDER BY a;

connection test2;
--error ER_LOCK_WAIT_TIMEOUT
INSERT INTO t1 VALUES (13+11, 'Second row, p11');
--error ER_LOCK_WAIT_TIMEOUT
INSERT INTO t1 VALUES (13+12, 'Second row, p12');
SELECT * FROM t1 ORDER BY a;
COMMIT;

connection test1;
SELECT * FROM t1 ORDER BY a;
COMMIT;

connection default;
DROP TABLE t1;
DROP USER 'mysqltest1'@'localhost';
DROP USER 'mysqltest2'@'localhost';
SET @@global.autocommit = @old_autocommit;
SET @@global.lock_wait_timeout= @old_lock_wait_timeout;
SET @@global.innodb_lock_wait_timeout= @old_innodb_lock_wait_timeout;

Man Man