~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/temp_table.test

  • Committer: Brian Aker
  • Date: 2009-02-21 00:18:15 UTC
  • Revision ID: brian@tangent.org-20090221001815-x20e8h71e984lvs1
Completion (?) of uint conversion.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
CREATE TABLE t2 (x int not null, y int not null);
19
19
alter table t2 rename t1;
20
20
select * from t1;
21
 
create TEMPORARY TABLE t2 engine=MEMORY select * from t1;
22
 
create TEMPORARY TABLE IF NOT EXISTS t2 (a int) engine=MEMORY;
 
21
create TEMPORARY TABLE t2 engine=heap select * from t1;
 
22
create TEMPORARY TABLE IF NOT EXISTS t2 (a int) engine=heap;
23
23
 
24
24
# This should give errors
25
 
--error ER_TABLE_EXISTS_ERROR
 
25
--error 1050
26
26
CREATE TEMPORARY TABLE t1 (a int not null, b char (10) not null);
27
 
--error ER_TABLE_EXISTS_ERROR
 
27
--error 1050
28
28
ALTER TABLE t1 RENAME t2;
29
29
 
30
30
select * from t2;
79
79
# In MySQL 4.0.4 doing a GROUP BY on a NULL column created a disk based
80
80
# temporary table when a memory based one would be good enough.
81
81
 
82
 
CREATE TEMPORARY TABLE t1 (
 
82
CREATE TABLE t1 (
83
83
  d datetime default NULL
84
84
) ENGINE=MyISAM;
85
85
 
88
88
 
89
89
flush status;
90
90
select * from t1 group by d;
91
 
--replace_column 2 #
92
91
show status like "created_tmp%tables";
93
92
drop table t1;
94
93
 
118
117
 
119
118
 
120
119
#
 
120
# BUG#21096: locking issue ; temporary table conflicts.
 
121
#
 
122
# The problem was that on DROP TEMPORARY table name lock was acquired,
 
123
# which should not be done.
 
124
#
 
125
--disable_warnings
 
126
DROP TABLE IF EXISTS t1;
 
127
--enable_warnings
 
128
 
 
129
CREATE TABLE t1 (i INT);
 
130
 
 
131
LOCK TABLE t1 WRITE;
 
132
 
 
133
connect (conn1, localhost, root,,);
 
134
 
 
135
CREATE TEMPORARY TABLE t1 (i INT);
 
136
 
 
137
--echo The following command should not block
 
138
DROP TEMPORARY TABLE t1;
 
139
 
 
140
disconnect conn1;
 
141
connection default;
 
142
 
 
143
DROP TABLE t1;
 
144
 
 
145
#
121
146
# Check that it's not possible to drop a base table with
122
147
# DROP TEMPORARY statement.
123
148
#
124
149
CREATE TABLE t1 (i INT);
125
150
CREATE TEMPORARY TABLE t2 (i INT);
126
151
 
127
 
--error ER_BAD_TABLE_ERROR
 
152
--error 1051
128
153
DROP TEMPORARY TABLE t2, t1;
129
154
 
130
155
# Table t2 should have been dropped.
131
 
--error ER_TABLE_UNKNOWN
 
156
--error 1146
132
157
SELECT * FROM t2;
133
158
# But table t1 should still be there.
134
159
SELECT * FROM t1;