~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysql-test/t/lock.test

  • Committer: Monty Taylor
  • Date: 2008-07-05 22:08:52 UTC
  • mto: This revision was merged to the branch mainline in revision 77.
  • Revision ID: monty@inaugust.com-20080705220852-cqd9t6tfkhvlcf73
Removed HAVE_LONG_LONG, as this is now assumed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
--disable_warnings
6
6
drop table if exists t1,t2;
7
7
--enable_warnings
8
 
CREATE TABLE t1 (  `id` int NOT NULL default '0', `id2` int NOT NULL default '0', `id3` int NOT NULL default '0', `dummy1` char(30) default NULL, PRIMARY KEY  (`id`,`id2`), KEY `index_id3` (`id3`)) ENGINE=MyISAM;
 
8
CREATE TABLE t1 (  `id` int(11) NOT NULL default '0', `id2` int(11) NOT NULL default '0', `id3` int(11) NOT NULL default '0', `dummy1` char(30) default NULL, PRIMARY KEY  (`id`,`id2`), KEY `index_id3` (`id3`)) ENGINE=MyISAM;
9
9
insert into t1 (id,id2) values (1,1),(1,2),(1,3);
10
10
LOCK TABLE t1 WRITE;
11
11
select dummy1,count(distinct id) from t1 group by dummy1;
30
30
#
31
31
 
32
32
CREATE TABLE t1 (
33
 
  index1 int default NULL,
34
 
  nr int default NULL,
 
33
  index1 smallint(6) default NULL,
 
34
  nr smallint(6) default NULL,
35
35
  KEY index1(index1)
36
36
) ENGINE=MyISAM;
37
37
 
38
38
CREATE TABLE t2 (
39
 
  nr int default NULL,
 
39
  nr smallint(6) default NULL,
40
40
  name varchar(20) default NULL
41
41
) ENGINE=MyISAM;
42
42
 
84
84
 
85
85
# Bug7241 - Invalid response when DELETE .. USING and LOCK TABLES used.
86
86
#
87
 
create table t1 ( a int not null auto_increment, primary key(a));
88
 
create table t2 ( a int not null auto_increment, primary key(a));
 
87
create table t1 ( a int(11) not null auto_increment, primary key(a));
 
88
create table t2 ( a int(11) not null auto_increment, primary key(a));
89
89
lock tables t1 write, t2 read;
90
90
delete from t1 using t1,t2 where t1.a=t2.a;
91
91
delete t1 from t1,t2 where t1.a=t2.a;
116
116
drop table t1;
117
117
 
118
118
 
 
119
#
 
120
# Test LOCK TABLE on system tables.  See bug#9953: CONVERT_TZ requires
 
121
# mysql.time_zone_name to be locked.
 
122
#
 
123
--disable_warnings
 
124
DROP TABLE IF EXISTS t1;
 
125
--enable_warnings
 
126
 
 
127
CREATE TABLE t1 (i INT);
 
128
 
 
129
LOCK TABLES mysql.time_zone READ, t1 READ;
 
130
UNLOCK TABLES;
 
131
 
 
132
LOCK TABLES mysql.time_zone READ,  t1 WRITE;
 
133
UNLOCK TABLES;
 
134
 
 
135
LOCK TABLES mysql.time_zone READ;
 
136
UNLOCK TABLES;
 
137
 
 
138
LOCK TABLES mysql.time_zone WRITE;
 
139
UNLOCK TABLES;
 
140
 
 
141
# If at least one system table is locked for WRITE, then all other
 
142
# tables should be system tables locked also for WRITE.
 
143
LOCK TABLES mysql.time_zone READ, t1 READ;
 
144
 
 
145
--error ER_WRONG_LOCK_OF_SYSTEM_TABLE
 
146
LOCK TABLES mysql.time_zone WRITE, t1 READ;
 
147
 
 
148
--error ER_WRONG_LOCK_OF_SYSTEM_TABLE
 
149
LOCK TABLES mysql.time_zone WRITE, t1 WRITE;
 
150
 
 
151
DROP TABLE t1;
 
152
 
119
153
--echo
120
154
--echo Cleanup.
121
155
--echo