summaryrefslogtreecommitdiff
path: root/sql/item_func.h
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-7759 NULLIF(x,y) is not equal to CASE WHEN x=y THEN NULL ELSE x ENDAlexander Barkov2015-03-121-0/+9
|
* Merge branch '10.0' into merge-wipSergei Golubchik2015-01-311-3/+4
|\
| * 5.5 mergeSergei Golubchik2015-01-211-3/+4
| |\
| | * mysql-5.5.41 mergeSergei Golubchik2014-12-191-3/+4
| | |\
| | | * Bug #19372926 : 5.5.38 FAILS FUNC_MATH MTR TEST.mithun2014-11-031-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue : ------- This seems for some platform -(LONGLONG_MIN) is not flagged as out of range. Fix: ---- Fix is backported from mysql-5.6 bug 14314156. Fixed by adding an explicit test for this value in Item_func_neg::int_op(). sql/item_func.cc: For some platforms we need special handling of LONGLONG_MIN to guarantee overflow.
* | | | Merge branch '10.0' into bb-10.1-mergeSergei Golubchik2014-12-021-1/+3
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .bzrignore VERSION cmake/plugin.cmake debian/dist/Debian/control debian/dist/Ubuntu/control mysql-test/r/join_outer.result mysql-test/r/join_outer_jcl6.result mysql-test/r/null.result mysql-test/r/old-mode.result mysql-test/r/union.result mysql-test/t/join_outer.test mysql-test/t/null.test mysql-test/t/old-mode.test mysql-test/t/union.test packaging/rpm-oel/mysql.spec.in scripts/mysql_config.sh sql/ha_ndbcluster.cc sql/ha_ndbcluster_binlog.cc sql/ha_ndbcluster_cond.cc sql/item_cmpfunc.h sql/lock.cc sql/sql_select.cc sql/sql_show.cc sql/sql_update.cc sql/sql_yacc.yy storage/innobase/buf/buf0flu.cc storage/innobase/fil/fil0fil.cc storage/innobase/include/srv0srv.h storage/innobase/lock/lock0lock.cc storage/tokudb/CMakeLists.txt storage/xtradb/buf/buf0flu.cc storage/xtradb/fil/fil0fil.cc storage/xtradb/include/srv0srv.h storage/xtradb/lock/lock0lock.cc support-files/mysql.spec.sh
| * | | 5.5 mergeSergei Golubchik2014-11-191-1/+3
| |\ \ \ | | |/ /
| | * | MDEV-7113 difference between check_vcol_func_processor and ↵Sergei Golubchik2014-11-181-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | check_partition_func_processor MDEV-6789 segfault in Item_func_from_unixtime::get_date on updating table with virtual columns * prohibit VALUES in partitioning expression * prohibit user and system variables in virtual column expressions * fix Item_func_date_format to cache locale (for %M/%W to return the same as MONTHNAME/DAYNAME) * fix Item_func_from_unixtime to cache time_zone directly, not THD (and not to crash) * added tests for other incorrectly allowed (in vcols) functions to see that they don't crash
* | | | MDEV-4045 Missing OGC Spatial functions.Alexey Botchkov2014-11-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Missing GIS functions added: IsRing() PointOnSurface PointOnSurface Relate Distance Intersection ConvexHull Other old OpenGis standard inconsistencies fixed.
* | | | MDEV-7005 NULLIF does not work as documentedAlexander Barkov2014-11-201-0/+1
|/ / / | | | | | | | | | MDEV-7146 NULLIF returns unexpected result with a YEAR field
* | | 5.5.39 mergeSergei Golubchik2014-08-071-12/+5
|\ \ \ | |/ /
| * | 5.3 mergeSergei Golubchik2014-08-011-12/+5
| |\ \
| | * | MDEV-4511 Assertion `scale <= precision' fails on GROUP BY TIMEDIFF with ↵Alexander Barkov2014-07-281-12/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | incorrect types MDEV-6302 Wrong result set when using GROUP BY FROM_UNIXTIME(...)+0 Fixed.
| | * | 5.2 mergeSergei Golubchik2014-03-161-18/+20
| | |\ \
| | | * \ 5.1 mergeSergei Golubchik2014-03-161-18/+20
| | | |\ \
| | | | * \ mysql-5.1.73 mergeSergei Golubchik2014-03-151-9/+20
| | | | |\ \
| | | | | * | Bug #16119355: PREPARED STATEMENT: READ OF FREED MEMORY WITHChaithra Gopalareddy2013-05-231-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | STRING CONVERSION FUNCTIONS Problem: While executing the prepared statement, user variable is set to memory which would be freed at the end of execution. If the statement is executed again, valgrind throws error when accessing this pointer. Analysis: 1. First time when Item_func_set_user_var::check is called, memory is allocated for "value" to store the result. (In the call to copy_if_not_alloced). 2. While sending the result, Item_func_set_user_var::check is called again. But, this time, its called with "use_result_field" set to true. As a result, we call result_field->val_str(&value). 3. Here memory allocated for "value" gets freed. And "value" gets set to "result_field", with "str_length" being that of result_field's. 4. In the call to JOIN::cleanup, result_field's memory gets freed as this is allocated in a chunk as part of the temporary table which is needed to execute the query. 5. Next time, when execute of the same statement is called, "value" will be set to memory which is already freed. Valgrind error occurs as "str_length" is positive (set at Step 3) Note that user variables list is stored as part of the Lex object in set_var_list. Hence the persistance across executions. Solution: Patch for Bug#11764371 fixed in mysql-5.6+ fixes this problem as well.So backporting the same. In the solution for Bug#11764371, we create another object of user_var and repoint it to temp_table's field. As a result while deleting the alloced buffer in Step 3, since the cloned object does not own the buffer, deletion will not happen. So at step 5 when we execute the statement second time, the original object will be used and since deletion did not happen valgrind will not complain about dangling pointer. sql/item_func.h: Add constructors. sql/sql_select.cc: Change user variable assignment functions to read from fields after tables have been unlocked.
| | | | | * | Bug#16119355:PREPARED STATEMENT: READ OF FREED MEMORY WITH STRING CONVERSION ↵Chaithra Gopalareddy2013-05-101-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FUNCTIONS Reverting fix for Bug#16119355 in 5.1 as this needs two patches from 5.5+ to work for a certain case
* | | | | | | Moving implementation of INET_ATON() INET_NTOA() intoAlexander Barkov2014-05-301-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | separate files item_inetfunc.h and item_inetfunc.cc.
* | | | | | | MDEV-5372 Make "CAST(time_expr AS DATETIME)" compatible with MySQL-5.6 (and ↵Alexander Barkov2014-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the SQL Standard)
* | | | | | | mergeSergei Golubchik2014-02-281-2/+2
|\ \ \ \ \ \ \
| * \ \ \ \ \ \ 10.0-base mergeSergei Golubchik2014-02-261-2/+2
| |\ \ \ \ \ \ \
| | * \ \ \ \ \ \ 5.5 mergeSergei Golubchik2014-02-251-2/+2
| | |\ \ \ \ \ \ \ | | | |/ / / / / /
| | | * | | | | | MySQL-5.5.36 mergeSergei Golubchik2014-02-171-2/+2
| | | |\ \ \ \ \ \ | | | | | |_|_|_|/ | | | | |/| | | | | | | | | | | | | (without few incorrect bugfixes and with 1250 files where only a copyright year was changed)
| | | | * | | | | Updated/added copyright headersMurthy Narkedimilli2014-01-061-1/+1
| | | | | | | | |
* | | | | | | | | MDEV-4309: DBT-3 Q1 benchmark: Benchmark + profile a patchunknown2014-02-261-1/+3
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed repetative calls of virtual functions. Removed check of posibility just copy field for every record.
* | | | | | | | Merge MariaDB 10.0-base to 10.0.unknown2014-02-101-0/+16
|\ \ \ \ \ \ \ \ | |/ / / / / / /
| * | | | | | | MDEV-4984: Implement MASTER_GTID_WAIT() and @@LAST_GTID.unknown2014-02-071-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MASTER_GTID_WAIT() is similar to MASTER_POS_WAIT(), but works with a GTID position rather than an old-style filename/offset. @@LAST_GTID gives the GTID assigned to the last transaction written into the binlog. Together, the two can be used by applications to obtain the GTID of an update on the master, and then do a MASTER_GTID_WAIT() for that position on any read slave where it is important to get results that are caught up with the master at least to the point of the update. The implementation of MASTER_GTID_WAIT() is implemented in a way that tries to minimise the performance impact on the SQL threads, even in the presense of many waiters on single GTID positions (as from @@LAST_GTID).
* | | | | | | | MDEV-5574 Set AUTO_INCREMENT below max value of column.Sergei Golubchik2014-02-011-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update InnoDB to 5.6.14 Apply MySQL-5.6 hack for MySQL Bug#16434374 Move Aria-only HA_RTREE_INDEX from my_base.h to maria_def.h (breaks an assert in InnoDB) Fix InnoDB memory leak
* | | | | | | | 10.0-base mergeSergei Golubchik2013-12-161-1/+4
|\ \ \ \ \ \ \ \ | |/ / / / / / /
| * | | | | | | 5.5 mergeSergei Golubchik2013-12-151-1/+4
| |\ \ \ \ \ \ \ | | |/ / / / / /
| | * | | | | | 5.3 mergeSergei Golubchik2013-12-131-1/+2
| | |\ \ \ \ \ \ | | | | |/ / / / | | | |/| | | |
| | | * | | | | MDEV-5374 main.func_time fails with valgrind warningAlexander Barkov2013-12-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "Conditional jump or move depends on uninitialised" in Item_time_typecast::get_date. Adding "null_value" into the debug assert condition.
| | * | | | | | Merge 5.3->5.5Alexander Barkov2013-12-021-1/+3
| | |\ \ \ \ \ \ | | | |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pending merges: Alexander Barkov 2013-12-02 MDEV-4857 Wrong result of HOUR('1 00:00:00')
| | | * | | | | MDEV-4857 Wrong result of HOUR('1 00:00:00')Alexander Barkov2013-12-021-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | modified: mysql-test/r/func_time.result mysql-test/t/func_time.test sql-common/my_time.c sql/item_func.h sql/item_timefunc.cc sql/mysql_priv.h sql/time.cc
* | | | | | | | Merge 10.0-base -> 10.0Alexander Barkov2013-10-151-7/+10
|\ \ \ \ \ \ \ \ | |/ / / / / / /
| * | | | | | | Merge 5.5->10.0-baseIgor Babaev2013-10-131-7/+10
| |\ \ \ \ \ \ \ | | |/ / / / / /
| | * | | | | | Merge 5.3-5.5Igor Babaev2013-10-131-6/+9
| | |\ \ \ \ \ \ | | | |/ / / / /
| | | * | | | | Fixed a problem of the patch for mdev-5105 that caused valgrind complains.Igor Babaev2013-10-111-7/+10
| | | | | | | |
| | | * | | | | Fixed bug mdev-5105.Igor Babaev2013-10-101-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug caused a memory overwrite in the function update_ref_and_keys() It happened due to a wrong value of SELECT_LEX::cond_count. This value historically was calculated by the fix_fields method. Now the logic of calling this method became too complicated and, as a result, this value is calculated not always correctly. The patch changes the way how and when the values of SELECT_LEX::cond_count and of SELECT_LEX::between_count are calculated. The new code does it just at the beginning of update_ref_and_keys().
* | | | | | | | merge 10.0-base -> 10.0unknown2013-09-261-30/+20
|\ \ \ \ \ \ \ \ | |/ / / / / / /
| * | | | | | | merge 5.5 -> 10.0-baseunknown2013-09-251-30/+20
| |\ \ \ \ \ \ \ | | |/ / / / / /
| | * | | | | | merge 5.3 -> 5.5unknown2013-09-251-30/+20
| | |\ \ \ \ \ \ | | | |/ / / / /
| | | * | | | | MDEV-5039: incorrect Item_func_regex::update_used_tables()unknown2013-09-251-29/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Other fix of maybe_null problem and revert of revno: 3608 "MDEV-3873 & MDEV-3876 & MDEV-3912 : Wrong result (extra rows) with ALL subquery from a MERGE view."
| | | * | | | | MDEV-4724 Some temporal functions do not preserve microsecondsAlexander Barkov2013-09-131-0/+2
| | | | | | | |
* | | | | | | | 10.0-base merge.Sergei Golubchik2013-09-211-37/+125
|\ \ \ \ \ \ \ \ | |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | Partitioning/InnoDB changes are *not* merged (they'll come from 5.6) TokuDB does not compile (not updated to 10.0 SE API)
| * | | | | | | 5.5 merge and fixes for compiler/test errorsSergei Golubchik2013-09-181-33/+96
| |\ \ \ \ \ \ \ | | |/ / / / / /
| | * | | | | | Merge from 5.3.Alexander Barkov2013-09-131-0/+2
| | |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pending merges: Alexander Barkov 2013-09-12 MDEV-4724 Some temporal functions do not pre...
| | | * | | | | | MDEV-4724 Some temporal functions do not preserve microsecondsAlexander Barkov2013-09-121-0/+2
| | | |/ / / / /
| | * | | | | | Merge from 5.3Alexander Barkov2013-09-101-24/+86
| | |\ \ \ \ \ \ | | | |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pending merges: Alexander Barkov 2013-09-09 MDEV-4863 COALESCE(time_or_datetime) returns...