1
by brian
clean slate |
1 |
drop table if exists t1,t2;
|
2 |
CREATE TABLE t1 (c int not null, d char (10) not null);
|
|
3 |
insert into t1 values(1,""),(2,"a"),(3,"b");
|
|
4 |
CREATE TEMPORARY TABLE t1 (a int not null, b char (10) not null);
|
|
5 |
insert into t1 values(4,"e"),(5,"f"),(6,"g");
|
|
6 |
alter table t1 rename t2;
|
|
7 |
select * from t1;
|
|
8 |
c d
|
|
9 |
1
|
|
10 |
2 a
|
|
11 |
3 b
|
|
12 |
select * from t2;
|
|
13 |
a b
|
|
14 |
4 e
|
|
15 |
5 f
|
|
16 |
6 g
|
|
17 |
CREATE TABLE t2 (x int not null, y int not null);
|
|
18 |
alter table t2 rename t1;
|
|
19 |
select * from t1;
|
|
20 |
a b
|
|
21 |
4 e
|
|
22 |
5 f
|
|
23 |
6 g
|
|
1233.2.1
by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias. |
24 |
create TEMPORARY TABLE t2 engine=MEMORY select * from t1;
|
25 |
create TEMPORARY TABLE IF NOT EXISTS t2 (a int) engine=MEMORY;
|
|
1
by brian
clean slate |
26 |
Warnings:
|
27 |
Note 1050 Table 't2' already exists
|
|
28 |
CREATE TEMPORARY TABLE t1 (a int not null, b char (10) not null);
|
|
29 |
ERROR 42S01: Table 't1' already exists
|
|
30 |
ALTER TABLE t1 RENAME t2;
|
|
31 |
ERROR 42S01: Table 't2' already exists
|
|
32 |
select * from t2;
|
|
33 |
a b
|
|
34 |
4 e
|
|
35 |
5 f
|
|
36 |
6 g
|
|
37 |
alter table t2 add primary key (a,b);
|
|
38 |
drop table t1,t2;
|
|
39 |
select * from t1;
|
|
40 |
c d
|
|
41 |
1
|
|
42 |
2 a
|
|
43 |
3 b
|
|
44 |
drop table t2;
|
|
45 |
create temporary table t1 select *,2 as "e" from t1;
|
|
46 |
select * from t1;
|
|
47 |
c d e
|
|
48 |
1 2
|
|
49 |
2 a 2
|
|
50 |
3 b 2
|
|
51 |
drop table t1;
|
|
52 |
drop table t1;
|
|
53 |
CREATE TABLE t1 (pkCrash INTEGER PRIMARY KEY,strCrash VARCHAR(255));
|
|
54 |
INSERT INTO t1 ( pkCrash, strCrash ) VALUES ( 1, '1');
|
|
55 |
SELECT CONCAT_WS(pkCrash, strCrash) FROM t1;
|
|
56 |
CONCAT_WS(pkCrash, strCrash)
|
|
57 |
1
|
|
58 |
drop table t1;
|
|
59 |
create temporary table t1 select 1 as 'x';
|
|
60 |
drop table t1;
|
|
61 |
CREATE TABLE t1 (x INT);
|
|
62 |
INSERT INTO t1 VALUES (1), (2), (3);
|
|
63 |
CREATE TEMPORARY TABLE tmp SELECT *, NULL FROM t1;
|
|
64 |
drop table t1;
|
|
642.1.36
by Lee
enable temp_table, timezone and timezone4 tests, timezone currently fails due to bug 309403 |
65 |
create temporary table t1 (id int not null unique);
|
66 |
create temporary table t2 (id int not null primary key, val int not null);
|
|
1
by brian
clean slate |
67 |
insert into t1 values (1),(2),(4);
|
68 |
insert into t2 values (1,1),(2,1),(3,1),(4,2);
|
|
69 |
select one.id, two.val, elt(two.val,'one','two') from t1 one, t2 two where two.id=one.id order by one.id;
|
|
70 |
id val elt(two.val,'one','two')
|
|
71 |
1 1 one
|
|
72 |
2 1 one
|
|
73 |
4 2 two
|
|
74 |
drop table t1,t2;
|
|
75 |
create temporary table t1 (a int not null);
|
|
76 |
insert into t1 values (1),(1);
|
|
77 |
alter table t1 add primary key (a);
|
|
78 |
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
|
79 |
drop table t1;
|
|
1063.9.40
by Stewart Smith
temp_table.test for myisam as temp table. |
80 |
CREATE TEMPORARY TABLE t1 (
|
1
by brian
clean slate |
81 |
d datetime default NULL
|
82 |
) ENGINE=MyISAM;
|
|
83 |
INSERT INTO t1 VALUES ('2002-10-24 14:50:32'),('2002-10-24 14:50:33'),('2002-10-24 14:50:34'),('2002-10-24 14:50:34'),('2002-10-24 14:50:34'),('2002-10-24 14:50:35'),('2002-10-24 14:50:35'),('2002-10-24 14:50:35'),('2002-10-24 14:50:35'),('2002-10-24 14:50:36'),('2002-10-24 14:50:36'),('2002-10-24 14:50:36'),('2002-10-24 14:50:36'),('2002-10-24 14:50:37'),('2002-10-24 14:50:37'),('2002-10-24 14:50:37'),('2002-10-24 14:50:37'),('2002-10-24 14:50:38'),('2002-10-24 14:50:38'),('2002-10-24 14:50:38'),('2002-10-24 14:50:39'),('2002-10-24 14:50:39'),('2002-10-24 14:50:39'),('2002-10-24 14:50:39'),('2002-10-24 14:50:40'),('2002-10-24 14:50:40'),('2002-10-24 14:50:40');
|
|
84 |
flush status;
|
|
85 |
select * from t1 group by d;
|
|
86 |
d
|
|
87 |
2002-10-24 14:50:32
|
|
88 |
2002-10-24 14:50:33
|
|
89 |
2002-10-24 14:50:34
|
|
90 |
2002-10-24 14:50:35
|
|
91 |
2002-10-24 14:50:36
|
|
92 |
2002-10-24 14:50:37
|
|
93 |
2002-10-24 14:50:38
|
|
94 |
2002-10-24 14:50:39
|
|
95 |
2002-10-24 14:50:40
|
|
96 |
show status like "created_tmp%tables";
|
|
97 |
Variable_name Value
|
|
1273.16.1
by Brian Aker
More removal of show code. |
98 |
Created_tmp_disk_tables #
|
99 |
Created_tmp_tables #
|
|
1
by brian
clean slate |
100 |
drop table t1;
|
101 |
create table t1 (a int, b int, index(a), index(b));
|
|
102 |
create table t2 (c int auto_increment, d varchar(255), primary key (c));
|
|
103 |
insert into t1 values (3,1),(3,2);
|
|
104 |
insert into t2 values (NULL, 'foo'), (NULL, 'bar');
|
|
105 |
select d, c from t1 left join t2 on b = c where a = 3 order by d;
|
|
106 |
d c
|
|
107 |
bar 2
|
|
108 |
foo 1
|
|
109 |
drop table t1, t2;
|
|
110 |
CREATE TABLE t1 (i INT);
|
|
111 |
CREATE TEMPORARY TABLE t2 (i INT);
|
|
112 |
DROP TEMPORARY TABLE t2, t1;
|
|
113 |
ERROR 42S02: Unknown table 't1'
|
|
114 |
SELECT * FROM t2;
|
|
115 |
ERROR 42S02: Table 'test.t2' doesn't exist
|
|
116 |
SELECT * FROM t1;
|
|
117 |
i
|
|
118 |
DROP TABLE t1;
|
|
119 |
End of 4.1 tests.
|
|
120 |
CREATE TABLE t1 ( c FLOAT( 20, 14 ) );
|
|
121 |
INSERT INTO t1 VALUES( 12139 );
|
|
122 |
CREATE TABLE t2 ( c FLOAT(30,18) );
|
|
123 |
INSERT INTO t2 VALUES( 123456 );
|
|
124 |
SELECT AVG( c ) FROM t1 UNION SELECT 1;
|
|
125 |
AVG( c )
|
|
126 |
12139
|
|
127 |
1
|
|
128 |
SELECT 1 UNION SELECT AVG( c ) FROM t1;
|
|
129 |
1
|
|
130 |
1
|
|
131 |
12139
|
|
132 |
SELECT 1 UNION SELECT * FROM t2 UNION SELECT 1;
|
|
133 |
1
|
|
134 |
1
|
|
135 |
123456
|
|
136 |
SELECT c/1 FROM t1 UNION SELECT 1;
|
|
137 |
c/1
|
|
138 |
12139
|
|
139 |
1
|
|
140 |
DROP TABLE t1, t2;
|
|
141 |
create temporary table t1 (a int);
|
|
142 |
insert into t1 values (4711);
|
|
143 |
select * from t1;
|
|
144 |
a
|
|
145 |
4711
|
|
146 |
truncate t1;
|
|
147 |
insert into t1 values (42);
|
|
148 |
select * from t1;
|
|
149 |
a
|
|
150 |
42
|
|
151 |
drop table t1;
|
|
152 |
CREATE TEMPORARY TABLE t1(a INT, b VARCHAR(20));
|
|
153 |
INSERT INTO t1 VALUES(1, 'val1'), (2, 'val2'), (3, 'val3');
|
|
154 |
DELETE FROM t1 WHERE a=1;
|
|
155 |
SELECT count(*) FROM t1;
|
|
156 |
count(*)
|
|
157 |
2
|
|
158 |
DELETE FROM t1;
|
|
159 |
SELECT * FROM t1;
|
|
160 |
a b
|
|
161 |
DROP TABLE t1;
|
|
162 |
End of 5.1 tests
|