~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/func_math.result

  • Committer: Brian Aker
  • Date: 2008-10-12 01:59:02 UTC
  • Revision ID: brian@tangent.org-20081012015902-prhy6wsimdqr28om
Dead code around unsigned (first pass)

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
Warnings:
44
44
Note    1003    select abs(-(10)) AS `abs(-10)`,sign(-(5)) AS `sign(-5)`,sign(5) AS `sign(5)`,sign(0) AS `sign(0)`
45
45
select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log(1,1),log(3,9),log(-1,2),log(NULL,2);
46
 
ERROR 22012: Division by 0
 
46
log(exp(10))    exp(log(sqrt(10))*2)    log(-1) log(NULL)       log(1,1)        log(3,9)        log(-1,2)       log(NULL,2)
 
47
10      10.000000000000002      NULL    NULL    NULL    2       NULL    NULL
 
48
Warnings:
 
49
Error   1365    Division by 0
 
50
Error   1365    Division by 0
 
51
Error   1365    Division by 0
47
52
explain extended select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log(1,1),log(3,9),log(-1,2),log(NULL,2);
48
53
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
49
54
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    No tables used
50
55
Warnings:
51
56
Note    1003    select log(exp(10)) AS `log(exp(10))`,exp((log(sqrt(10)) * 2)) AS `exp(log(sqrt(10))*2)`,log(-(1)) AS `log(-1)`,log(NULL) AS `log(NULL)`,log(1,1) AS `log(1,1)`,log(3,9) AS `log(3,9)`,log(-(1),2) AS `log(-1,2)`,log(NULL,2) AS `log(NULL,2)`
52
57
select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL);
53
 
ERROR 22012: Division by 0
 
58
ln(exp(10))     exp(ln(sqrt(10))*2)     ln(-1)  ln(0)   ln(NULL)
 
59
10      10.000000000000002      NULL    NULL    NULL
 
60
Warnings:
 
61
Error   1365    Division by 0
 
62
Error   1365    Division by 0
54
63
explain extended select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL);
55
64
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
56
65
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    No tables used
57
66
Warnings:
58
67
Note    1003    select ln(exp(10)) AS `ln(exp(10))`,exp((ln(sqrt(10)) * 2)) AS `exp(ln(sqrt(10))*2)`,ln(-(1)) AS `ln(-1)`,ln(0) AS `ln(0)`,ln(NULL) AS `ln(NULL)`
59
68
select log2(8),log2(15),log2(-2),log2(0),log2(NULL);
60
 
ERROR 22012: Division by 0
 
69
log2(8) log2(15)        log2(-2)        log2(0) log2(NULL)
 
70
3       3.9068905956085187      NULL    NULL    NULL
 
71
Warnings:
 
72
Error   1365    Division by 0
 
73
Error   1365    Division by 0
61
74
explain extended select log2(8),log2(15),log2(-2),log2(0),log2(NULL);
62
75
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
63
76
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    No tables used
64
77
Warnings:
65
78
Note    1003    select log2(8) AS `log2(8)`,log2(15) AS `log2(15)`,log2(-(2)) AS `log2(-2)`,log2(0) AS `log2(0)`,log2(NULL) AS `log2(NULL)`
66
79
select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
67
 
ERROR 22012: Division by 0
 
80
log10(100)      log10(18)       log10(-4)       log10(0)        log10(NULL)
 
81
2       1.255272505103306       NULL    NULL    NULL
 
82
Warnings:
 
83
Error   1365    Division by 0
 
84
Error   1365    Division by 0
68
85
explain extended select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
69
86
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
70
87
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    No tables used
78
95
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    No tables used
79
96
Warnings:
80
97
Note    1003    select pow(10,log10(10)) AS `pow(10,log10(10))`,pow(2,4) AS `power(2,4)`
 
98
set @@rand_seed1=10000000,@@rand_seed2=1000000;
 
99
select rand(999999),rand();
 
100
rand(999999)    rand()
 
101
0.014231365187309091    0.028870999839968048
 
102
explain extended select rand(999999),rand();
 
103
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
 
104
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    No tables used
 
105
Warnings:
 
106
Note    1003    select rand(999999) AS `rand(999999)`,rand() AS `rand()`
81
107
select pi(),format(sin(pi()/2),6),format(cos(pi()/2),6),format(abs(tan(pi())),6),format(cot(1),6),format(asin(1),6),format(acos(0),6),format(atan(1),6);
82
108
pi()    format(sin(pi()/2),6)   format(cos(pi()/2),6)   format(abs(tan(pi())),6)        format(cot(1),6)        format(asin(1),6)       format(acos(0),6)       format(atan(1),6)
83
109
3.141593        1.000000        0.000000        0.000000        0.642093        1.570796        1.570796        0.785398
88
114
Note    1003    select pi() AS `pi()`,format(sin((pi() / 2)),6) AS `format(sin(pi()/2),6)`,format(cos((pi() / 2)),6) AS `format(cos(pi()/2),6)`,format(abs(tan(pi())),6) AS `format(abs(tan(pi())),6)`,format((1 / tan(1)),6) AS `format(cot(1),6)`,format(asin(1),6) AS `format(asin(1),6)`,format(acos(0),6) AS `format(acos(0),6)`,format(atan(1),6) AS `format(atan(1),6)`
89
115
select degrees(pi()),radians(360);
90
116
degrees(pi())   radians(360)
91
 
180     6.28318530717959
 
117
180     6.283185307179586
92
118
select format(atan(-2, 2), 6);
93
119
format(atan(-2, 2), 6)
94
120
-0.785398
106
132
0
107
133
SELECT ASIN(1.0);
108
134
ASIN(1.0)
109
 
1.5707963267949
 
135
1.5707963267948966
110
136
SELECT ACOS(0.2*5.0);
111
137
ACOS(0.2*5.0)
112
138
0
115
141
0
116
142
SELECT ASIN(0.8+0.2);
117
143
ASIN(0.8+0.2)
118
 
1.5707963267949
 
144
1.5707963267948966
119
145
SELECT ASIN(1.2-0.2);
120
146
ASIN(1.2-0.2)
121
 
1.5707963267949
 
147
1.5707963267948966
122
148
select format(4.55, 1), format(4.551, 1);
123
149
format(4.55, 1) format(4.551, 1)
124
150
4.6     4.6
127
153
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    No tables used
128
154
Warnings:
129
155
Note    1003    select degrees(pi()) AS `degrees(pi())`,radians(360) AS `radians(360)`
 
156
select rand(rand);
 
157
ERROR 42S22: Unknown column 'rand' in 'field list'
130
158
create table t1 (col1 int, col2 decimal(60,30));
131
159
insert into t1 values(1,1234567890.12345);
132
160
select format(col2,7) from t1;
150
178
show create table t1;
151
179
Table   Create Table
152
180
t1      CREATE TABLE `t1` (
153
 
  `round(1, 6)` INT NOT NULL
154
 
) ENGINE=X COLLATE = utf8_general_ci
 
181
  `round(1, 6)` int NOT NULL
 
182
) ENGINE=X
155
183
select * from t1;
156
184
round(1, 6)
157
185
1
159
187
select abs(-2) * -2;
160
188
abs(-2) * -2
161
189
-4
 
190
CREATE TABLE t1 (a INT);
 
191
INSERT INTO t1 VALUES (1),(1),(1),(2);
 
192
SELECT RAND(2) * 1000, RAND(a) * 1000 FROM t1;
 
193
RAND(2) * 1000  RAND(a) * 1000
 
194
655.5866465490186       405.40353712197725
 
195
122.34661925802624      405.40353712197725
 
196
644.97318737672 405.40353712197725
 
197
857.8261098431667       655.5866465490186
 
198
SELECT RAND(2) * 1000, RAND(a) * 1000 FROM t1 WHERE a = 1;
 
199
RAND(2) * 1000  RAND(a) * 1000
 
200
655.5866465490186       405.40353712197725
 
201
122.34661925802624      405.40353712197725
 
202
644.97318737672 405.40353712197725
 
203
INSERT INTO t1 VALUES (3);
 
204
SELECT RAND(2) * 1000, RAND(a) * 1000 FROM t1;
 
205
RAND(2) * 1000  RAND(a) * 1000
 
206
655.5866465490186       405.40353712197725
 
207
122.34661925802624      405.40353712197725
 
208
644.97318737672 405.40353712197725
 
209
857.8261098431667       655.5866465490186
 
210
354.21101781931804      905.7697559760601
 
211
SELECT RAND(2) * 1000, RAND(a) * 1000 FROM t1 WHERE a = 1;
 
212
RAND(2) * 1000  RAND(a) * 1000
 
213
655.5866465490186       405.40353712197725
 
214
122.34661925802624      405.40353712197725
 
215
644.97318737672 405.40353712197725
 
216
DROP TABLE t1;
 
217
create table t1 (a varchar(90), ts datetime not null, index (a)) engine=innodb;
 
218
insert into t1 values ('http://www.foo.com/', now());
 
219
select a from t1 where a='http://www.foo.com/' order by abs(timediff(ts, 0));
 
220
a
 
221
http://www.foo.com/
 
222
drop table t1;
162
223
select round(111,-10);
163
224
round(111,-10)
164
225
0
174
235
select truncate(15000111000111000155,-1);
175
236
truncate(15000111000111000155,-1)
176
237
15000111000111000150
177
 
create TEMPORARY table t1
 
238
create table t1
178
239
(f1 varchar(32) not null,
179
240
f2 int not null,
180
241
f3 int not null default '0')
181
242
engine=myisam;
182
243
insert into t1 values ('zombie',0,0),('gold',1,10000),('silver',2,10000);
183
 
create TEMPORARY table t2
 
244
create table t2
184
245
(f1 int not null,
185
246
f2 int not null,
186
247
f3 int not null)