~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysql-test/r/temp_table.result

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
drop table if exists t1,t2;
 
2
drop view if exists v1;
2
3
CREATE TABLE t1 (c int not null, d char (10) not null);
3
4
insert into t1 values(1,""),(2,"a"),(3,"b");
4
5
CREATE TEMPORARY TABLE t1 (a int not null, b char (10) not null);
21
22
4       e
22
23
5       f
23
24
6       g
24
 
create TEMPORARY TABLE t2 engine=MEMORY select * from t1;
25
 
create TEMPORARY TABLE IF NOT EXISTS t2 (a int) engine=MEMORY;
 
25
create TEMPORARY TABLE t2 engine=heap select * from t1;
 
26
create TEMPORARY TABLE IF NOT EXISTS t2 (a int) engine=heap;
26
27
Warnings:
27
28
Note    1050    Table 't2' already exists
28
29
CREATE TEMPORARY TABLE t1 (a int not null, b char (10) not null);
29
 
ERROR 42S01: Table 'test.#t1' already exists
 
30
ERROR 42S01: Table 't1' already exists
30
31
ALTER TABLE t1 RENAME t2;
31
 
ERROR 42S01: Table 'test.#t2' already exists
 
32
ERROR 42S01: Table 't2' already exists
32
33
select * from t2;
33
34
a       b
34
35
4       e
62
63
INSERT INTO t1 VALUES (1), (2), (3);
63
64
CREATE TEMPORARY TABLE tmp SELECT *, NULL FROM t1;
64
65
drop table t1;
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);
 
66
create temporary table t1 (id int(10) not null unique);
 
67
create temporary table t2 (id int(10) not null primary key, 
 
68
val int(10) not null);
67
69
insert into t1 values (1),(2),(4);
68
70
insert into t2 values (1,1),(2,1),(3,1),(4,2);
69
71
select one.id, two.val, elt(two.val,'one','two') from t1 one, t2 two where two.id=one.id order by one.id;
77
79
alter table t1 add primary key (a);
78
80
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
79
81
drop table t1;
80
 
CREATE TEMPORARY TABLE t1 (
 
82
CREATE TABLE t1 (
81
83
d datetime default NULL
82
84
) ENGINE=MyISAM;
83
85
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');
95
97
2002-10-24 14:50:40
96
98
show status like "created_tmp%tables";
97
99
Variable_name   Value
98
 
Created_tmp_disk_tables #
99
 
Created_tmp_tables      #
 
100
Created_tmp_disk_tables 0
 
101
Created_tmp_tables      1
100
102
drop table t1;
 
103
create temporary table v1 as select 'This is temp. table' A;
 
104
create view v1 as select 'This is view' A;
 
105
select * from v1;
 
106
A
 
107
This is temp. table
 
108
show create table v1;
 
109
Table   Create Table
 
110
v1      CREATE TEMPORARY TABLE `v1` (
 
111
  `A` varchar(19) NOT NULL DEFAULT ''
 
112
) ENGINE=MyISAM DEFAULT CHARSET=latin1
 
113
show create view v1;
 
114
View    Create View     character_set_client    collation_connection
 
115
v1      CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 'This is view' AS `A`    latin1  latin1_swedish_ci
 
116
drop view v1;
 
117
select * from v1;
 
118
A
 
119
This is temp. table
 
120
create view v1 as select 'This is view again' A;
 
121
select * from v1;
 
122
A
 
123
This is temp. table
 
124
drop table v1;
 
125
select * from v1;
 
126
A
 
127
This is view again
 
128
drop view v1;
101
129
create table t1 (a int, b int, index(a), index(b));
102
130
create table t2 (c int auto_increment, d varchar(255), primary key (c));
103
131
insert into t1 values (3,1),(3,2);
107
135
bar     2
108
136
foo     1
109
137
drop table t1, t2;
 
138
DROP TABLE IF EXISTS t1;
 
139
CREATE TABLE t1 (i INT);
 
140
LOCK TABLE t1 WRITE;
 
141
CREATE TEMPORARY TABLE t1 (i INT);
 
142
The following command should not block
 
143
DROP TEMPORARY TABLE t1;
 
144
DROP TABLE t1;
110
145
CREATE TABLE t1 (i INT);
111
146
CREATE TEMPORARY TABLE t2 (i INT);
112
147
DROP TEMPORARY TABLE t2, t1;