~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/derived.test

  • Committer: Brian Aker
  • Date: 2008-10-02 19:18:43 UTC
  • mto: (438.4.1 drizzle-clean-code)
  • mto: This revision was merged to the branch mainline in revision 435.
  • Revision ID: brian@tangent.org-20081002191843-tw3nnufik8qwf9rz
Removed UNSIGNED from parser.

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
#
80
80
# test->used_keys test for derived tables
81
81
#
82
 
create table t1 (mat_id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, matintnum CHAR(6) NOT NULL, test MEDIUMINT UNSIGNED NULL);
83
 
create table t2 (mat_id MEDIUMINT UNSIGNED NOT NULL, pla_id MEDIUMINT UNSIGNED NOT NULL);
 
82
create table t1 (mat_id MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY, matintnum CHAR(6) NOT NULL, test MEDIUMINT NULL);
 
83
create table t2 (mat_id MEDIUMINT NOT NULL, pla_id MEDIUMINT NOT NULL);
84
84
insert into t1 values (NULL, 'a', 1), (NULL, 'b', 2), (NULL, 'c', 3), (NULL, 'd', 4), (NULL, 'e', 5), (NULL, 'f', 6), (NULL, 'g', 7), (NULL, 'h', 8), (NULL, 'i', 9);
85
85
insert into t2 values (1, 100), (1, 101), (1, 102), (2, 100), (2, 103), (2, 104), (3, 101), (3, 102), (3, 105);
86
86
 
112
112
#
113
113
# deived tables with subquery inside all by one table
114
114
#
115
 
create table t1 (E1 INTEGER UNSIGNED NOT NULL, E2 INTEGER UNSIGNED NOT NULL, E3 INTEGER UNSIGNED NOT NULL, PRIMARY KEY(E1)
 
115
create table t1 (E1 INTEGER NOT NULL, E2 INTEGER NOT NULL, E3 INTEGER NOT NULL, PRIMARY KEY(E1)
116
116
);
117
117
insert into t1 VALUES(1,1,1), (2,2,1);
118
118
select count(*) from t1 INNER JOIN (SELECT A.E1, A.E2, A.E3 FROM t1 AS A WHERE A.E3 = (SELECT MAX(B.E3) FROM t1 AS B WHERE A.E2 = B.E2)) AS THEMAX ON t1.E1 = THEMAX.E2 AND t1.E1 = t1.E2;
129
129
# multi-update & multi-delete with derived tables
130
130
#
131
131
CREATE TABLE `t1` (
132
 
  `N` int(11) unsigned NOT NULL default '0',
 
132
  `N` int(11) NOT NULL default '0',
133
133
  `M` int(1) default '0'
134
134
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
135
135
INSERT INTO `t1` (N, M) VALUES (1, 0),(1, 0),(1, 0),(2, 0),(2, 0),(3, 0);
247
247
#
248
248
# Bug#10586 - query works with 4.1.8, but not with 4.1.11
249
249
#
250
 
create table t1 (ID int unsigned not null auto_increment,
 
250
create table t1 (ID int not null auto_increment,
251
251
                 DATA varchar(5) not null, primary key (ID));
252
 
create table t2 (ID int unsigned not null auto_increment,
253
 
                 DATA varchar(5) not null, FID int unsigned not null,
 
252
create table t2 (ID int not null auto_increment,
 
253
                 DATA varchar(5) not null, FID int not null,
254
254
                 primary key (ID));
255
255
select A.* from (t1 inner join (select * from t2) as A on t1.ID = A.FID);
256
256
select t2.* from ((select * from t1) as A inner join t2 on A.ID = t2.FID);