Bug #45293 Conversion on "x86" supports bigger precision than expected (funcs_1.storedproc)
Submitted: 3 Jun 2009 10:18 Modified: 23 Jul 2009 10:21
Reporter: Joerg Bruehe Email Updates:
Status: Verified Impact on me:
None 
Category:Tests: Server Severity:S3 (Non-critical)
Version:5.1.31 and up OS:Any (Using x86, not OS X)
Assigned to: Bernt Marius Johnsen CPU Architecture:Any
Tags: disabled, pb2, test failure, tf54
Triage: Triaged: D2 (Serious)

[3 Jun 2009 10:18] Joerg Bruehe
Description:
It seems this bug went unreported ...

In all current builds of 5.1, starting with 5.1.31, we have this test failure:

=====
funcs_1.storedproc                       [ retry-fail ]
        Test ended at YYYY-MM-DD HH:MM:SS

CURRENT_TEST: funcs_1.storedproc
--- /PATH/mysql-test/suite/funcs_1/r/storedproc.result
+++ /PATH/mysql-test/suite/funcs_1/r/storedproc.reject
@@ -18241,8 +18241,6 @@
 CALL sp70_n(-1e+40);
 f1
 -10000000000000000000000000000000000000000
-Warnings:
-Note   1265    Data truncated for column 'f1' at row 1
 CALL sp70_n( -10000000000000000000000000000000000000000 );
 f1
 -10000000000000000000000000000000000000000
@@ -18255,8 +18253,6 @@
 CALL sp71_nu(1.00e+40);
 f1
 10000000000000000000000000000000000000000
-Warnings:
-Note   1265    Data truncated for column 'f1' at row 1
 CALL sp71_nu( 10000000000000000000000000000000000000000 );
 f1
 10000000000000000000000000000000000000000
@@ -18269,8 +18265,6 @@
 CALL sp72_nuz(1.00e+40);
 f1
 0000000000000000000000010000000000000000000000000000000000000000
-Warnings:
-Note   1265    Data truncated for column 'f1' at row 1
 CALL sp72_nuz( 10000000000000000000000000000000000000000 );
 f1
 0000000000000000000000010000000000000000000000000000000000000000
@@ -18283,8 +18277,6 @@
 CALL sp73_n_z(1.00e+40);
 f1
 0000000000000000000000010000000000000000000000000000000000000000
-Warnings:
-Note   1265    Data truncated for column 'f1' at row 1
 CALL sp73_n_z( 10000000000000000000000000000000000000000 );
 f1
 0000000000000000000000010000000000000000000000000000000000000000

mysqltest: Result content mismatch

 - saving '/PATH/mysql-test/var/log/funcs_1.storedproc/' to '/PATH/mysql-test/var/log/funcs_1.storedproc/'

Test has failed 2 times, no more retries!
=====

How to repeat:
Run the test suite ...

Suggested fix:
I'm not sure it is a problem if an expected (and tolerated) truncation doesn't happen. Note that it is only expected if the value is given in E-notation; giving the same value in integer notation passes without any warning on all platforms.

However, it is a problem in building if a test fails.

Assuming the non-truncation does not indicate a problem, I propose to just suppress the warning.
[16 Jun 2009 10:22] Alexander Nozdrin
It fails in PB2 on test-max-win_ws2008-x86_64
with the following symptoms:
--------------------------------------------------------
@@ -16799,7 +16799,7 @@
 END//
 SELECT fn50(4.29e+09);
 fn50(4.29e+09)
-4290000000
+2147483648
 DROP FUNCTION IF EXISTS fn51;
 CREATE FUNCTION fn51( f1 int unsigned zerofill) returns int unsigned zerofill
 BEGIN
@@ -16808,7 +16808,7 @@
 END//
 SELECT fn51(4.29e+09);
 fn51(4.29e+09)
-4290000000
+2147483648
 DROP FUNCTION IF EXISTS fn52;
 CREATE FUNCTION fn52( f1 int zerofill) returns int zerofill
 BEGIN
@@ -17930,7 +17930,7 @@
 END//
 CALL sp50(4.29e+09);
 f1
-4290000000
+2147483648
 DROP PROCEDURE IF EXISTS sp51;
 CREATE PROCEDURE sp51( f1 int unsigned zerofill)
 BEGIN
@@ -17939,7 +17939,7 @@
 END//
 CALL sp51(4.29e+09);
 f1
-4290000000
+2147483648
 DROP PROCEDURE IF EXISTS sp52;
 CREATE PROCEDURE sp52( f1 int zerofill)
 BEGIN
@@ -21392,9 +21392,9 @@
 END//
 CALL spexecute81();
 f1	f2	f3	f4	f5	f6	f7	f8	f9	f10	f11	f12
-4290000000	4290000000	4290000010	-9220000000000000000	6744073709551616	6744073709551616	-9220000000000000000	6744073709551616	6744073709551616	-9220000000000000000	6744073709551616	6744073709551616
+2147483648	2147483648	2147483658	-9220000000000000000	6744073709551616	6744073709551616	-9220000000000000000	6744073709551616	6744073709551616	-9220000000000000000	6744073709551616	6744073709551616
 var1	var2	var3	var4	var5	var6	var7	var8
-4290000000	4290000010	6744073709551616	6744073709551616	6744073709551616	6744073709551616	6744073709551616	6744073709551616
+2147483648	2147483658	6744073709551616	6744073709551616	6744073709551616	6744073709551616	6744073709551616	6744073709551616
 DROP PROCEDURE spexecute81;
 DROP PROCEDURE sp81;
 DROP PROCEDURE IF EXISTS sp82;
@@ -21426,9 +21426,9 @@
 END//
 CALL spexecute82();
 f1	f2	f3	f4	f5	f6	f7	f8	f9	f10	f11	f12
-4290000000	4290000000	4290000010	-9220000000000000000	6744073709551616	6744073709551616	-9220000000000000000	6744073709551616	6744073709551616	-9220000000000000000	6744073709551616	6744073709551616
+2147483648	2147483648	2147483658	-9220000000000000000	6744073709551616	6744073709551616	-9220000000000000000	6744073709551616	6744073709551616	-9220000000000000000	6744073709551616	6744073709551616
 var1	var2	var3	var4	var5	var6	var7	var8
-4290000000	4290000010	6744073709551616	6744073709551616	6744073709551616	6744073709551616	6744073709551616	6744073709551616
+2147483648	2147483658	6744073709551616	6744073709551616	6744073709551616	6744073709551616	6744073709551616	6744073709551616
 DROP PROCEDURE spexecute82;
 DROP PROCEDURE sp82;
 DROP PROCEDURE IF EXISTS sp83;
--------------------------------------------------------
[23 Jun 2009 12:05] Bernt Marius Johnsen
The Win64 behaviour is reported in Bug#37746. I proceed with the supression of warnings that Horst suggested.
[23 Jun 2009 12:32] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/76915

2973 Bernt M. Johnsen	2009-06-23
      Bug#45293 Supressed some warnings
[23 Jun 2009 12:33] Bernt Marius Johnsen
Supressed warnings (And By the way.... it was Joerg that suggested the solution, sorry).
[23 Jun 2009 13:38] Matthias Leich
ok to push
- The code changes fix the problem in a correct way.
- storedproc.test passed my test checking with
  - high load on testing box
  - various MTR options
  This was just for checking if there are other
  unknown weaknesses outside of this bug.
[24 Jun 2009 10:56] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/77015

2973 Bernt M. Johnsen	2009-06-24 [merge]
      Bug#45293 Prepared on 5.1 gca branch
[24 Jun 2009 11:08] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/77018

3391 Bernt M. Johnsen	2009-06-24 [merge]
      Bug#45293 Prepared on pe (5.4) gca branch
[8 Jul 2009 13:30] Bugs System
Pushed into 5.1.37 (revid:joro@sun.com-20090708131116-kyz8iotbum8w9yic) (version source revid:bernt.johnsen@sun.com-20090624105553-k08jof6bph9o3opr) (merge vers: 5.1.37) (pib:11)
[9 Jul 2009 7:36] Bugs System
Pushed into 5.1.37 (revid:joro@sun.com-20090708131116-kyz8iotbum8w9yic) (version source revid:bernt.johnsen@sun.com-20090624105553-k08jof6bph9o3opr) (merge vers: 5.1.37) (pib:11)
[10 Jul 2009 11:20] Bugs System
Pushed into 5.4.4-alpha (revid:anozdrin@bk-internal.mysql.com-20090710111017-bnh2cau84ug1hvei) (version source revid:bernt.johnsen@sun.com-20090624111522-2uac6amfbn3491ao) (merge vers: 5.4.4-alpha) (pib:11)
[10 Jul 2009 15:22] Paul Dubois
Test case changes. No changelog entry needed.
[23 Jul 2009 10:21] Alexander Nozdrin
Re-opening, since suite/funcs_1/t/storedproc.test
still has disabled pieces due to this bug.
[26 Aug 2009 13:46] Bugs System
Pushed into 5.1.37-ndb-7.0.8 (revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (version source revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (merge vers: 5.1.37-ndb-7.0.8) (pib:11)
[26 Aug 2009 13:46] Bugs System
Pushed into 5.1.37-ndb-6.3.27 (revid:jonas@mysql.com-20090826105955-bkj027t47gfbamnc) (version source revid:jonas@mysql.com-20090826105955-bkj027t47gfbamnc) (merge vers: 5.1.37-ndb-6.3.27) (pib:11)
[26 Aug 2009 13:48] Bugs System
Pushed into 5.1.37-ndb-6.2.19 (revid:jonas@mysql.com-20090825194404-37rtosk049t9koc4) (version source revid:jonas@mysql.com-20090825194404-37rtosk049t9koc4) (merge vers: 5.1.37-ndb-6.2.19) (pib:11)
[27 Aug 2009 16:32] Bugs System
Pushed into 5.1.35-ndb-7.1.0 (revid:magnus.blaudd@sun.com-20090827163030-6o3kk6r2oua159hr) (version source revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (merge vers: 5.1.37-ndb-7.0.8) (pib:11)
[21 Oct 2015 22:23] Emmanuel ROY
why it's truncation not duplication of a bit ?
I don't understand all, but it could be usefull for me to understand ...