summaryrefslogtreecommitdiff
path: root/sql/multi_range_read.cc
Commit message (Collapse)AuthorAgeFilesLines
* Fix compile failure on Windows: use explicit type castsbb-10.3-mdev20611Sergei Petrunia2019-11-161-3/+3
|
* MDEV-20611: MRR scan over partitioned InnoDB table produces "Out of memory" ↵Sergei Petrunia2019-11-151-7/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | error Fix partitioning and DS-MRR to work together - In ha_partition::index_end(): take into account that ha_innobase (and other engines using DS-MRR) will have inited=RND when initialized for DS-MRR scan. - In ha_partition::multi_range_read_next(): if the MRR scan is using HA_MRR_NO_ASSOCIATION mode, it is not guaranteed that the partition's handler will store anything into *range_info. - In DsMrr_impl::choose_mrr_impl(): ha_partition will inquire partitions about how much memory their MRR implementation needs by passing *buffer_size=0. DS-MRR code didn't know about this (actually it used uint for buffer size calculation and would have an under-flow). Returning *buffer_size=0 made ha_partition assume that partitions do not need MRR memory and pass the same buffer to each of them. Now, this is fixed. If DS-MRR gets *buffer_size=0, it will return the amount of buffer space needed, but not more than about @@mrr_buffer_size. * Fix ha_{innobase,maria,myisam}::clone. If ha_partition uses MRR on its partitions, and partition use DS-MRR, the code will call handler->clone with TABLE (*NOT partition*) name as an argument. DS-MRR has no way of knowing the partition name, so the solution was to have the ::clone() function for the affected storage engine to ignore the name argument and get it elsewhere.
* Merge 10.2 into 10.3Marko Mäkelä2019-05-141-1/+1
|\
| * Merge 10.1 into 10.2Marko Mäkelä2019-05-131-1/+1
| |\
| | * Merge branch '5.5' into 10.1Vicențiu Ciorbaru2019-05-111-1/+1
| | |\
| | | * Update FSF addressMichal Schorm2019-05-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is based on the work of Michal Schorm, rebased on the earliest MariaDB version. Th command line used to generate this diff was: find ./ -type f \ -exec sed -i -e 's/Foundation, Inc., 59 Temple Place, Suite 330, Boston, /Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, /g' {} \; \ -exec sed -i -e 's/Foundation, Inc. 59 Temple Place.* Suite 330, Boston, /Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, /g' {} \; \ -exec sed -i -e 's/MA.*.....-1307.*USA/MA 02110-1335 USA/g' {} \; \ -exec sed -i -e 's/Foundation, Inc., 59 Temple/Foundation, Inc., 51 Franklin/g' {} \; \ -exec sed -i -e 's/Place, Suite 330, Boston, MA.*02111-1307.*USA/Street, Fifth Floor, Boston, MA 02110-1335 USA/g' {} \; \ -exec sed -i -e 's/MA.*.....-1307/MA 02110-1335/g' {} \;
* | | | Merge 10.2 into 10.3Marko Mäkelä2018-08-281-0/+13
|\ \ \ \ | |/ / /
| * | | Added a new parameter for the function eq_ranges_exceeds_limit()Igor Babaev2018-08-241-3/+5
| | | | | | | | | | | | | | | | introduced in the patch fo MDEV-16934.
| * | | MDEV-16934 Query with very large IN clause lists runs slowlyIgor Babaev2018-08-171-0/+11
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces support for the system variable eq_range_index_dive_limit that existed in MySQL starting from 5.6. The variable sets a limit for index dives into equality ranges. Index dives are performed by optimizer to estimate the number of rows in range scans. Index dives usually provide good estimate but they are pretty expensive. To estimate the number of rows in equality ranges statistical data on indexes can be employed. Its usage gives not so good estimates but it's cheap. So if the number of equality dives required by an index scan exceeds the set limit no dives for equality ranges are performed by the optimizer for this index. As the new system variable is introduced in a stable version the default value for it is set to a special value meaning there is no limit for the number of index dives performed by the optimizer. The patch partially uses the MySQL code for WL 5957 'Statistics-based Range optimization for many ranges'.
* | | cleanup: hide HA_ERR_RECORD_DELETED in ha_rnd_next()Sergei Golubchik2018-05-121-6/+0
| | | | | | | | | | | | | | | it's internal storage engine error, don't let it leak into the upper layer.
* | | MDEV-15091 : Windows, 64bit: reenable and fix warning C4267 (conversion from ↵Vladislav Vaintroub2018-02-061-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'size_t' to 'type', possible loss of data) Handle string length as size_t, consistently (almost always:)) Change function prototypes to accept size_t, where in the past ulong or uint were used. change local/member variables to size_t when appropriate. This fix excludes rocksdb, spider,spider, sphinx and connect for now.
* | | Merge branch 'bb-10.2-ext' into 10.3Sergei Golubchik2017-08-261-16/+6
|\ \ \ | |/ /
| * | Merge branch '10.0' into 10.1Sergei Golubchik2017-08-081-16/+6
| |\ \
| | * | MDEV-12972 Random and Frequent SegfaultMonty2017-08-031-16/+6
| | | | | | | | | | | | | | | | | | | | | | | | Problem was a memory overflow in MRR Reviewed by Sergei Petruna. Testcase by Elena
* | | | Enusure that my_global.h is included firstMichael Widenius2017-08-241-0/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added sql/mariadb.h file that should be included first by files in sql directory, if sql_plugin.h is not used (sql_plugin.h adds SHOW variables that must be done before my_global.h is included) - Removed a lot of include my_global.h from include files - Removed include's of some files that my_global.h automatically includes - Removed duplicated include's of my_sys.h - Replaced include my_config.h with my_global.h
* | | Correct FSF addressiangilfillan2017-03-101-1/+1
| | |
* | | Merge branch '10.0' into 10.1Sergei Golubchik2016-08-251-1/+1
|\ \ \ | |/ /
| * | Added new status variables to make it easier to debug certain problems:Monty2016-08-211-1/+1
| | | | | | | | | | | | | | | | | | - Handler_read_retry - Update_scan - Delete_scan
* | | MDEV-7943 - pthread_getspecific() takes 0.76% in OLTP ROSergey Vojtovich2015-06-191-3/+3
| | | | | | | | | | | | | | | | | | | | | Pass THD to find_all_keys() and Item_equal::Item_equal(). In MRR use table->in_use instead of current_thd. This reduces number of pthread_getspecific() calls from 354 to 320.
* | | MDEV-6650 - LINT_INIT emits code in non-debug buildsSergey Vojtovich2015-03-161-2/+1
| | | | | | | | | | | | | | | Replaced all references to LINT_INIT with UNINIT_VAR and LINT_INIT_STRUCT. Removed LINT_INIT macro.
* | | Merge branch '10.0' into bb-10.1-mergeSergei Golubchik2014-12-021-4/+21
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-2/+13
| |\ \ | | |/
| | * MDEV-7068: MRR accessing uninitialised bytes, test case failure main.innodb_mrrSergey Petrunya2014-11-131-2/+13
| | | | | | | | | | | | | | | - Don't call index_reader->interrupt_read() if the index reader has returned all rows that matched its keys.
| * | MergeSergey Petrunya2014-10-291-10/+11
| |\ \ | | |/
| | * Merge 5.3->5.5Sergey Petrunya2014-10-291-2/+8
| | |\
| | | * MDEV-6878: Use of uninitialized saved_primary_key in ↵Sergey Petrunya2014-10-291-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mrr_ordered_index_reader::resume_read() (Backport to 5.3) (variant #2, with fixed coding style) - Make Mrr_ordered_index_reader::resume_read() restore index position only if it was saved before with Mrr_ordered_index_reader::interrupt_read().
| * | | MDEV-6878: Use of uninitialized saved_primary_key in ↵Sergey Petrunya2014-10-161-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mrr_ordered_index_reader::resume_read() - Make Mrr_ordered_index_reader::resume_read() restore index position only if it was saved before with Mrr_ordered_index_reader::interrupt_read().
* | | | MDEV-34 delete storage/ndb and sql/*ndb* (and collateral changes)Sergei Golubchik2014-10-111-6/+0
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | remove: * NDB from everywhere * IM from mtr-v1 * packaging/rpm-oel and packaging/rpm-uln * few unused spec files * plug.in file * .bzrignore
* | | MDEV-5976: TokuDB: Wrong query result using mrr=onSergey Petrunya2014-06-061-1/+7
| | | | | | | | | | | | | | | | | | - Key_value_records_iterator::get_next() should pass pointer to the key to handler->ha_index_next_same(). Because of a typo bug, pointer-to-pointer was passed instead in certain cases.
* | | MDEV-5314 - Compiling fails on OSX using clangSergey Vojtovich2014-02-191-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is port of fix for MySQL BUG#17647863. revno: 5572 revision-id: jon.hauglid@oracle.com-20131030232243-b0pw98oy72uka2sj committer: Jon Olav Hauglid <jon.hauglid@oracle.com> timestamp: Thu 2013-10-31 00:22:43 +0100 message: Bug#17647863: MYSQL DOES NOT COMPILE ON OSX 10.9 GM Rename test() macro to MY_TEST() to avoid conflict with libc++.
* | | merge 10.0-base -> 10.0unknown2013-09-261-9/+11
|\ \ \
| * \ \ merge 5.5 -> 10.0-baseunknown2013-09-251-9/+11
| |\ \ \ | | |/ /
| | * | MDEV-5037: Server crash on a JOIN on a derived table with join_cache_level > 2Sergey Petrunya2013-09-201-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - The crash was caused because the optimizer called handler->multi_range_read_info() on a derived temporary table. That table has been created, but not opened yet. Because of that, handler::table was NULL, which caused crash. Fixed by changing DS-MRR methods to use handler::table_share instead. handler::table_share is set in handler ctor, so this should be safe.
* | | | 10.0-monty mergeSergei Golubchik2013-07-211-4/+4
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | includes: * remove some remnants of "Bug#14521864: MYSQL 5.1 TO 5.5 BUGS PARTITIONING" * introduce LOCK_share, now LOCK_ha_data is strictly for engines * rea_create_table() always creates .par file (even in "frm-only" mode) * fix a 5.6 bug, temp file leak on dummy ALTER TABLE
| * | | | Applied all changes from Igor and SanjaMichael Widenius2013-06-151-1/+1
| | | | |
| * | | | Push a lot of small fixes to get larger parts to compileMichael Widenius2013-05-211-1/+1
| | | | |
| * | | | Temporary commit of 10.0-mergeMichael Widenius2013-03-261-2/+2
| | | | |
* | | | | 10.0-base mergeSergei Golubchik2013-07-181-0/+1
|\ \ \ \ \ | | |/ / / | |/| | |
| * | | | 5.5 mergeSergei Golubchik2013-07-171-0/+1
| |\ \ \ \ | | | |/ / | | |/| |
| | * | | -Run test suite with smaller aria keybuffer size (to make it possible to run ↵Michael Widenius2013-06-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | more tests in parallel) -Added test and extra code to ensure we don't leave keyread on for a handler table. -Create on disk temporary files always with long data pointers if SQL_SMALL_RESULT is not used. This ensures that we can handle temporary files bigger than 4G. mysql-test/include/default_mysqld.cnf: Run test suite with smaller aria keybuffer size mysql-test/suite/maria/maria3.result: Run test suite with smaller aria keybuffer size mysql-test/suite/sys_vars/r/aria_pagecache_buffer_size_basic.result: Run test suite with smaller aria keybuffer size sql/handler.cc: Disable key read (extra safety if something went wrong) sql/multi_range_read.cc: Ensure we have don't leave keyread on for secondary_file sql/opt_range.cc: Simplify code with mark_columns_used_by_index_no_reset() Ensure that read_keys_and_merge() disableds keyread if it enables it sql/opt_subselect.cc: Remove not anymore used argument for create_internal_tmp_table() sql/sql_derived.cc: Remove not anymore used argument for create_internal_tmp_table() sql/sql_select.cc: Use 'enable_keyread()' instead of calling HA_EXTRA_RESET. (Makes debugging easier) Create on disk temporary files always with long data pointers if SQL_SMALL_RESULT is not used. This ensures that we can handle temporary files bigger than 4G. Remove not anymore used argument for create_internal_tmp_table() More DBUG sql/sql_select.h: Remove not anymore used argument for create_internal_tmp_table()
* | | | | Merge 10.0-base -> 10.0unknown2013-05-281-2/+2
|\ \ \ \ \ | |/ / / /
| * | | | Fixed errors and compiler warnings found by buildbotMichael Widenius2013-05-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Solaris fixes: - Fixed that wait_timeout_func and wait_timeout tests works on solaris - We have to compile without NO_ALARM on Solaris as Solaris doesn't support timeouts on sockets with setsockopt(.. SO_RCVTIMEO). - Fixed that compile-solaris-amd64-debug works (before that we got a wrong ELF class: ELFCLASS64 on linkage) - Added missing sync_with_master Other bug fixes: - Free memory for rpl_global_gtid_binlog_state before exit() to avoid 'accessing uninitalized mutex' error. BUILD/FINISH.sh: Fixed issues on Solaris with ksh BUILD/compile-solaris-amd64-debug: Added missing -m64 flag configure.cmake: We have to compile without NO_ALARM on Solaris as Solaris doesn't support timeouts on sockets with setsockopt(.. SO_RCVTIMEO) mysql-test/suite/rpl/t/rpl_gtid_mdev4473.test: - Added missing sync_with_master (fix by knielsen) sql-common/client.c: Added () to get rid of compiler warning sql/item_strfunc.cc: Fixed compiler warning sql/log.cc: Free memory for static variable rpl_global_gtid_binlog_state before exit() - If we are compiling with safemalloc, we would try to call sf_free() for some members after sf_terminate() was called, which would result of trying to access the uninitalized mutex 'sf_mutex' sql/multi_range_read.cc: Fixed compiler warnings of converting double to ulong. sql/opt_range.cc: Fixed compiler warnings of converting double to ulong or uint - Better to have all variables that can be number of rows as 'ha_rows' sql/rpl_gtid.cc: Added rpl_binlog_state::free() to be able to free memory for static objects before exit() sql/rpl_gtid.h: Added rpl_binlog_state::free() to be able to free memory for static objects before exit() sql/set_var.cc: Fixed compiler warning sql/sql_join_cache.cc: Fixed compiler warnings of converting double to uint sql/sql_show.cc: Added cast to get rid of compiler warning sql/sql_statistics.cc: Remove code that didn't do anything. (store_record() with record[0] is a no-op) storage/xtradb/os/os0file.c: Added __attribute__ ((unused)) support-files/compiler_warnings.supp: Ignore warnings from atomic_add_64_nv (was not able to fix this with a cast as the macro is a bit different between systems) vio/viosocket.c: Added more DBUG_PRINT
* | | | | 10.0-base mergeSergei Golubchik2013-04-151-1/+1
|\ \ \ \ \ | |/ / / / | | | / / | |_|/ / |/| | |
| * | | 5.5 mergeSergei Golubchik2013-04-141-1/+1
| |\ \ \ | | |/ /
| | * | 5.3 mergeSergei Golubchik2013-04-121-1/+1
| | |\ \ | | | |/
| | | * MDEV-4244 [PATCH] Buffer overruns and use-after-free errorsSergei Golubchik2013-04-061-1/+1
| | | | | | | | | | | | | | | | fixes for gcc 4.8 -fsanitize=address
* | | | Merge 10.0-base -> 10.0.Igor Babaev2013-01-101-1/+1
|\ \ \ \ | |/ / / | | | | | | | | | | | | Also fixed a bug in sql_update.cc: the code of mysql_update() lacked a call of set_statistics_for_table().
| * | | Addressed all remaining issues from the review of the patchIgor Babaev2012-12-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that introduced engine independent persistent statistics. In particular: - added an enumeration type for possible values of the system variable use_stat_tables - renamed KEY::real_rec_per_key to KEY::actual_rec_per_key - optimized the collection of statistical data for any primary key defined only on one column.
| * | | Merge 5.5->5.5-mwl248.Igor Babaev2012-08-291-1/+1
| |\ \ \ | | |/ /
| * | | The pilot implementation of mwl#250: Use the statistics from persistentIgor Babaev2012-04-111-1/+1
| | | | | | | | | | | | | | | | statistical tables instead of the statistics provided by engine.