2003-03-04 12:22:35 +02:00
|
|
|
drop table if exists t1,t2;
|
2001-10-08 07:24:04 +03:00
|
|
|
create table t1(n int);
|
|
|
|
insert into t1 values (1);
|
|
|
|
lock tables t1 write;
|
2006-10-04 23:48:24 +02:00
|
|
|
update low_priority t1 set n = 4;
|
|
|
|
select n from t1;
|
2001-10-08 07:24:04 +03:00
|
|
|
unlock tables;
|
2001-10-08 04:58:07 +03:00
|
|
|
n
|
|
|
|
4
|
2001-10-08 07:24:04 +03:00
|
|
|
drop table t1;
|
|
|
|
create table t1(n int);
|
|
|
|
insert into t1 values (1);
|
|
|
|
lock tables t1 read;
|
2006-10-04 23:48:24 +02:00
|
|
|
update low_priority t1 set n = 4;
|
|
|
|
select n from t1;
|
2001-10-08 04:58:07 +03:00
|
|
|
n
|
|
|
|
1
|
2007-08-11 14:07:49 +04:00
|
|
|
unlock tables;
|
2001-10-08 07:24:04 +03:00
|
|
|
drop table t1;
|
2004-10-03 00:20:47 +01:00
|
|
|
create table t1 (a int, b int);
|
|
|
|
create table t2 (c int, d int);
|
|
|
|
insert into t1 values(1,1);
|
|
|
|
insert into t1 values(2,2);
|
|
|
|
insert into t2 values(1,2);
|
|
|
|
lock table t1 read;
|
2006-10-04 23:48:24 +02:00
|
|
|
update t1,t2 set c=a where b=d;
|
2004-10-03 00:20:47 +01:00
|
|
|
select c from t2;
|
|
|
|
c
|
2004-11-05 17:29:47 +02:00
|
|
|
2
|
2004-10-03 00:20:47 +01:00
|
|
|
drop table t1;
|
|
|
|
drop table t2;
|
2003-03-04 12:22:35 +02:00
|
|
|
create table t1 (a int);
|
|
|
|
create table t2 (a int);
|
|
|
|
lock table t1 write, t2 write;
|
2006-10-04 23:48:24 +02:00
|
|
|
insert t1 select * from t2;
|
2003-03-04 12:22:35 +02:00
|
|
|
drop table t2;
|
2003-06-04 18:28:51 +03:00
|
|
|
ERROR 42S02: Table 'test.t2' doesn't exist
|
2003-03-04 12:22:35 +02:00
|
|
|
drop table t1;
|
2006-03-29 14:27:36 +03:00
|
|
|
create table t1 (a int);
|
|
|
|
create table t2 (a int);
|
|
|
|
lock table t1 write, t2 write, t1 as t1_2 write, t2 as t2_2 write;
|
2006-10-05 00:36:03 +02:00
|
|
|
insert t1 select * from t2;
|
2006-03-29 14:27:36 +03:00
|
|
|
drop table t2;
|
|
|
|
ERROR 42S02: Table 'test.t2' doesn't exist
|
|
|
|
drop table t1;
|
2007-08-11 14:07:49 +04:00
|
|
|
End of 4.1 tests
|
2005-06-03 15:29:05 +02:00
|
|
|
create table t1(a int);
|
|
|
|
lock tables t1 write;
|
|
|
|
show columns from t1;
|
|
|
|
Field Type Null Key Default Extra
|
|
|
|
a int(11) YES NULL
|
|
|
|
unlock tables;
|
|
|
|
drop table t1;
|
2006-05-24 17:21:35 +03:00
|
|
|
use mysql;
|
|
|
|
LOCK TABLES columns_priv WRITE, db WRITE, host WRITE, user WRITE;
|
|
|
|
FLUSH TABLES;
|
|
|
|
use mysql;
|
2006-10-04 23:48:24 +02:00
|
|
|
SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1;
|
2006-05-24 17:21:35 +03:00
|
|
|
OPTIMIZE TABLES columns_priv, db, host, user;
|
|
|
|
Table Op Msg_type Msg_text
|
|
|
|
mysql.columns_priv optimize status OK
|
|
|
|
mysql.db optimize status OK
|
|
|
|
mysql.host optimize status OK
|
|
|
|
mysql.user optimize status OK
|
|
|
|
UNLOCK TABLES;
|
|
|
|
Select_priv
|
|
|
|
N
|
|
|
|
use test;
|
|
|
|
use test;
|
2006-06-26 19:14:35 +02:00
|
|
|
CREATE TABLE t1 (c1 int);
|
|
|
|
LOCK TABLE t1 WRITE;
|
2006-10-04 23:48:24 +02:00
|
|
|
FLUSH TABLES WITH READ LOCK;
|
2006-06-26 19:14:35 +02:00
|
|
|
CREATE TABLE t2 (c1 int);
|
|
|
|
UNLOCK TABLES;
|
|
|
|
UNLOCK TABLES;
|
|
|
|
DROP TABLE t1, t2;
|
|
|
|
CREATE TABLE t1 (c1 int);
|
|
|
|
LOCK TABLE t1 WRITE;
|
2006-10-04 23:48:24 +02:00
|
|
|
FLUSH TABLES WITH READ LOCK;
|
2006-06-26 19:14:35 +02:00
|
|
|
CREATE TABLE t2 AS SELECT * FROM t1;
|
|
|
|
ERROR HY000: Table 't2' was not locked with LOCK TABLES
|
|
|
|
UNLOCK TABLES;
|
|
|
|
UNLOCK TABLES;
|
|
|
|
DROP TABLE t1;
|
2006-05-29 15:26:23 +02:00
|
|
|
CREATE DATABASE mysqltest_1;
|
|
|
|
FLUSH TABLES WITH READ LOCK;
|
2006-10-04 23:48:24 +02:00
|
|
|
DROP DATABASE mysqltest_1;
|
2006-05-29 15:26:23 +02:00
|
|
|
DROP DATABASE mysqltest_1;
|
|
|
|
ERROR HY000: Can't execute the query because you have a conflicting read lock
|
|
|
|
UNLOCK TABLES;
|
|
|
|
DROP DATABASE mysqltest_1;
|
|
|
|
ERROR HY000: Can't drop database 'mysqltest_1'; database doesn't exist
|
2006-06-20 13:43:13 -04:00
|
|
|
create table t1 (f1 int(12) unsigned not null auto_increment, primary key(f1)) engine=innodb;
|
|
|
|
lock tables t1 write;
|
2007-08-11 14:07:49 +04:00
|
|
|
alter table t1 auto_increment=0;
|
|
|
|
alter table t1 auto_increment=0;
|
2006-06-20 13:43:13 -04:00
|
|
|
unlock tables;
|
|
|
|
drop table t1;
|
2008-10-08 02:34:00 +05:00
|
|
|
CREATE TABLE t1 (
|
|
|
|
a int(11) unsigned default NULL,
|
|
|
|
b varchar(255) default NULL,
|
|
|
|
UNIQUE KEY a (a),
|
|
|
|
KEY b (b)
|
|
|
|
);
|
|
|
|
INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3);
|
|
|
|
CREATE TABLE t2 SELECT * FROM t1;
|
|
|
|
CREATE TABLE t3 SELECT * FROM t1;
|
|
|
|
# test altering of columns that multiupdate doesn't use
|
|
|
|
# normal mode
|
|
|
|
# PS mode
|
|
|
|
# test altering of columns that multiupdate uses
|
|
|
|
# normal mode
|
|
|
|
# PS mode
|
|
|
|
DROP TABLE t1, t2, t3;
|
2008-10-09 20:24:31 +05:00
|
|
|
CREATE TABLE t1( a INT, b INT );
|
|
|
|
INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4);
|
|
|
|
# 1. test regular tables
|
|
|
|
# 1.1. test altering of columns that multiupdate doesn't use
|
|
|
|
# 1.1.1. normal mode
|
|
|
|
# 1.1.2. PS mode
|
|
|
|
# 1.2. test altering of columns that multiupdate uses
|
|
|
|
# 1.2.1. normal mode
|
|
|
|
# 1.2.2. PS mode
|
|
|
|
ALTER TABLE t1 ADD COLUMN a INT;
|
|
|
|
# 2. test UNIONs
|
|
|
|
# 2.1. test altering of columns that multiupdate doesn't use
|
|
|
|
# 2.1.1. normal mode
|
|
|
|
# 2.1.2. PS mode
|
|
|
|
# 2.2. test altering of columns that multiupdate uses
|
|
|
|
# 2.2.1. normal mode
|
|
|
|
# 2.2.2. PS mode
|
|
|
|
DROP TABLE t1;
|
2007-08-11 14:07:49 +04:00
|
|
|
End of 5.0 tests
|
2007-08-05 13:55:37 +04:00
|
|
|
create table t1 (i int);
|
|
|
|
lock table t1 read;
|
|
|
|
update t1 set i= 10;;
|
|
|
|
select * from t1;;
|
|
|
|
kill query ID;
|
|
|
|
i
|
|
|
|
ERROR 70100: Query execution was interrupted
|
|
|
|
unlock tables;
|
|
|
|
drop table t1;
|
2007-08-17 11:34:12 -03:00
|
|
|
drop table if exists t1;
|
|
|
|
create table t1 (a int) ENGINE=MEMORY;
|
|
|
|
--> client 2
|
|
|
|
handler t1 open;
|
|
|
|
ERROR HY000: Table storage engine for 't1' doesn't have this option
|
|
|
|
--> client 1
|
|
|
|
drop table t1;
|
2007-12-12 19:44:14 -02:00
|
|
|
drop table if exists t1;
|
|
|
|
create table t1 (i int);
|
|
|
|
connection: default
|
|
|
|
lock tables t1 write;
|
|
|
|
connection: flush
|
|
|
|
flush tables with read lock;;
|
|
|
|
connection: default
|
|
|
|
alter table t1 add column j int;
|
|
|
|
connection: insert
|
|
|
|
insert into t1 values (1,2);;
|
|
|
|
connection: default
|
|
|
|
unlock tables;
|
|
|
|
connection: flush
|
|
|
|
select * from t1;
|
|
|
|
i j
|
|
|
|
unlock tables;
|
|
|
|
select * from t1;
|
|
|
|
i j
|
|
|
|
1 2
|
|
|
|
drop table t1;
|
|
|
|
drop table if exists t1;
|
|
|
|
create table t1 (i int);
|
|
|
|
connection: default
|
|
|
|
lock tables t1 write;
|
|
|
|
connection: flush
|
|
|
|
flush tables with read lock;;
|
|
|
|
connection: default
|
|
|
|
flush tables;
|
|
|
|
unlock tables;
|
|
|
|
drop table t1;
|
2008-01-28 10:52:41 -02:00
|
|
|
drop table if exists t1,t2;
|
|
|
|
create table t1 (a int);
|
|
|
|
flush status;
|
|
|
|
lock tables t1 read;
|
|
|
|
insert into t1 values(1);;
|
2008-01-29 10:37:44 -02:00
|
|
|
unlock tables;
|
2008-01-28 10:52:41 -02:00
|
|
|
drop table t1;
|
2008-01-29 10:37:44 -02:00
|
|
|
select @tlwa < @tlwb;
|
|
|
|
@tlwa < @tlwb
|
|
|
|
1
|
2007-08-05 13:55:37 +04:00
|
|
|
End of 5.1 tests
|