~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/func_math.result

  • Committer: Stewart Smith
  • Date: 2010-11-03 03:27:09 UTC
  • mto: (1902.1.1 build) (1910.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1903.
  • Revision ID: stewart@flamingspork.com-20101103032709-oyvfrc6eb8fzj0mr
fix docs warning: docs/unlock.rst:2: (WARNING/2) Title underline too short.

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
 
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      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
 
46
ERROR 22012: Division by 0
52
47
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);
53
48
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
54
49
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    No tables used
55
50
Warnings:
56
51
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)`
57
52
select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL);
58
 
ln(exp(10))     exp(ln(sqrt(10))*2)     ln(-1)  ln(0)   ln(NULL)
59
 
10      10      NULL    NULL    NULL
60
 
Warnings:
61
 
Error   1365    Division by 0
62
 
Error   1365    Division by 0
 
53
ERROR 22012: Division by 0
63
54
explain extended select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL);
64
55
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
65
56
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    No tables used
66
57
Warnings:
67
58
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)`
68
59
select log2(8),log2(15),log2(-2),log2(0),log2(NULL);
69
 
log2(8) log2(15)        log2(-2)        log2(0) log2(NULL)
70
 
3       3.90689059560852        NULL    NULL    NULL
71
 
Warnings:
72
 
Error   1365    Division by 0
73
 
Error   1365    Division by 0
 
60
ERROR 22012: Division by 0
74
61
explain extended select log2(8),log2(15),log2(-2),log2(0),log2(NULL);
75
62
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
76
63
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    No tables used
77
64
Warnings:
78
65
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)`
79
66
select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
80
 
log10(100)      log10(18)       log10(-4)       log10(0)        log10(NULL)
81
 
2       1.25527250510331        NULL    NULL    NULL
82
 
Warnings:
83
 
Error   1365    Division by 0
84
 
Error   1365    Division by 0
 
67
ERROR 22012: Division by 0
85
68
explain extended select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
86
69
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
87
70
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    No tables used
95
78
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    No tables used
96
79
Warnings:
97
80
Note    1003    select pow(10,log10(10)) AS `pow(10,log10(10))`,pow(2,4) AS `power(2,4)`
98
 
explain extended select rand(999999),rand();
99
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
100
 
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    No tables used
101
 
Warnings:
102
 
Note    1003    select rand(999999) AS `rand(999999)`,rand() AS `rand()`
103
81
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);
104
82
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)
105
83
3.141593        1.000000        0.000000        0.000000        0.642093        1.570796        1.570796        0.785398
149
127
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    No tables used
150
128
Warnings:
151
129
Note    1003    select degrees(pi()) AS `degrees(pi())`,radians(360) AS `radians(360)`
152
 
select rand(rand);
153
 
ERROR 42S22: Unknown column 'rand' in 'field list'
154
130
create table t1 (col1 int, col2 decimal(60,30));
155
131
insert into t1 values(1,1234567890.12345);
156
132
select format(col2,7) from t1;
174
150
show create table t1;
175
151
Table   Create Table
176
152
t1      CREATE TABLE `t1` (
177
 
  `round(1, 6)` int NOT NULL
178
 
) ENGINE=X
 
153
  `round(1, 6)` INT NOT NULL
 
154
) ENGINE=X COLLATE = utf8_general_ci
179
155
select * from t1;
180
156
round(1, 6)
181
157
1
183
159
select abs(-2) * -2;
184
160
abs(-2) * -2
185
161
-4
186
 
CREATE TABLE t1 (a INT);
187
 
INSERT INTO t1 VALUES (1),(1),(1),(2);
188
 
SELECT RAND(2) * 1000, RAND(a) * 1000 FROM t1;
189
 
RAND(2) * 1000  RAND(a) * 1000
190
 
655.586646549019        405.403537121977
191
 
122.346619258026        405.403537121977
192
 
644.97318737672 405.403537121977
193
 
857.826109843167        655.586646549019
194
 
SELECT RAND(2) * 1000, RAND(a) * 1000 FROM t1 WHERE a = 1;
195
 
RAND(2) * 1000  RAND(a) * 1000
196
 
655.586646549019        405.403537121977
197
 
122.346619258026        405.403537121977
198
 
644.97318737672 405.403537121977
199
 
INSERT INTO t1 VALUES (3);
200
 
SELECT RAND(2) * 1000, RAND(a) * 1000 FROM t1;
201
 
RAND(2) * 1000  RAND(a) * 1000
202
 
655.586646549019        405.403537121977
203
 
122.346619258026        405.403537121977
204
 
644.97318737672 405.403537121977
205
 
857.826109843167        655.586646549019
206
 
354.211017819318        905.76975597606
207
 
SELECT RAND(2) * 1000, RAND(a) * 1000 FROM t1 WHERE a = 1;
208
 
RAND(2) * 1000  RAND(a) * 1000
209
 
655.586646549019        405.403537121977
210
 
122.346619258026        405.403537121977
211
 
644.97318737672 405.403537121977
212
 
DROP TABLE t1;
213
162
select round(111,-10);
214
163
round(111,-10)
215
164
0