~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/select.result

  • 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:
1
1
drop table if exists t1,t2,t3,t4,t11;
2
2
drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa;
3
3
CREATE TABLE t1 (
4
 
Period int unsigned DEFAULT '0' NOT NULL,
5
 
Varor_period int unsigned DEFAULT '0' NOT NULL
 
4
Period int DEFAULT '0' NOT NULL,
 
5
Varor_period int DEFAULT '0' NOT NULL
6
6
);
7
7
INSERT INTO t1 VALUES (9410,9412);
8
8
select period from t1;
16
16
9410    9412
17
17
CREATE TABLE t2 (
18
18
auto int not null auto_increment,
19
 
fld1 int unsigned DEFAULT '0' NOT NULL,
20
 
companynr int unsigned DEFAULT '0' NOT NULL,
 
19
fld1 int DEFAULT '0' NOT NULL,
 
20
companynr int DEFAULT '0' NOT NULL,
21
21
fld3 char(30) DEFAULT '' NOT NULL,
22
22
fld4 char(35) DEFAULT '' NOT NULL,
23
23
fld5 char(35) DEFAULT '' NOT NULL,
1237
1237
18801   inch    1001    5987435 234724
1238
1238
18811   repetitions     1001    5987435 234724
1239
1239
create table t4 (
1240
 
companynr int unsigned NOT NULL default '0',
 
1240
companynr int NOT NULL default '0',
1241
1241
companyname char(30) NOT NULL default '',
1242
1242
PRIMARY KEY (companynr),
1243
1243
UNIQUE KEY companyname(companyname)
1941
1941
show full columns from t2;
1942
1942
Field   Type    Collation       Null    Key     Default Extra   Privileges      Comment
1943
1943
auto    int     NULL    NO      PRI     NULL    auto_increment  #       
1944
 
fld1    int unsigned    NULL    NO      UNI     NULL            #       
1945
 
companynr       int unsigned    NULL    NO              NULL            #       
 
1944
fld1    int     NULL    NO      UNI     NULL            #       
 
1945
companynr       int     NULL    NO              NULL            #       
1946
1946
fld3    varchar(30)     utf8_general_ci NO      MUL     NULL            #       
1947
1947
fld4    varchar(35)     utf8_general_ci NO              NULL            #       
1948
1948
fld5    varchar(35)     utf8_general_ci NO              NULL            #       
1949
1949
fld6    varchar(4)      utf8_general_ci NO              NULL            #       
1950
1950
show full columns from t2 from test like 'f%';
1951
1951
Field   Type    Collation       Null    Key     Default Extra   Privileges      Comment
1952
 
fld1    int unsigned    NULL    NO      UNI     NULL            #       
 
1952
fld1    int     NULL    NO      UNI     NULL            #       
1953
1953
fld3    varchar(30)     utf8_general_ci NO      MUL     NULL            #       
1954
1954
fld4    varchar(35)     utf8_general_ci NO              NULL            #       
1955
1955
fld5    varchar(35)     utf8_general_ci NO              NULL            #       
1958
1958
Field   Type    Collation       Null    Key     Default Extra   Privileges      Comment
1959
1959
drop table t4, t3, t2, t1;
1960
1960
CREATE TABLE t1 (
1961
 
id bigint unsigned NOT NULL auto_increment,
 
1961
id bigint NOT NULL auto_increment,
1962
1962
pseudo varchar(35) NOT NULL default '',
1963
1963
PRIMARY KEY  (id),
1964
1964
UNIQUE KEY pseudo (pseudo)
1968
1968
SELECT 1 as rnd1 from t1 where rand() > 2;
1969
1969
rnd1
1970
1970
DROP TABLE t1;
1971
 
CREATE TABLE t1 (gvid int unsigned default NULL,  hmid int unsigned default NULL,  volid int unsigned default NULL,  mmid int unsigned default NULL,  hdid int unsigned default NULL,  fsid int unsigned default NULL,  ctid int unsigned default NULL,  dtid int unsigned default NULL,  cost int unsigned default NULL,  performance int unsigned default NULL,  serialnumber bigint unsigned default NULL,  monitored int unsigned default '1',  removed int unsigned default '0',  target int unsigned default '0',  dt_modified timestamp NOT NULL,  name varchar(255) binary default NULL,  description varchar(255) default NULL,  UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM;
 
1971
CREATE TABLE t1 (gvid int default NULL,  hmid int default NULL,  volid int default NULL,  mmid int default NULL,  hdid int default NULL,  fsid int default NULL,  ctid int default NULL,  dtid int default NULL,  cost int default NULL,  performance int default NULL,  serialnumber bigint default NULL,  monitored int default '1',  removed int default '0',  target int default '0',  dt_modified timestamp NOT NULL,  name varchar(255) binary default NULL,  description varchar(255) default NULL,  UNIQUE KEY hmid (hmid,volid)) ENGINE=MyISAM;
1972
1972
INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL);
1973
 
CREATE TABLE t2 (  hmid int unsigned default NULL,  volid int unsigned default NULL,  sampletid int unsigned default NULL,  sampletime datetime default NULL,  samplevalue bigint unsigned default NULL,  KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=MyISAM;
 
1973
CREATE TABLE t2 (  hmid int default NULL,  volid int default NULL,  sampletid int default NULL,  sampletime datetime default NULL,  samplevalue bigint default NULL,  KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=MyISAM;
1974
1974
INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35);
1975
1975
SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid;
1976
1976
gvid    the_success     the_fail        the_size        the_time
2270
2270
city
2271
2271
London
2272
2272
DROP TABLE t1;
2273
 
create table t1 (a int unsigned, b int unsigned);
 
2273
create table t1 (a int, b int);
2274
2274
insert into t1 values (1,0), (1,1), (1,2);
2275
2275
select a-b  from t1 order by 1;
2276
2276
a-b  
2286
2286
d       (a-b >= 0)      b
2287
2287
1       1       0
2288
2288
0       1       1
2289
 
select cast((a - b) as unsigned) from t1 order by 1;
2290
 
cast((a - b) as unsigned)
 
2289
select a - b from t1 order by 1;
 
2290
a - b 
 
2291
-1
2291
2292
0
2292
2293
1
2293
 
18446744073709551615
2294
2294
drop table t1;
2295
2295
create table t1 (a int);
2296
2296
select all all * from t1;
2303
2303
ERROR HY000: Incorrect usage of ALL and DISTINCT
2304
2304
drop table t1;
2305
2305
CREATE TABLE t1 (
2306
 
kunde_intern_id int unsigned NOT NULL default '0',
2307
 
kunde_id int unsigned NOT NULL default '0',
2308
 
FK_firma_id int unsigned NOT NULL default '0',
 
2306
kunde_intern_id int NOT NULL default '0',
 
2307
kunde_id int NOT NULL default '0',
 
2308
FK_firma_id int NOT NULL default '0',
2309
2309
aktuell enum('Ja','Nein') NOT NULL default 'Ja',
2310
2310
vorname varchar(128) NOT NULL default '',
2311
2311
nachname varchar(128) NOT NULL default '',
2356
2356
COUNT(*)
2357
2357
0
2358
2358
drop table t1;
2359
 
CREATE TABLE t1 (b BIGINT UNSIGNED NOT NULL, PRIMARY KEY (b));
2360
 
INSERT INTO t1 VALUES (0x8000000000000000);
2361
 
SELECT b FROM t1 WHERE b=0x8000000000000000;
 
2359
CREATE TABLE t1 (b BIGINT NOT NULL, PRIMARY KEY (b));
 
2360
INSERT INTO t1 VALUES (0x4000000000000000);
 
2361
SELECT b FROM t1 WHERE b=0x4000000000000000;
2362
2362
b
2363
 
9223372036854775808
 
2363
4611686018427387904
2364
2364
DROP TABLE t1;
2365
2365
CREATE TABLE `t1` ( `gid` int default NULL, `uid` int default NULL);
2366
2366
CREATE TABLE `t2` ( `ident` int default NULL, `level` char(16) default NULL);
2417
2417
1
2418
2418
NULL
2419
2419
drop table t1,t2;
2420
 
create table t2 (a int unsigned);
 
2420
create table t2 (a int);
2421
2421
create index t2i on t2(a);
2422
2422
insert into t2 values (0), (254), (255);
2423
2423
select * from t2 where a > -1;
2584
2584
min(key1)
2585
2585
0.3762
2586
2586
DROP TABLE t1,t2;
2587
 
CREATE TABLE t1 (i BIGINT UNSIGNED NOT NULL);
 
2587
CREATE TABLE t1 (i BIGINT NOT NULL);
2588
2588
INSERT INTO t1 VALUES (10);
2589
2589
SELECT i='1e+01',i=1e+01, i in (1e+01,1e+01), i in ('1e+01','1e+01') FROM t1;
2590
2590
i='1e+01'       i=1e+01 i in (1e+01,1e+01)      i in ('1e+01','1e+01')
2987
2987
1       SIMPLE  t2      ref     c       c       5       test.t1.a       1       
2988
2988
DROP TABLE t1, t2;
2989
2989
create table t1 (
2990
 
a int unsigned    not null auto_increment primary key,
 
2990
a int    not null auto_increment primary key,
2991
2991
b int             not null,
2992
2992
c int             not null
2993
2993
);
2994
2994
create table t2 (
2995
 
a int unsigned    not null auto_increment primary key,
 
2995
a int    not null auto_increment primary key,
2996
2996
b int             not null,
2997
 
c int unsigned    not null,
 
2997
c int    not null,
2998
2998
d varchar(50)
2999
2999
);
3000
3000
insert into t1 (b,c) values (0,1), (0,1);
3263
3263
Warnings:
3264
3264
Warning 1292    Incorrect datetime value: '2999-12-31 00:00:00' for column 'ts' at row 1
3265
3265
DROP TABLE t1,t2;
3266
 
create table t1 (a bigint unsigned);
 
3266
create table t1 (a bigint);
3267
3267
insert into t1 values
3268
 
(if(1, 9223372036854775808, 1)),
3269
 
(case when 1 then 9223372036854775808 else 1 end),
3270
 
(coalesce(9223372036854775808, 1));
 
3268
(if(1, 92233720368547758, 1)),
 
3269
(case when 1 then 92233720368547758 else 1 end),
 
3270
(coalesce(92233720368547758, 1));
3271
3271
select * from t1;
3272
3272
a
3273
 
9223372036854775808
3274
 
9223372036854775808
3275
 
9223372036854775808
 
3273
92233720368547758
 
3274
92233720368547758
 
3275
92233720368547758
3276
3276
drop table t1;
3277
3277
create table t1 select
3278
3278
if(1, 9223372036854775808, 1) i,
3287
3287
) ENGINE=InnoDB
3288
3288
drop table t1;
3289
3289
select 
3290
 
if(1, cast(1111111111111111111 as unsigned), 1) i,
3291
 
case when 1 then cast(1111111111111111111 as unsigned) else 1 end c,
3292
 
coalesce(cast(1111111111111111111 as unsigned), 1) co;
 
3290
if(1, 1111111111111111111, 1) i,
 
3291
case when 1 then 1111111111111111111 else 1 end c,
 
3292
coalesce(1111111111111111111, 1) co;
3293
3293
i       c       co
3294
3294
1111111111111111111     1111111111111111111     1111111111111111111
3295
3295
CREATE TABLE t1 (name varchar(255));
3576
3576
1
3577
3577
Warnings:
3578
3578
Warning 1466    Leading spaces are removed from name ' x'
3579
 
CREATE TABLE t1 (c11 INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY);
3580
 
CREATE TABLE t2 (c21 INT UNSIGNED NOT NULL, 
 
3579
CREATE TABLE t1 (c11 INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
 
3580
CREATE TABLE t2 (c21 INT NOT NULL, 
3581
3581
c22 INT DEFAULT NULL, 
3582
3582
KEY(c21, c22));
3583
 
CREATE TABLE t3 (c31 INT UNSIGNED NOT NULL DEFAULT 0, 
 
3583
CREATE TABLE t3 (c31 INT NOT NULL DEFAULT 0, 
3584
3584
c32 INT DEFAULT NULL, 
3585
3585
c33 INT NOT NULL, 
3586
 
c34 INT UNSIGNED DEFAULT 0,
 
3586
c34 INT DEFAULT 0,
3587
3587
KEY (c33, c34, c32));
3588
3588
INSERT INTO t1 values (),(),(),(),();
3589
3589
INSERT INTO t2 SELECT a.c11, b.c11 FROM t1 a, t1 b;