summaryrefslogtreecommitdiff
path: root/mysql-test/t/func_math.test
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '10.1' into 10.2Sergei Golubchik2016-09-091-3/+6
|\
| * Merge branch '10.0' into 10.1Sergei Golubchik2016-08-251-3/+6
| |\
| | * Merge branch '5.5' into 10.0Sergei Golubchik2016-08-101-3/+6
| | |\
| | | * 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.
* | | | test case for CRC32() SQL functionDaniel Black2016-08-051-0/+5
| | | |
* | | | Merge branch '10.1' into 10.2Sergei Golubchik2016-06-301-0/+8
|\ \ \ \ | |/ / /
| * | | Merge branch '10.0' into 10.1Sergei Golubchik2016-05-041-0/+8
| |\ \ \ | | |/ /
| | * | Merge branch '5.5' into 10.0Sergei Golubchik2016-04-261-0/+8
| | |\ \ | | | |/
| | | * another test case for ER_DATA_OUT_OF_RANGE on insertSergei Golubchik2016-04-201-0/+8
| | | | | | | | | | | | | | | | tests it with a non-const table too
* | | | parse negative numbers into one itemSergei Golubchik2016-06-301-1/+5
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | use Item->neg to convert generate negative Item_num's instead of Item_func_neg(Item_num). Based on the following commit: Author: Monty <monty@mariadb.org> Date: Mon May 30 22:44:00 2016 +0300 Make negative number their own token The negation (-) operator will call Item->neg() one underlying numeric constants and remove itself (like the NOT() function does today for other NOT functions. This simplifies things - -1 is not anymore an expression but a basic_const_item - improves optimizer - DEFAULT -1 doesn't need special handling anymore - When we add DEFAULT expressions, -1 will be treated exactly like 1 - printing of items doesn't anymore put braces around all negative numbers Other things fixed: - Fixed that longlong converted to decimal's has a more appropriate size - Fixed that "-0.0" read into a decimal is interpreted as 0.0
* | | MDEV-6066: Merge new defaults from 5.6 and 5.7 (defaults changed, QC can be ↵Oleksandr Byelkin2015-09-041-0/+2
|/ / | | | | | | stopped with no-zero size)
* | MDEV-5858 MySQL Bug#12744991 - DECIMAL_ROUND(X,D) GIVES WRONG RESULTS WHEN D ↵Sergei Golubchik2014-03-201-0/+9
| | | | | | | | | | | | | | | | == N*(-9) don't use mysql-5.6 change. correct fix: zero-out rounded tail after the number was shifted because of the carry digit (otherwise the carry digit will be zeroed out too).
* | MDEV-5781 Item_sum_std::val_real(): Assertion `nr >= 0.0' fails on query ↵Alexander Barkov2014-03-231-0/+18
|/ | | | with STDDEV_POP, ROUND and variable
* Fix FreeBSD test errors. Also link with libexecinfo on FreeBSD for ↵Vladislav Vaintroub2012-05-041-0/+1
| | | | stacktrace functionality.
* Bug#12711164 - 61676: RESULT OF DIV WITH DECIMAL AND INTEGER DOES NOT MAKE ↵Tor Didriksen2011-07-181-0/+11
| | | | | | | | | | | | | | | SENSE Truncate result of decimal division before converting to integer. mysql-test/r/func_math.result: New test case. mysql-test/t/func_math.test: New test case. sql/item_func.cc: Item_func_int_div::val_int(): 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/+11
| | | | | | | | | | | | | | 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. mysql-test/r/func_math.result: New test case. mysql-test/t/func_math.test: New test case. strings/decimal.c: Move DBUG_ASSERT down to where we actually dereference the loop pointer.
* 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. mysql-test/r/func_math.result: test case mysql-test/t/func_math.test: test case sql/item_func.cc: added NULL value check for second parameter.
* | 5.1 -> 5.5 mergeSergey Glukhov2011-04-201-0/+16
|\ \ | |/
| * Bug#11765923 58937: MANY VALGRIND ERRORS AFTER GROUPING BY RESULT OF ↵Sergey Glukhov2011-04-201-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. mysql-test/r/func_math.result: test case mysql-test/t/func_math.test: test case sql/item_func.cc: remove erroneous assignment
* | 5.1 -> 5.5 mergeSergey Glukhov2011-03-281-0/+9
|\ \ | |/
| * Bug#11764994 57900: CREATE TABLE .. SELECT ASSERTS SCALE >= 0 && PRECISION ↵Sergey Glukhov2011-03-281-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > 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. mysql-test/r/func_math.result: test case mysql-test/t/func_math.test: test case sql/item_func.cc: skip max_length calculation if argument max_length is near max_field_size.
* | Bug #11792200 - DIVIDING LARGE NUMBERS CAUSES STACK CORRUPTIONSTor Didriksen2011-03-031-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. include/decimal.h: Add const qualifiers to function prototypes which are used by sql/my_decimal.h mysql-test/r/func_math.result: New test case. mysql-test/t/func_math.test: New test case. sql/my_decimal.h: Remove several C-style casts: - some of the were up-casts, and thus un-necessary - some of them should have been const-casts, but it is better to make the underlying library functions in (decimal.[h|c]) const instead. strings/decimal.c: Check for buffer overrun in do_div_mod() Add const qualifiers to functions which are used by sql/my_decimal.h
* | Bug #59498 div function broken in mysql-trunkTor Didriksen2011-01-141-0/+5
| | | | | | | | | | | | | | | | | | mysql-test/r/func_math.result: New test case. mysql-test/t/func_math.test: New test case. sql/item_func.cc: Check for null before converting value to my_decimal.
* | Bug #59241 invalid memory read in do_div_mod with doubly assigned variablesTor Didriksen2011-01-141-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix: copy my_decimal by value, to avoid dangling pointers. mysql-test/r/func_math.result: New test case. mysql-test/t/func_math.test: New test case. sql/item_cmpfunc.cc: No need to call fix_buffer_pointer() anymore. sql/item_func.cc: Copy my_decimal by value, to avoid dangling pointers. sql/my_decimal.h: Implement proper copy constructor and assignment operator for my_decimal. sql/sql_analyse.cc: No need to call fix_buffer_pointer() anymore. strings/decimal.c: Remove #line directive: it messes up TAGS and it confuses gdb when debugging.
* | 5.1-bugteam->5.5-bugteam mergeSergey Glukhov2010-12-241-0/+9
|\ \ | |/
| * Bug#57810 case/when/then : Assertion failed: length || !scaleSergey Glukhov2010-12-241-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. mysql-test/r/func_math.result: test case mysql-test/t/func_math.test: test case sql/item_func.cc: 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/+8
|\ \ | |/
| * Bug#57477 SIGFPE when dividing a huge number a negative numberSergey Glukhov2010-10-271-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. mysql-test/r/func_math.result: test case mysql-test/t/func_math.test: test case sql/item_func.cc: -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/+8
| | | | | | | | | | | | | | | | | | | | | | ((void *)0)' failed mysql-test/r/func_math.result: Add test for Bug #58137 mysql-test/t/func_math.test: Add test for Bug #58137 sql/field.cc: Skip calling my_gcvt() if we are trying to insert a double into a char(0) column.
* | Bug#57209 valgrind + Assertion failed: dst > bufTor Didriksen2010-10-081-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | Buffer overrun when trying to format DBL_MAX mysql-test/r/func_math.result: Add test case for Bug#57209 mysql-test/t/func_math.test: Add test case for Bug#57209 sql/item_strfunc.cc: Allocate a larger buffer for the result.
* | Bug #8433: Overflow must be an error Alexey Kopytov2010-03-181-2/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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". mysql-test/r/func_math.result: Added test cases for bug #8433. Updated results of the test case for bug #31236. mysql-test/r/func_misc.result: Streamlined test cases. mysql-test/r/func_test.result: Streamlined test cases. mysql-test/r/select.result: Streamlined test cases. mysql-test/r/sp.result: Streamlined test cases. mysql-test/r/strict.result: Streamlined test cases. mysql-test/r/type_newdecimal.result: Streamlined test cases. mysql-test/suite/sys_vars/r/sql_slave_skip_counter_basic.result: Streamlined test cases. mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test: Streamlined test cases. mysql-test/t/func_math.test: Added test cases for bug #8433. Updated results of the test case for bug #31236. mysql-test/t/func_misc.test: Streamlined test cases. mysql-test/t/func_test.test: Streamlined test cases. mysql-test/t/select.test: Streamlined test cases. mysql-test/t/sp.test: Streamlined test cases. mysql-test/t/strict.test: Streamlined test cases. mysql-test/t/type_newdecimal.test: Streamlined test cases. sql/item_create.cc: Changed Item_func_cot() to be defined as a standalone Item rather than a combination of "1 / TAN(x)". sql/item_func.cc: Throw an 'out of range' error rather than returning an incorrect value or NULL, when the result of a numeric operator or a function is out of supported range for the corresponding data type. sql/item_func.h: Added validation helpers as inline methods of Item_func. sql/share/errmsg-utf8.txt: New ER_DATA_OUT_OF_RANGE error.
* | 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. mysql-test/r/func_math.result: Added a test case for bug #8457. Fixed results for a test case depending on the wrong behavior. mysql-test/r/type_varchar.result: Fixed results for a test case depending on the wrong behavior. mysql-test/t/func_math.test: Added a test case for bug #8457. sql/item_func.cc: 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.
* 5.0-bugteam->5.1-bugteam mergeSergey Glukhov2009-06-021-0/+9
|\
| * Bug#45152 crash with round() function on longtext column in a derived tableSergey Glukhov2009-06-021-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. mysql-test/r/func_math.result: test result mysql-test/t/func_math.test: test case sql/item_func.cc: 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/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. mysql-test/r/func_math.result: Added test case for bug #44768. mysql-test/t/func_math.test: Added test case for bug #44768. sql/item_func.cc: Bug #44768: SIGFPE crash when selecting rand from a view containing null 1. Initialization of random value by seed_random() has been removed from Item_func_rand::fix_fields method. 2. 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. sql/item_func.h: Bug #44768: SIGFPE crash when selecting rand from a view containing null 1. The Item_func_rand::first_eval has been added to trace the first evaluation of the val_real method. 2. The Item_func_rand::cleanup method has been added to cleanup the first_eval flag.
* | Manual merge to 5.1.Alexey Kopytov2009-02-231-0/+21
|\ \ | |/
| * Fix for bug #15936: "round" differs on Windows to UnixAlexey Kopytov2009-02-231-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. configure.in: Added checks for fenv.h and fesetround(). include/config-win.h: Removed the incorrect implementation of rint() for Windows. include/my_global.h: Added an rint() implementation for platforms that do not have it. mysql-test/r/func_math.result: Added a test case for bug #15936. mysql-test/t/func_math.test: Added a test case for bug #15936. sql/mysqld.cc: Explicitly set the FPU rounding mode with fesetround().
* | Fix for bug #31236: Inconsistent division by zero behavior for unknown2008-02-201-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. BitKeeper/deleted/.del-matherr.c: Rename: sql/matherr.c -> BitKeeper/deleted/.del-matherr.c configure.in: Removed DONT_USE_FINITE, it is not used anywhere. include/my_global.h: isfinite() is a C99 macro which absoletes finite(). First try to use it, then fall back to finite() if the target platform has it, otherwise use our own implementation. mysql-test/r/func_math.result: Added a test case for bug #31236. mysql-test/r/strict.result: Fixed a test case which relied on old behavior. mysql-test/t/func_math.test: Added a test case for bug #31236. mysql-test/t/strict.test: Fixed a test case which relied on old behavior. sql/field.cc: No need to check if the finite() or its equivalent is available. sql/item_func.cc: Use fix_result() wherever the result can be one of +-inf or nan, assuming the function arguments are valid numbers. Removed fix_result() from functions that are defined for all possible input numbers. sql/item_func.h: Moved fix_result() from Item_dec_func to Item_func which is a common ancestor for Item_dec_func and Item_num_op. sql/unireg.h: Removed POSTFIX_ERROR because no code returns it.
* | merge 5.0-opt -> 5.1-optunknown2007-10-011-2/+0
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | mysql-test/r/func_math.result: Auto merged mysql-test/t/func_math.test: Auto merged mysql-test/t/view_grant.test: Auto merged sql/item_func.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_view.cc: Auto merged
| * removed undeterministic test result from the fux for bug 30587unknown2007-10-011-2/+0
| |
* | Merge macbook:mysql/work/B30587-5.0-optunknown2007-09-281-0/+27
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | into magare.gmz:/home/kgeorge/mysql/work/B30587-5.1-opt mysql-test/r/func_math.result: Auto merged mysql-test/t/func_math.test: Auto merged sql/item_func.cc: Auto merged
| * Bug #30587: mysql crashes when trying to group by TIME div NUMBERunknown2007-09-281-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. mysql-test/r/func_math.result: Bug #30587: test case mysql-test/t/func_math.test: Bug #30587: test case sql/item_func.cc: Bug #30587: Don't use decimals on a type that doesn't have them.
* | Merge polly.local:/home/kaa/src/maint/bug24912/my50-bug24912unknown2007-04-281-5/+34
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into polly.local:/home/kaa/src/maint/bug24912/my51-bug24912 mysql-test/r/type_newdecimal.result: Auto merged mysql-test/t/func_math.test: Auto merged sql/item_func.cc: Auto merged sql/item_func.h: Auto merged sql/mysql_priv.h: Auto merged mysql-test/r/func_math.result: Manual merge. sql/item_strfunc.cc: Manual merge.
| * Fix for bug #24912 "problems with bigint in abs() ceiling() round() ↵unknown2007-04-281-5/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 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)
* | Bug #6172: RAND(a) should only accept constant values as argumentsunknown2007-01-231-5/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. mysql-test/r/func_math.result: Bug #6172: RAND(a) should only accept constant values as arguments - extened the test case mysql-test/t/func_math.test: Bug #6172: RAND(a) should only accept constant values as arguments - extened the test case sql/item_func.cc: Bug #6172: RAND(a) should only accept constant values as arguments - allow specifying non-const expressions as RAND() arguments sql/item_func.h: Bug #6172: RAND(a) should only accept constant values as arguments - allow specifying non-const expressions as RAND() arguments
* | Bug#21114 (Foreign key creation fails to table with name format)unknown2006-11-021-0/+5
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. mysql-test/r/func_math.result: Improved test coverage mysql-test/r/view.result: Name collision, x() is a geometry native in function mysql-test/t/func_math.test: Improved test coverage mysql-test/t/view.test: Name collision, x() is a geometry native in function sql/item_create.cc: Revised the create_func implementation sql/item_create.h: Revised the create_func implementation sql/item_geofunc.h: Explicit Item allocation in the thread memory pool. sql/lex.h: Removed function parsing from the lexical parser sql/lex_symbol.h: Removed function parsing from the lexical parser sql/mysql_priv.h: Server initialization and shutdown sql/mysqld.cc: Server initialization and shutdown sql/share/errmsg.txt: New error messages sql/sql_yacc.yy: Removed function parsing from the lexical parser tests/mysql_client_test.c: Spaces are no longer significant for function calls mysql-test/include/parser_bug21114.inc: New tests mysql-test/r/parser.result: New tests mysql-test/r/parser_bug21114_innodb.result: New tests mysql-test/t/parser.test: New tests mysql-test/t/parser_bug21114_innodb.test: New tests
* Fix for bug#16678 FORMAT gives wrong result if client run with ↵unknown2006-03-061-0/+22
| | | | | | | | | | | | | | default-character-set=utf8 calculate Item_func_format::max_length using charset->mbmaxlen mysql-test/r/func_math.result: Fix for bug#16678 FORMAT gives wrong result if client run with default-character-set=utf8 test case mysql-test/t/func_math.test: Fix for bug#16678 FORMAT gives wrong result if client run with default-character-set=utf8 test case
* item_func.cc:unknown2006-02-071-0/+14
| | | | | | | | | | | | | | | | | | | | | fix for bug#8461 BUG 8461 - TRUNCATE returns incorrect result if 2nd argument is negative Reason: Both TRUNCATE/ROUND converts INTEGERS to DOUBLE and back to INTEGERS Changed the integer routine to work on integers only. This bug affects 4.1, 5.0 and 5.1 Fixing in 4.1 will need to change the routine to handle different types individually. 5.0 did had different routines for different types already just the INTEGER routine was bad. sql/item_func.cc: fix for bug#8461 BUG 8461 - TRUNCATE returns incorrect result if 2nd argument is negative Reason: TRUNCATE converts INTEGERS to DOUBLE and back to INTEGERS Both ROUND and TRUNCATE are affected by this. Changed the integer routine to work on integers only. This bug affects 4.1 5,0 and 5 Fixing in 4.1 will need to change the routine to handle different types individually.
* Mergingunknown2006-01-211-0/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql-test/ndb/ndbcluster.sh: Auto merged mysql-test/r/func_gconcat.result: Auto merged mysql-test/r/subselect.result: Auto merged mysql-test/t/func_math.test: Auto merged mysql-test/t/type_float.test: Auto merged sql/spatial.h: Auto merged mysql-test/r/type_float.result: merging sql/item_func.cc: merging