mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
38090df9b5
- unsigned flag was not handled correctly for a number of mathematical funcions, which led to incorrect results - passing large values as the number of decimals to ROUND() resulted in incorrect results and even server crashes in some cases - reverted the fix and the testcase for bug #10083 as it violates the manual - fixed some testcases which relied on broken ROUND() behavior mysql-test/r/func_math.result: - Removed the testcase for bug #10083 (not a bug according to the manual) - Changed the testcase for bug #9837 to expect a correct ROUND() behavior - Added testcases for bug #24912 and all related bugs found mysql-test/r/type_newdecimal.result: Fixed a truncate() testcase which relied on broken behavior mysql-test/t/func_math.test: - Removed the testcase for bug #10083 (not a bug according to the manual) - Changed the testcase for bug #9837 to expect a correct ROUND() behavior - Added testcases for bug #24912 and all related bugs found sql/item_func.cc: Various changes to fix bug #24912 and all related bugs found: - honor unsigned_flag in various Item_* functions - correctly handle out-of-range numbers of decimals in Item_func_round::fix_length_and_dec() - changed the argument specifying the number of decimals in my_double_round() from int to longlong, added a new argument to pass the 'unsigned flag' - changed my_double_round() to correctly handle large values passed as the 'number of decimals' argument - added a my_double_round() analog for BIGINT UNSIGNED arguments (my_unsigned_round()) - fixed Item_func_round()::int_op() to not overflow even when the result is within integer range - fixed a bug Item_founc_round()::decimal_op() which resulted in crash when a large number of decimals was passed to my_decimal_round() sql/item_func.h: Various fixed to correctly handle unsigned values. sql/item_strfunc.cc: Changed the call to my_double_round() to match the new declaration. sql/mysql_priv.h: Changed the declaration for my_double_round() to be able pass arbitrary integers as number of decimals (both signed and unsigned)
35 lines
1.2 KiB
Text
35 lines
1.2 KiB
Text
set autocommit=1;
|
|
reset master;
|
|
create table bug16206 (a int);
|
|
insert into bug16206 values(1);
|
|
start transaction;
|
|
insert into bug16206 values(2);
|
|
commit;
|
|
show binlog events;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4
|
|
f n Query 1 n use `test`; create table bug16206 (a int)
|
|
f n Query 1 n use `test`; insert into bug16206 values(1)
|
|
f n Query 1 n use `test`; insert into bug16206 values(2)
|
|
drop table bug16206;
|
|
reset master;
|
|
create table bug16206 (a int) engine= bdb;
|
|
insert into bug16206 values(0);
|
|
insert into bug16206 values(1);
|
|
start transaction;
|
|
insert into bug16206 values(2);
|
|
commit;
|
|
insert into bug16206 values(3);
|
|
show binlog events;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4
|
|
f n Query 1 n use `test`; create table bug16206 (a int) engine= bdb
|
|
f n Query 1 n use `test`; insert into bug16206 values(0)
|
|
f n Query 1 n use `test`; insert into bug16206 values(1)
|
|
f n Query 1 n use `test`; BEGIN
|
|
f n Query 1 n use `test`; insert into bug16206 values(2)
|
|
f n Query 1 n use `test`; COMMIT
|
|
f n Query 1 n use `test`; insert into bug16206 values(3)
|
|
drop table bug16206;
|
|
set autocommit=0;
|
|
End of 5.0 tests
|