~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/func_math.test

  • 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:
17
17
select round(5.64,1),round(5.64,2),round(5.64,-1),round(5.64,-2);
18
18
select abs(-10), sign(-5), sign(5), sign(0);
19
19
explain extended select abs(-10), sign(-5), sign(5), sign(0);
 
20
--error ER_DIVISION_BY_ZERO
20
21
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);
21
22
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);
 
23
--error ER_DIVISION_BY_ZERO
22
24
select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL);
23
25
explain extended select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL);
 
26
--error ER_DIVISION_BY_ZERO
24
27
select log2(8),log2(15),log2(-2),log2(0),log2(NULL);
25
28
explain extended select log2(8),log2(15),log2(-2),log2(0),log2(NULL);
 
29
--error ER_DIVISION_BY_ZERO
26
30
select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
27
31
explain extended select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
28
32
select pow(10,log10(10)),power(2,4);
29
33
explain extended select pow(10,log10(10)),power(2,4);
30
 
explain extended select rand(999999),rand();
31
34
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);
32
35
explain extended 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);
33
36
select degrees(pi()),radians(360);
64
67
 
65
68
explain extended select degrees(pi()),radians(360);
66
69
 
67
 
#
68
 
# Bug #7281: problem with rand()
69
 
#
70
 
 
71
 
--error 1054
72
 
select rand(rand);
73
 
 
74
70
# End of 4.1 tests
75
71
 
76
72
#
106
102
#
107
103
select abs(-2) * -2;
108
104
 
109
 
#
110
 
# Bug #6172 RAND(a) should only accept constant values as arguments
111
 
#
112
 
CREATE TABLE t1 (a INT);
113
 
 
114
 
INSERT INTO t1 VALUES (1),(1),(1),(2);
115
 
SELECT RAND(2) * 1000, RAND(a) * 1000 FROM t1;
116
 
SELECT RAND(2) * 1000, RAND(a) * 1000 FROM t1 WHERE a = 1;
117
 
INSERT INTO t1 VALUES (3);
118
 
SELECT RAND(2) * 1000, RAND(a) * 1000 FROM t1;
119
 
SELECT RAND(2) * 1000, RAND(a) * 1000 FROM t1 WHERE a = 1;
120
 
 
121
 
DROP TABLE t1;  
122
 
 
123
105
# End of 4.1 tests
124
106
 
125
107
#