summaryrefslogtreecommitdiff
path: root/mysql-test/r/func_math.result
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '5.5' into 10.0Sergei Golubchik2016-08-101-2/+8
|\
| * MDEV-10467 Assertion `nr >= 0.0' failed in Item_sum_std::val_real()Alexander Barkov2016-08-031-0/+12
| | | | | | | | Backporting MDEV-5781 from 10.0.
* | Merge branch '5.5' into 10.0Sergei Golubchik2016-04-261-2/+7
|\ \ | |/
| * another test case for ER_DATA_OUT_OF_RANGE on insertSergei Golubchik2016-04-201-0/+5
| | | | | | | | tests it with a non-const table too
| * Merge branch 'mysql/5.5' into 5.5Sergei Golubchik2016-04-201-2/+2
| |\
| | * Bug#21682356: STOP INJECTING DATA ITEMS IN AN ERROR MESSAGEKnut Anders Hatlen2016-01-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GENERATED BY THE EXP() FUNCTION When generating the error message for numeric overflow, pass a flag to Item::print() that prevents it from expanding constant expressions and parameters to the values they evaluate to. For consistency, also pass the flag to Item::print() when Item_func_spatial_collection::fix_length_and_dec() generates an error message. It doesn't make any difference at the moment, since constant expressions haven't been evaluated yet when this function is called.
| | * Bug#16084594 USER_VAR ITEM IN 'LOAD FILE QUERY' WAS NOTVenkatesh Duggirala2013-01-281-4/+4
| | |\ | | | | | | | | | | | | PROPERLY QUOTED IN BINLOG FILE Merging fix from mysql-5.1
| | * | Bug#12711164 - 61676: RESULT OF DIV WITH DECIMAL AND INTEGER DOES NOT MAKE ↵Tor Didriksen2011-07-181-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | SENSE Truncate result of decimal division before converting to integer.
| | * | Bug#12537160 ASSERTION FAILED: STOP0 <= &TO->BUF[TO->LEN] WITH LARGE NUMBER.Tor Didriksen2011-07-181-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | Turns out the DBUG_ASSERT added by fix for Bug#11792200 was overly pessimistic: 'stop0' is used in the main loop of do_div_mod, but we only dereference 'buf0' for div operations, not for mod.
| | * | 5.1 -> 5.5 mergeSergey Glukhov2011-05-261-0/+6
| | |\ \ | | | |/
| | | * Bug#12392636 ASSERTION FAILED: SCALE >= 0 && PRECISION > 0 && SCALE <= PRECISIONSergey Glukhov2011-05-261-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | Assertion happens due to missing NULL value check in Item_func_round::fix_length_and_dec() function. The fix: added NULL value check for second parameter.
| | * | 5.1 -> 5.5 mergeSergey Glukhov2011-04-201-0/+22
| | |\ \ | | | |/
| | | * Bug#11765923 58937: MANY VALGRIND ERRORS AFTER GROUPING BY RESULT OF ↵Sergey Glukhov2011-04-201-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DECIMAL COLUMN FUNCTION Bug#11764671 57533: UNINITIALISED VALUES IN COPY_AND_CONVERT (SQL_STRING.CC) WITH CERTAIN CHA When ROUND evaluates decimal result it uses Item::decimal value as fraction value for the result. In some cases Item::decimal is greater than real result fraction value and uninitialised memory of result(decimal) buffer can be used in further calculations. Issue is introduced by Bug33143 fix. The fix is to remove erroneous assignment.
| | * | 5.1 -> 5.5 mergeSergey Glukhov2011-03-281-0/+7
| | |\ \ | | | |/
| | | * Bug#11764994 57900: CREATE TABLE .. SELECT ASSERTS SCALE >= 0 && PRECISION ↵Sergey Glukhov2011-03-281-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > 0 && SCALE <= PR Assert fails due to overflow which happens in Item_func_int_val::fix_num_length_and_dec() as geometry functions have max_length value equal to max_field_size(4294967295U). The fix is to skip max_length calculation for some boundary cases.
| | * | Bug #11792200 - DIVIDING LARGE NUMBERS CAUSES STACK CORRUPTIONSTor Didriksen2011-03-031-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This was a buffer overrun in do_div_mod(), overwriting the internal buffer of auto variable 'tmp' in Item_func_int_div::val_int. Result on windows: 'this' is set to zero, and crash. Ran fine on other platforms (no valgrind warnings), but this is undefined behaviour on any platform of course.
| | * | Bug #59498 div function broken in mysql-trunkTor Didriksen2011-01-141-0/+6
| | | |
| | * | Bug #59241 invalid memory read in do_div_mod with doubly assigned variablesTor Didriksen2011-01-141-0/+9
| | | | | | | | | | | | | | | | Fix: copy my_decimal by value, to avoid dangling pointers.
| | * | 5.1-bugteam->5.5-bugteam mergeSergey Glukhov2010-12-241-0/+13
| | |\ \ | | | |/
| | | * Bug#57810 case/when/then : Assertion failed: length || !scaleSergey Glukhov2010-12-241-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ASSERT happens due to improper calculation of the max_length in Item_func_div object, if dividend has max_length == 0 then Item_func_div::max_length is set to 0 under some circumstances. The fix: If decimals == NOT_FIXED_DEC then set Item_func_div::max_length to max possible DOUBLE length value.
| | * | mergeGeorgi Kodinov2010-11-261-0/+12
| | |\ \ | | | |/
| | | * Bug#57477 SIGFPE when dividing a huge number a negative numberSergey Glukhov2010-10-271-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is dividing by const value when the result is out of supported range. The fix: -return LONGLONG_MIN if the result is out of supported range for DIV operator. -return 0 if divisor is -1 for MOD operator.
| | * | Bug #58137 char(0) column cause: my_gcvt: Assertion `width > 0 && to != ↵Tor Didriksen2010-11-171-0/+9
| | | | | | | | | | | | | | | | ((void *)0)' failed
| | * | Bug#57209 valgrind + Assertion failed: dst > bufTor Didriksen2010-10-081-0/+7
| | | | | | | | | | | | | | | | Buffer overrun when trying to format DBL_MAX
| | * | Manual merge.Alexey Kopytov2010-03-191-16/+120
| | |\ \
| | | * | Bug #8433: Overflow must be an error Alexey Kopytov2010-03-181-16/+120
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All numeric operators and functions on integer, floating point and DECIMAL values now throw an 'out of range' error rather than returning an incorrect value or NULL, when the result is out of supported range for the corresponding data type. Some test cases in the test suite had to be updated accordingly either because the test case itself relied on a value returned in case of a numeric overflow, or because a numeric overflow was the root cause of the corresponding bugs. The latter tests are no longer relevant, since the expressions used to trigger the corresponding bugs are not valid anymore. However, such test cases have been adjusted and kept "for the record".
| | * | Backport of WL #2934: Make/find library for doing float/double Alexey Kopytov2009-12-221-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to string conversions and vice versa" Initial import of the dtoa.c code and custom wrappers around it to allow its usage from the server code. Conversion of FLOAT/DOUBLE values to DECIMAL ones or strings and vice versa has been significantly reworked. As the new algoritms are more precise than the older ones, results of such conversions may not always match those obtained from older server versions. This in turn may break compatibility for some applications. This patch also fixes the following bugs: - bug #12860 "Difference in zero padding of exponent between Unix and Windows" - bug #21497 "DOUBLE truncated to unusable value" - bug #26788 "mysqld (debug) aborts when inserting specific numbers into char fields" - bug #24541 "Data truncated..." on decimal type columns without any good reason"
| | * | Merged from mysql-next-mr-bugfixing.Alexey Kopytov2009-11-211-0/+2
| | |\ \ | | | | | | | | | | | | | | | Updated the result file for func_math.
| | | * | This is a backport of the two patches for Bug #28299: Staale Smedseng2009-10-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To-number conversion warnings work differenly with CHAR and VARCHAR sp variables. The original revision-IDs are: staale.smedseng@sun.com-20081124095339-2qdvzkp0rn1ljs30 staale.smedseng@sun.com-20081125104611-rtxic5d12e83ag2o The patch provides ER_TRUNCATED_WRONG_VALUE warning messages for conversion of VARCHAR to numberic values, in line with messages provided for CHAR conversions. Conversions are checked for success, and the message is emitted in case failure. The tests are amended to accept the added warning messages, and explicit conversion of ON/OFF values is added for statements checking system variables. In test rpl.rpl_switch_stm_row_mixed checking for warnings is temporarily disabled for one statement, as this generates warning messages for strings that vary between executions.
| | * | | Backport of the patch for bug #8457 "Precision math: DIV Alexey Kopytov2009-10-131-0/+11
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | returns incorrect result with large decimal value" For the DIV operator, neither operands nor result were checked for integer overflows. This patch changes the DIV behavior for non-integer operands as follows: if either of the operands has a non-integer type, convert both operands to the DECIMAL type, then calculate the division using DECIMAL arithmetics. Convert the resulting DECIMAL value into BIGINT [UNSIGNED] if it fits into the corresponding range, or throw an 'out of range' error otherwise.
| | * | WL#2110 (SIGNAL)Marc Alff2009-09-101-5/+5
| | |/ | | | | | | | | | | | | | | | | | | WL#2265 (RESIGNAL) Manual merge of SIGNAL and RESIGNAL to mysql-trunk-signal, plus required dependencies.
| | * 5.0-bugteam->5.1-bugteam mergeSergey Glukhov2009-06-021-0/+7
| | |\
| | | * Bug#45152 crash with round() function on longtext column in a derived tableSergey Glukhov2009-06-021-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The crash happens due to wrong max_length value which is set on Item_func_round::fix_length_and_dec() stage. The value is set to args[0]->max_length which is too big in case of LONGTEXT(LONGBLOB) fields. The fix is to set max_length using float_length() function.
| | * | Bug #44768: SIGFPE crash when selecting rand from a view containing nullGleb Shchepa2009-05-181-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The RAND(N) function where the N is a field of "constant" table (table of single row) failed with a SIGFPE. Evaluation of RAND(N) rely on constant status of its argument. Current server "seeded" random value for each constant argument only once, in the Item_func_rand::fix_fields method. Then the server skipped a call to seed_random() in the Item_func_rand::val_real method for such constant arguments. However, non-constant state of an argument may be changed after the call to fix_fields, if an argument is a field of "constant" table. Thus, pre-initialization of random value in the fix_fields method is too early. Initialization of random value by seed_random() has been removed from Item_func_rand::fix_fields method. The Item_func_rand::val_real method has been modified to call seed_random() on the first evaluation of this method if an argument is a function.
| | * | Manual merge to 5.1.Alexey Kopytov2009-02-231-0/+30
| | |\ \ | | | |/
| | | * Fix for bug #15936: "round" differs on Windows to UnixAlexey Kopytov2009-02-231-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both of our own implementations of rint(3) were inconsistent with the most common behavior of rint() on those platforms that have it: round to nearest, break ties by rounding to nearest even. Fixed by leaving just one implementation of rint() in our source tree, and changing its behavior to match the most common native implementations on other platforms.
| | * | Merge into dev tree.Alexey Kopytov2009-02-101-5/+5
| | |\ \ | | | |/
| | | * Fix for bug #21205: Different number of digits for float/double/real in ↵Alexey Kopytov2009-01-281-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --ps-protocol Various parts of code used different 'precision' arguments for sprintf("%g") when converting floating point numbers to a string. This led to differences in results in some cases depending on whether the text-based or prepared statements protocol is used for a query. Fixed by changing arguments to sprintf("%g") to always be 15 (DBL_DIG) so that results are consistent regardless of the protocol. This patch will be null-merged to 6.0 as the problem does not exists there (fixed by the patch for WL#2934).
| | * | Fix for bug #31236: Inconsistent division by zero behavior for kaa@kaamos.(none)2008-02-201-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | floating point numbers Some math functions did not check if the result is a valid number (i.e. neither of +-inf or nan). Fixed by validating the result where necessary and returning NULL in case of invalid result.
| | * | merge 5.0-opt -> 5.1-optgkodinov/kgeorge@magare.gmz2007-10-011-8/+0
| | |\ \ | | | |/
| | | * removed undeterministic test result from the fux for bug 30587gkodinov/kgeorge@magare.gmz2007-10-011-8/+0
| | | |
| | | * fixed pb problem with the fix for bug 30587gkodinov/kgeorge@magare.gmz2007-10-011-4/+4
| | | |
| | * | Merge macbook:mysql/work/B30587-5.0-optgkodinov/kgeorge@magare.gmz2007-09-281-0/+46
| | |\ \ | | | |/ | | | | | | | | into magare.gmz:/home/kgeorge/mysql/work/B30587-5.1-opt
| | | * Bug #30587: mysql crashes when trying to group by TIME div NUMBERgkodinov/kgeorge@macbook.gmz2007-09-281-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When calculating the result length of an integer DIV function the number of decimals was used without checking the result type first. Thus an uninitialized number of decimals was used for some types. This caused an excessive amount of memory to be allocated for the field's buffer and crashed the server. Fixed by using the number of decimals only for data types that can have decimals and thus have valid decimals number.
| | * | Merge polly.local:/home/kaa/src/maint/bug24912/my50-bug24912kaa@polly.local2007-04-281-5/+90
| | |\ \ | | | |/ | | | | | | | | into polly.local:/home/kaa/src/maint/bug24912/my51-bug24912
| | | * Fix for bug #24912 "problems with bigint in abs() ceiling() round() ↵kaa@polly.local2007-04-281-5/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | truncate() mod()" and a number of related problems: - 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
| | * | Bug #6172: RAND(a) should only accept constant values as argumentsgkodinov/kgeorge@macbook.gmz2007-01-231-5/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RAND() must accept scalar expressions regardless of their kind. That includes both constant expressions and expressions that depend on column values. When the expression is constant the random seed can be initialized at compile time. However when the expression is not constant the random seed must be initialized at each invocation (while it still can be allocated at compile time). Implemented the above rules by extending Item_func_rand::val_real() to initialize the random seed at the correct place.
| | * | Bug#21114 (Foreign key creation fails to table with name format)malff/marcsql@weblab.(none)2006-11-021-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to the complexity of this change, everything is documented in WL#3565 This patch is the third iteration, it takes into account the comments received to date.
| | * | Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.1-optevgen@sunlight.local2006-08-011-26/+26
| | |\ \ | | | | | | | | | | | | | | | into sunlight.local:/local_work/tmp_merge-5.1-opt-mysql
| | | * | BUG#14940 "MySQL choose wrong index", v.2sergefp@mysql.com2006-07-281-26/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Make the range-et-al optimizer produce E(#table records after table condition is applied), - Make the join optimizer use this value, - Add "filtered" column to EXPLAIN EXTENDED to show fraction of records left after table condition is applied - Adjust test results, add comments