~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/insert_select.test

update to latest from trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
drop table if exists t1,t2,t3;
7
7
--enable_warnings
8
8
 
9
 
create table t1 (bandID MEDIUMINT NOT NULL PRIMARY KEY, payoutID int NOT NULL);
 
9
create table t1 (bandID INT NOT NULL PRIMARY KEY, payoutID int NOT NULL);
10
10
insert into t1 (bandID,payoutID) VALUES (1,6),(2,6),(3,4),(4,9),(5,10),(6,1),(7,12),(8,12);
11
11
create table t2 (payoutID int NOT NULL PRIMARY KEY);
12
12
insert into t2 (payoutID) SELECT DISTINCT payoutID FROM t1;
22
22
#
23
23
 
24
24
CREATE TABLE `t1` (
25
 
  `numeropost` bigint(20) NOT NULL default '0',
26
 
  `icone` int(4) NOT NULL default '0',
27
 
  `numreponse` bigint(20) NOT NULL auto_increment,
 
25
  `numeropost` bigint NOT NULL default '0',
 
26
  `icone` int NOT NULL default '0',
 
27
  `numreponse` bigint NOT NULL auto_increment,
28
28
  `contenu` text NOT NULL,
29
29
  `pseudo` varchar(50) NOT NULL default '',
30
30
  `date` datetime NOT NULL default '0000-00-00 00:00:00',
31
 
  `ip` bigint(11) NOT NULL default '0',
32
 
  `signature` int(1) NOT NULL default '0',
 
31
  `ip` bigint NOT NULL default '0',
 
32
  `signature` int NOT NULL default '0',
33
33
  PRIMARY KEY  (`numeropost`,`numreponse`)
34
34
  ,KEY `ip` (`ip`),
35
35
  KEY `date` (`date`),
38
38
) ENGINE=MyISAM;
39
39
 
40
40
CREATE TABLE `t2` (
41
 
  `numeropost` bigint(20) NOT NULL default '0',
42
 
  `icone` int(4) NOT NULL default '0',
43
 
  `numreponse` bigint(20) NOT NULL auto_increment,
 
41
  `numeropost` bigint NOT NULL default '0',
 
42
  `icone` int NOT NULL default '0',
 
43
  `numreponse` bigint NOT NULL auto_increment,
44
44
  `contenu` text NOT NULL,
45
45
  `pseudo` varchar(50) NOT NULL default '',
46
46
  `date` datetime NOT NULL default '0000-00-00 00:00:00',
47
 
  `ip` bigint(11) NOT NULL default '0',
48
 
  `signature` int(1) NOT NULL default '0',
 
47
  `ip` bigint NOT NULL default '0',
 
48
  `signature` int NOT NULL default '0',
49
49
  PRIMARY KEY  (`numeropost`,`numreponse`),
50
50
  KEY `ip` (`ip`),
51
51
  KEY `date` (`date`),
113
113
# Test that caused uninitialized memory access in auto_increment_key update
114
114
#
115
115
 
116
 
CREATE TABLE t1 ( USID INTEGER UNSIGNED, ServerID int UNSIGNED, State ENUM ('unknown', 'Access-Granted', 'Session-Active', 'Session-Closed' ) NOT NULL DEFAULT 'unknown', SessionID CHAR(32), User CHAR(32) NOT NULL DEFAULT '<UNKNOWN>', NASAddr INTEGER UNSIGNED, NASPort INTEGER UNSIGNED, NASPortType INTEGER UNSIGNED, ConnectSpeed INTEGER UNSIGNED, CarrierType CHAR(32), CallingStationID CHAR(32), CalledStationID CHAR(32), AssignedAddr INTEGER UNSIGNED, SessionTime INTEGER UNSIGNED, PacketsIn INTEGER UNSIGNED, OctetsIn INTEGER UNSIGNED, PacketsOut INTEGER UNSIGNED, OctetsOut INTEGER UNSIGNED, TerminateCause INTEGER UNSIGNED, UnauthTime int UNSIGNED, AccessRequestTime DATETIME, AcctStartTime DATETIME, AcctLastTime DATETIME, LastModification TIMESTAMP NOT NULL);
117
 
CREATE TABLE t2 ( USID INTEGER AUTO_INCREMENT, ServerID int UNSIGNED, State ENUM ('unknown', 'Access-Granted', 'Session-Active', 'Session-Closed' ) NOT NULL DEFAULT 'unknown', SessionID CHAR(32), User TEXT NOT NULL, NASAddr INTEGER UNSIGNED, NASPort INTEGER UNSIGNED, NASPortType INTEGER UNSIGNED, ConnectSpeed INTEGER UNSIGNED, CarrierType CHAR(32), CallingStationID CHAR(32), CalledStationID CHAR(32), AssignedAddr INTEGER UNSIGNED, SessionTime INTEGER UNSIGNED, PacketsIn INTEGER UNSIGNED, OctetsIn INTEGER UNSIGNED, PacketsOut INTEGER UNSIGNED, OctetsOut INTEGER UNSIGNED, TerminateCause INTEGER UNSIGNED, UnauthTime int UNSIGNED, AccessRequestTime DATETIME, AcctStartTime DATETIME, AcctLastTime DATETIME, LastModification TIMESTAMP NOT NULL, INDEX(USID,ServerID,NASAddr,SessionID), INDEX(AssignedAddr));
 
116
CREATE TABLE t1 ( USID INTEGER, ServerID int, State ENUM ('unknown', 'Access-Granted', 'Session-Active', 'Session-Closed' ) NOT NULL DEFAULT 'unknown', SessionID CHAR(32), User CHAR(32) NOT NULL DEFAULT '<UNKNOWN>', NASAddr INTEGER, NASPort INTEGER, NASPortType INTEGER, ConnectSpeed INTEGER, CarrierType CHAR(32), CallingStationID CHAR(32), CalledStationID CHAR(32), AssignedAddr INTEGER, SessionTime INTEGER, PacketsIn INTEGER, OctetsIn INTEGER, PacketsOut INTEGER, OctetsOut INTEGER, TerminateCause INTEGER, UnauthTime int, AccessRequestTime DATETIME, AcctStartTime DATETIME, AcctLastTime DATETIME, LastModification TIMESTAMP NOT NULL);
 
117
CREATE TABLE t2 ( USID INTEGER AUTO_INCREMENT, ServerID int, State ENUM ('unknown', 'Access-Granted', 'Session-Active', 'Session-Closed' ) NOT NULL DEFAULT 'unknown', SessionID CHAR(32), User TEXT NOT NULL, NASAddr INTEGER, NASPort INTEGER, NASPortType INTEGER, ConnectSpeed INTEGER, CarrierType CHAR(32), CallingStationID CHAR(32), CalledStationID CHAR(32), AssignedAddr INTEGER, SessionTime INTEGER, PacketsIn INTEGER, OctetsIn INTEGER, PacketsOut INTEGER, OctetsOut INTEGER, TerminateCause INTEGER, UnauthTime int, AccessRequestTime DATETIME, AcctStartTime DATETIME, AcctLastTime DATETIME, LastModification TIMESTAMP NOT NULL, INDEX(USID,ServerID,NASAddr,SessionID), INDEX(AssignedAddr));
118
118
INSERT INTO t1 VALUES (39,42,'Access-Granted','46','491721000045',2130706433,17690,NULL,NULL,'Localnet','491721000045','49172200000',754974766,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2003-07-18 00:11:21',NULL,NULL,20030718001121);
119
119
INSERT INTO t2 SELECT USID, ServerID, State, SessionID, User, NASAddr, NASPort, NASPortType, ConnectSpeed, CarrierType, CallingStationID, CalledStationID, AssignedAddr, SessionTime, PacketsIn, OctetsIn, PacketsOut, OctetsOut, TerminateCause, UnauthTime, AccessRequestTime, AcctStartTime, AcctLastTime, LastModification from t1 LIMIT 1;
120
120
drop table t1,t2;
125
125
 
126
126
CREATE TABLE t1(
127
127
 Month date NOT NULL,
128
 
 Type int(3) NOT NULL auto_increment,
129
 
 Field int(10) NOT NULL,
130
 
 Count int(10) NOT NULL,
 
128
 Type int NOT NULL auto_increment,
 
129
 Field int NOT NULL,
 
130
 Count int NOT NULL,
 
131
 PRIMARY KEY (Type),
131
132
 UNIQUE KEY Month (Month,Type,Field)
132
133
);
133
134
          
134
 
insert into t1 Values
135
 
(20030901, 1, 1, 100),
136
 
(20030901, 1, 2, 100),
137
 
(20030901, 2, 1, 100),
138
 
(20030901, 2, 2, 100),
139
 
(20030901, 3, 1, 100);
 
135
insert into t1 Values (20030901, 1, 1, 100);
 
136
insert into t1 Values (20030901, 2, 2, 100);
 
137
insert into t1 Values (20030901, 3, 3, 100);
 
138
insert into t1 Values (20030901, 4, 4, 100);
 
139
insert into t1 Values (20030901, 5, 5, 100);
140
140
 
141
141
select * from t1;
142
142
          
154
154
# BUG#6034 - Error code 124:  Wrong medium type
155
155
#
156
156
CREATE TABLE t1 (
157
 
  ID           int(11) NOT NULL auto_increment,
158
 
  NO           int(11) NOT NULL default '0',
159
 
  SEQ          int(11) NOT NULL default '0',
 
157
  ID           int NOT NULL auto_increment,
 
158
  NO           int NOT NULL default '0',
 
159
  SEQ          int NOT NULL default '0',
160
160
  PRIMARY KEY  (ID),
161
161
  KEY t1$NO    (SEQ,NO)
162
162
) ENGINE=MyISAM;
244
244
#
245
245
 
246
246
CREATE TABLE t1 (
247
 
    f1 int(10) NOT NULL auto_increment PRIMARY KEY,
 
247
    f1 int NOT NULL auto_increment PRIMARY KEY,
248
248
    f2 varchar(100) NOT NULL default ''
249
249
);
250
250
CREATE TABLE t2 (