Commit 0b706e54 authored by Tor Didriksen's avatar Tor Didriksen

Bug#12985030 SIMPLE QUERY WITH DECIMAL NUMBERS LEAKS MEMORY

Re-write the test, to make pushbuild green.
Workaraound for broken pow() function on:
SunOS tyr40 5.10 Generic_127112-05 i86pc i386 i86pc

(dbx) where
current thread: t@1
=>[1] Item_func_pow::val_real(this = 0x238af20) (optimized), at 0xaa8d13 (line ~1980) in "item_func.cc"

(dbx) print pow(1.01, 1.0)
pow(1.01, 1) = 1.01
(dbx) print pow(1.01, 10.0)
pow(1.01, 10) = 1.1046221254112
(dbx) print pow(1.01, 100.0)
pow(1.01, 100) = 2.7048138294215
(dbx) print pow(1.01, 1000.0)
pow(1.01, 1000) = 20959.155637814
(dbx) print pow(1.01, 10000.0)
pow(1.01, 10000) = 1.635828711189e+43
(dbx) print pow(1.01, 100000.0)
pow(1.01, 100000) = Infinity
(dbx) print pow(1.01, 1000000.0)
pow(1.01, 1000000) = Infinity
(dbx) print pow(1.01, 10000000.0)
pow(1.01, 10000000) = Infinity
(dbx) print pow(1.01, 100000000.0)
pow(1.01, 100000000) = Infinity
(dbx) print pow(1.01, 1000000000.0)
pow(1.01, 1000000000) = 0.0
(dbx) print pow(1.01, 10000000000.0)
pow(1.01, 10000000000) = 0.0

(dbx) print value
value = 1.0111111111111
(dbx) print val2
val2 = 8796093022207.0

(dbx) print pow(value, val2)
pow(value, val2) = 0.0

so it seems pow(1.01, y)
returns Infinity for large y, but then starts to return 0.0 for even larger values of y.
parent cbde5cb8
......@@ -2803,8 +2803,8 @@ SELECT ((rpad(1.0,2048,1)) = ('4(') ^ (0.1));
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '4('
SELECT
pow((rpad(1.0,2048,1)),(b'1111111111111111111111111111111111111111111'));
ERROR 22003: DOUBLE value is out of range in 'pow(rpad(1.0,2048,1),0x07ffffffffff)'
pow((rpad(10.0,2048,1)),(b'1111111111111111111111111111111111111111111'));
ERROR 22003: DOUBLE value is out of range in 'pow(rpad(10.0,2048,1),0x07ffffffffff)'
SELECT ((rpad(1.0,2048,1)) + (0) ^ ('../'));
((rpad(1.0,2048,1)) + (0) ^ ('../'))
1.011111111111111
......
......@@ -1448,7 +1448,7 @@ SELECT ((rpad(1.0,2048,1)) = ('4(') ^ (0.1));
--error 1690
SELECT
pow((rpad(1.0,2048,1)),(b'1111111111111111111111111111111111111111111'));
pow((rpad(10.0,2048,1)),(b'1111111111111111111111111111111111111111111'));
SELECT ((rpad(1.0,2048,1)) + (0) ^ ('../'));
SELECT stddev_samp(rpad(1.0,2048,1));
SELECT ((127.1) not in ((rpad(1.0,2048,1)),(''),(-1.1)));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment