Bugzilla – Attachment 83980 Details for
Bug 18736
Problems in order calculations (rounding errors)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18736: (follow-up) cast as UNSIGNED instead of INTEGER
Bug-18736-follow-up-cast-as-UNSIGNED-instead-of-IN.patch (text/plain), 1.72 KB, created by
Nick Clemens (kidclamp)
on 2019-01-15 15:17:40 UTC
(
hide
)
Description:
Bug 18736: (follow-up) cast as UNSIGNED instead of INTEGER
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2019-01-15 15:17:40 UTC
Size:
1.72 KB
patch
obsolete
>From 6776331ce44b4680fc1bc65a7bc203aed0f4d865 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Sun, 16 Sep 2018 01:21:16 +0000 >Subject: [PATCH] Bug 18736: (follow-up) cast as UNSIGNED instead of INTEGER > >More recent MySql versions require the use of SIGNED or UNSIGNED rather >than INTEGER. UNSIGNED will still work in older installs > >Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> >--- > C4/Acquisition.pm | 2 +- > C4/Budgets.pm | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index 0bb9610e02..d58d3bd7ef 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -2010,7 +2010,7 @@ returns the correct SQL routine based on OrderPriceRounding system preference. > sub _get_rounding_sql { > my ( $round_string ) = @_; > my $rounding_pref = C4::Context->preference('OrderPriceRounding'); >- if ( $rounding_pref eq "nearest_cent" ) { return ("CAST($round_string*100 AS INTEGER)/100"); } >+ if ( $rounding_pref eq "nearest_cent" ) { return ("CAST($round_string*100 AS UNSIGNED)/100"); } > else { return ("$round_string"); } > } > >diff --git a/C4/Budgets.pm b/C4/Budgets.pm >index 6e3887b549..870d8d277c 100644 >--- a/C4/Budgets.pm >+++ b/C4/Budgets.pm >@@ -1364,7 +1364,7 @@ returns the correct SQL routine based on OrderPriceRounding system preference. > sub _get_rounding_sql { > my $to_round = shift; > my $rounding_pref = C4::Context->preference('OrderPriceRounding'); >- if ($rounding_pref eq 'nearest_cent') { return "CAST($to_round*100 AS INTEGER)/100"; } >+ if ($rounding_pref eq 'nearest_cent') { return "CAST($to_round*100 AS UNSIGNED)/100"; } > else { return "$to_round"; } > } > >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18736
:
64061
|
64065
|
70187
|
70188
|
70189
|
70768
|
71062
|
71063
|
71627
|
71628
|
71629
|
71630
|
71631
|
71632
|
74335
|
74336
|
74337
|
74338
|
74339
|
74340
|
74341
|
74342
|
74370
|
74371
|
74374
|
74397
|
74398
|
74422
|
74427
|
74438
|
76979
|
76980
|
76981
|
76982
|
76983
|
76984
|
76985
|
76986
|
76987
|
76988
|
76989
|
76990
|
76991
|
77614
|
77615
|
77616
|
77617
|
77618
|
78101
|
78120
|
78981
|
78982
|
78983
|
78984
|
78985
|
78986
|
78987
|
78988
|
79087
|
79088
|
79089
|
79090
|
79091
|
79092
|
79093
|
79094
|
79098
|
79099
|
79100
|
79101
|
79102
|
79103
|
79104
|
79105
|
79187
|
79223
|
79562
|
79563
|
82967
|
82968
|
82969
|
82970
|
82971
|
82972
|
82973
|
82974
|
82975
|
82976
|
82977
|
83212
|
83213
|
83214
|
83973
|
83974
|
83975
|
83976
|
83977
|
83978
|
83979
|
83980
|
83981
|
83982
|
83983
|
83984
|
83985
|
86646
|
86647
|
86648
|
86649
|
86650
|
86651
|
86652
|
86653
|
86654
|
86655
|
86656
|
86657
|
86658