Hello All!

 left(),right(),mid(),etc functions
+
 with fixed point return value for function (or out parameter for sp)
---------------
 result has been truncated

How to repeat:
--------------------
mysql> drop function if exists test;
mysql> drop function if exists test1;
mysql> delimiter //
mysql> create function test () returns numeric(7,2) return left('77.247',5)//
mysql> create function test1 () returns numeric(7,2) return '77.247'//
mysql> delimiter ;
mysql> select test(),test1();
+--------+---------+
| test() | test1() |
+--------+---------+
|  77.00 |   77.25 |
+--------+---------+
1 row in set (0.02 sec)

How to correct:
use global variable as intermediate storage (with side effect)
--------------------
mysql> drop function if exists test;
mysql> delimiter //
mysql> create function test () returns numeric(7,2) return 
@z:=left('77.247',5)//
mysql> delimiter ;
mysql> select test(),test1();
+--------+---------+
| test() | test1() |
+--------+---------+
|  77.24 |   77.25 |
+--------+---------+
1 row in set (0.00 sec)


Is it a known bug?

WBR, Juri.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to