We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3bb3785 commit 2f67801Copy full SHA for 2f67801
sql/item_sum.cc
@@ -1,4 +1,4 @@
1
-/* Copyright (c) 2000, 2023, Oracle and/or its affiliates.
+/* Copyright (c) 2000, 2024, Oracle and/or its affiliates.
2
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License, version 2.0,
@@ -1728,7 +1728,7 @@ void Item_sum_avg::fix_length_and_dec()
1728
decimals,
1729
unsigned_flag);
1730
f_precision= min(precision+DECIMAL_LONGLONG_DIGITS, DECIMAL_MAX_PRECISION);
1731
- f_scale= args[0]->decimals;
+ f_scale = min<uint>(args[0]->decimals, f_precision);
1732
dec_bin_size= my_decimal_get_binary_size(f_precision, f_scale);
1733
}
1734
else {
0 commit comments