~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/insert_select.test

  • Committer: Monty Taylor
  • Date: 2009-04-25 20:29:54 UTC
  • mto: (997.2.5 mordred)
  • mto: This revision was merged to the branch mainline in revision 1003.
  • Revision ID: mordred@inaugust.com-20090425202954-slopmkjj7vxal5lk
Migrated archive.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
# test case by Fournier Jocelyn <joc@presence-pc.com>
22
22
#
23
23
 
24
 
CREATE TEMPORARY TABLE `t1` (
 
24
CREATE TABLE `t1` (
25
25
  `numeropost` bigint NOT NULL default '0',
26
26
  `icone` int NOT NULL default '0',
27
27
  `numreponse` bigint NOT NULL auto_increment,
37
37
  KEY `numreponse` (`numreponse`)
38
38
) ENGINE=MyISAM;
39
39
 
40
 
CREATE TEMPORARY TABLE `t2` (
 
40
CREATE TABLE `t2` (
41
41
  `numeropost` bigint NOT NULL default '0',
42
42
  `icone` int NOT NULL default '0',
43
43
  `numreponse` bigint NOT NULL auto_increment,
89
89
select * from t1;
90
90
insert into t1 select t2.a from t1,t2;
91
91
select * from t1;
92
 
--error ER_NONUNIQ_TABLE
 
92
--error 1066
93
93
insert into t1 select * from t1,t1;
94
94
drop table t1,t2;
95
95
 
159
159
  SEQ          int NOT NULL default '0',
160
160
  PRIMARY KEY  (ID),
161
161
  KEY t1$NO    (SEQ,NO)
162
 
);
 
162
) ENGINE=MyISAM;
163
163
INSERT INTO t1 (SEQ, NO) SELECT "1" AS SEQ, IF(MAX(NO) IS NULL, 0, MAX(NO)) + 1 AS NO FROM t1 WHERE (SEQ = 1);
164
164
select SQL_BUFFER_RESULT * from t1 WHERE (SEQ = 1);
165
165
drop table t1;
194
194
insert into t1 select t2.a from t2 group by t2.a on duplicate key update a= a + 10;
195
195
 
196
196
#Some error cases
197
 
--error ER_NON_UNIQ_ERROR
 
197
--error 1052
198
198
insert into t1 select t2.a from t2 on duplicate key update a= a + t2.b;
199
 
--error ER_BAD_FIELD_ERROR
 
199
--error 1054
200
200
insert into t1 select t2.a from t2 on duplicate key update t2.a= a + t2.b;
201
 
--error ER_BAD_FIELD_ERROR
 
201
--error 1054
202
202
insert into t1 select t2.a from t2 group by t2.a on duplicate key update a= t1.a + t2.b;
203
203
drop table t1,t2,t3;
204
204
 
218
218
create table t1(x int, y int);
219
219
create table t2(x int, z int);
220
220
insert into t1(x,y) select x,z from t2 on duplicate key update x=values(x);
221
 
--error ER_BAD_FIELD_ERROR
 
221
--error 1054
222
222
insert into t1(x,y) select x,z from t2 on duplicate key update x=values(z);
223
 
--error ER_BAD_FIELD_ERROR
 
223
--error 1054
224
224
insert into t1(x,y) select x,z from t2 on duplicate key update x=values(t2.x);
225
225
drop table t1,t2; 
226
226
 
235
235
 
236
236
flush status;
237
237
INSERT INTO t1 SELECT a + 2 FROM t1 LIMIT 1;
238
 
--replace_column 2 #
239
238
show status like 'Handler_read%';
240
239
 
241
240
DROP TABLE t1;
353
352
--echo #
354
353
create table t1(f1 int);
355
354
insert into t1 values(1),(2),(3);
356
 
create temporary table t2 (key(f1)) engine=myisam select sql_buffer_result f1 from t1;
357
 
check table t2;
 
355
create table t2 (key(f1)) engine=myisam select sql_buffer_result f1 from t1;
 
356
check table t2 extended;
358
357
drop table t1,t2;
359
358
--echo ##################################################################
360
359