1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Bug#45152 crash with round() function on longtext column in a derived table

The crash happens due to wrong max_length value which is set on
Item_func_round::fix_length_and_dec() stage. The value is set to
args[0]->max_length which is too big in case of LONGTEXT(LONGBLOB) fields.
The fix is to set max_length using float_length() function.
This commit is contained in:
Sergey Glukhov
2009-06-02 11:38:13 +05:00
parent 8787989473
commit 83ec6e0592
3 changed files with 18 additions and 2 deletions

View File

@ -390,4 +390,11 @@ a ROUND(a)
-1e+16 -10000000000000002
1e+16 10000000000000002
DROP TABLE t1;
CREATE TABLE t1(f1 LONGTEXT) engine=myisam;
INSERT INTO t1 VALUES ('a');
SELECT 1 FROM (SELECT ROUND(f1) AS a FROM t1) AS s WHERE a LIKE 'a';
1
SELECT 1 FROM (SELECT ROUND(f1, f1) AS a FROM t1) AS s WHERE a LIKE 'a';
1
DROP TABLE t1;
End of 5.0 tests