~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/func_if.test

  • Committer: Brian Aker
  • Date: 2008-10-13 20:24:22 UTC
  • Revision ID: brian@tangent.org-20081013202422-hjbv31zsnov5arq4
Adding back more test cases.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
# Simple IF tests
10
10
#
11
11
 
12
 
select IF(0,"ERROR","this"),IF(1,"is","ERROR"),IF(NULL,"ERROR","a"),IF(1,2,3)|0,IF(1,2.0,3.0)+0 ;
 
12
select IF(0,"ERROR","this"),IF(1,"is","ERROR"),IF(NULL,"ERROR","a"),IF(1,2.0,3.0)+0 ;
13
13
 
14
14
#
15
15
# Test of IF and case-sensitiveness
16
16
#
17
 
CREATE TABLE t1 (st varchar(255) NOT NULL, u int(11) NOT NULL) ENGINE=MyISAM;
 
17
CREATE TABLE t1 (st varchar(255) NOT NULL, u int NOT NULL) ENGINE=MyISAM;
18
18
INSERT INTO t1 VALUES ('a',1),('A',1),('aa',1),('AA',1),('a',1),('aaa',0),('BBB',0);
19
19
select if(1,st,st) s from t1 order by s;
20
20
select if(u=1,st,st) s from t1 order by s;
66
66
# Bug #9669 Ordering on IF function with FROM_UNIXTIME function fails
67
67
#
68
68
CREATE TABLE `t1` (
69
 
  `id` int(11) NOT NULL ,
70
 
  `date` int(10) default NULL,
 
69
  `id` int NOT NULL ,
 
70
  `date` int default NULL,
71
71
  `text` varchar(32) NOT NULL
72
72
);
73
73
INSERT INTO t1 VALUES (1,1110000000,'Day 1'),(2,1111000000,'Day 2'),(3,1112000000,'Day 3');