summaryrefslogtreecommitdiff
path: root/sql/sql_expression_cache.cc
Commit message (Collapse)AuthorAgeFilesLines
* Add likely/unlikely to speed up executionMonty2018-05-071-2/+3
| | | | | | | | | Added to: - if (error) - Lex - sql_yacc.yy and sql_yacc_ora.yy - In header files to alloc() calls - Added thd argument to thd_net_is_killed()
* Changed database, tablename and alias to be LEX_CSTRINGMonty2018-01-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This was done in, among other things: - thd->db and thd->db_length - TABLE_LIST tablename, db, alias and schema_name - Audit plugin database name - lex->db - All db and table names in Alter_table_ctx - st_select_lex db Other things: - Changed a lot of functions to take const LEX_CSTRING* as argument for db, table_name and alias. See init_one_table() as an example. - Changed some function arguments from LEX_CSTRING to const LEX_CSTRING - Changed some lists from LEX_STRING to LEX_CSTRING - threads_mysql.result changed because process list_db wasn't always correctly updated - New append_identifier() function that takes LEX_CSTRING* as arguments - Added new element tmp_buff to Alter_table_ctx to separate temp name handling from temporary space - Ensure we store the length after my_casedn_str() of table/db names - Removed not used version of rename_table_in_stat_tables() - Changed Natural_join_column::table_name and db_name() to never return NULL (used for print) - thd->get_db() now returns db as a printable string (thd->db.str or "")
* Enusure that my_global.h is included firstMichael Widenius2017-08-241-1/+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
|
* Stage 2 of MDEV-6152:Monty2015-08-211-1/+2
| | | | | | | | - Added mem_root to all calls to new Item - Added private method operator new(size_t size) to Item to ensure that we always use a mem_root when creating an item. This saves use once call to current_thd per Item creation
* MDEV-8010 - Avoid sql_alloc() in Items (Patch #1)Sergey Vojtovich2015-08-211-1/+1
| | | | | | | Added mandatory thd parameter to Item (and all derivative classes) constructor. Added thd parameter to all routines that may create items. Also removed "current_thd" from Item::Item. This reduced number of pthread_getspecific() calls from 290 to 177 per OLTP RO transaction.
* MDEV-7811: EXPLAIN/ANALYZE FORMAT=JSON should show subquery cacheSergei Petrunia2015-07-011-9/+9
| | | | | | | Fixes over the original patch: - Fix variable/class/other names - Fix the JSON output to be in line with the output of other JSON constructs we produce
* MDEV-7811: EXPLAIN/ANALYZE FORMAT=JSON should show subquery cacheOleksandr Byelkin2015-06-301-1/+14
|
* MDEV-5120 Test suite test maria-no-logging failsMichael Widenius2014-09-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The reason for the failure was a bug in an include file on debian that causes 'struct stat' to have different sized depending on the environment. This patch fixes so that we always include my_global.h or my_config.h before we include any other files. Other things: - Removed #include <my_global.h> in some include files; Better to always do this at the top level to have as few "always-include-this-file-first' files as possible. - Removed usage of some include files that where already included by my_global.h or by other files. client/mysql_plugin.c: Use my_global.h first client/mysqlslap.c: Remove duplicated include files extra/comp_err.c: Remove duplicated include files include/m_string.h: Remove duplicated include files include/maria.h: Remove duplicated include files libmysqld/emb_qcache.cc: Use my_global.h first plugin/semisync/semisync.h: Use my_pthread.h first sql/datadict.cc: Use my_global.h first sql/debug_sync.cc: Use my_global.h first sql/derror.cc: Use my_global.h first sql/des_key_file.cc: Use my_global.h first sql/discover.cc: Use my_global.h first sql/event_data_objects.cc: Use my_global.h first sql/event_db_repository.cc: Use my_global.h first sql/event_parse_data.cc: Use my_global.h first sql/event_queue.cc: Use my_global.h first sql/event_scheduler.cc: Use my_global.h first sql/events.cc: Use my_global.h first sql/field.cc: Use my_global.h first Remove duplicated include files sql/field_conv.cc: Use my_global.h first sql/filesort.cc: Use my_global.h first Remove duplicated include files sql/gstream.cc: Use my_global.h first sql/ha_ndbcluster.cc: Use my_global.h first sql/ha_ndbcluster_binlog.cc: Use my_global.h first sql/ha_ndbcluster_cond.cc: Use my_global.h first sql/ha_partition.cc: Use my_global.h first sql/handler.cc: Use my_global.h first sql/hash_filo.cc: Use my_global.h first sql/hostname.cc: Use my_global.h first sql/init.cc: Use my_global.h first sql/item.cc: Use my_global.h first sql/item_buff.cc: Use my_global.h first sql/item_cmpfunc.cc: Use my_global.h first sql/item_create.cc: Use my_global.h first sql/item_geofunc.cc: Use my_global.h first sql/item_inetfunc.cc: Use my_global.h first sql/item_row.cc: Use my_global.h first sql/item_strfunc.cc: Use my_global.h first sql/item_subselect.cc: Use my_global.h first sql/item_sum.cc: Use my_global.h first sql/item_timefunc.cc: Use my_global.h first sql/item_xmlfunc.cc: Use my_global.h first sql/key.cc: Use my_global.h first sql/lock.cc: Use my_global.h first sql/log.cc: Use my_global.h first sql/log_event.cc: Use my_global.h first sql/log_event_old.cc: Use my_global.h first sql/mf_iocache.cc: Use my_global.h first sql/mysql_install_db.cc: Remove duplicated include files sql/mysqld.cc: Remove duplicated include files sql/net_serv.cc: Remove duplicated include files sql/opt_range.cc: Use my_global.h first sql/opt_subselect.cc: Use my_global.h first sql/opt_sum.cc: Use my_global.h first sql/parse_file.cc: Use my_global.h first sql/partition_info.cc: Use my_global.h first sql/procedure.cc: Use my_global.h first sql/protocol.cc: Use my_global.h first sql/records.cc: Use my_global.h first sql/records.h: Don't include my_global.h Better to do this at the upper level sql/repl_failsafe.cc: Use my_global.h first sql/rpl_filter.cc: Use my_global.h first sql/rpl_gtid.cc: Use my_global.h first sql/rpl_handler.cc: Use my_global.h first sql/rpl_injector.cc: Use my_global.h first sql/rpl_record.cc: Use my_global.h first sql/rpl_record_old.cc: Use my_global.h first sql/rpl_reporting.cc: Use my_global.h first sql/rpl_rli.cc: Use my_global.h first sql/rpl_tblmap.cc: Use my_global.h first sql/rpl_utility.cc: Use my_global.h first sql/set_var.cc: Added comment sql/slave.cc: Use my_global.h first sql/sp.cc: Use my_global.h first sql/sp_cache.cc: Use my_global.h first sql/sp_head.cc: Use my_global.h first sql/sp_pcontext.cc: Use my_global.h first sql/sp_rcontext.cc: Use my_global.h first sql/spatial.cc: Use my_global.h first sql/sql_acl.cc: Use my_global.h first sql/sql_admin.cc: Use my_global.h first sql/sql_analyse.cc: Use my_global.h first sql/sql_audit.cc: Use my_global.h first sql/sql_base.cc: Use my_global.h first sql/sql_binlog.cc: Use my_global.h first sql/sql_bootstrap.cc: Use my_global.h first Use my_global.h first sql/sql_cache.cc: Use my_global.h first sql/sql_class.cc: Use my_global.h first sql/sql_client.cc: Use my_global.h first sql/sql_connect.cc: Use my_global.h first sql/sql_crypt.cc: Use my_global.h first sql/sql_cursor.cc: Use my_global.h first sql/sql_db.cc: Use my_global.h first sql/sql_delete.cc: Use my_global.h first sql/sql_derived.cc: Use my_global.h first sql/sql_do.cc: Use my_global.h first sql/sql_error.cc: Use my_global.h first sql/sql_explain.cc: Use my_global.h first sql/sql_expression_cache.cc: Use my_global.h first sql/sql_handler.cc: Use my_global.h first sql/sql_help.cc: Use my_global.h first sql/sql_insert.cc: Use my_global.h first sql/sql_lex.cc: Use my_global.h first sql/sql_load.cc: Use my_global.h first sql/sql_locale.cc: Use my_global.h first sql/sql_manager.cc: Use my_global.h first sql/sql_parse.cc: Use my_global.h first sql/sql_partition.cc: Use my_global.h first sql/sql_plugin.cc: Added comment sql/sql_prepare.cc: Use my_global.h first sql/sql_priv.h: Added error if we use this before including my_global.h This check is here becasue so many files includes sql_priv.h first. sql/sql_profile.cc: Use my_global.h first sql/sql_reload.cc: Use my_global.h first sql/sql_rename.cc: Use my_global.h first sql/sql_repl.cc: Use my_global.h first sql/sql_select.cc: Use my_global.h first sql/sql_servers.cc: Use my_global.h first sql/sql_show.cc: Added comment sql/sql_signal.cc: Use my_global.h first sql/sql_statistics.cc: Use my_global.h first sql/sql_table.cc: Use my_global.h first sql/sql_tablespace.cc: Use my_global.h first sql/sql_test.cc: Use my_global.h first sql/sql_time.cc: Use my_global.h first sql/sql_trigger.cc: Use my_global.h first sql/sql_udf.cc: Use my_global.h first sql/sql_union.cc: Use my_global.h first sql/sql_update.cc: Use my_global.h first sql/sql_view.cc: Use my_global.h first sql/sys_vars.cc: Added comment sql/table.cc: Use my_global.h first sql/thr_malloc.cc: Use my_global.h first sql/transaction.cc: Use my_global.h first sql/uniques.cc: Use my_global.h first sql/unireg.cc: Use my_global.h first sql/unireg.h: Removed inclusion of my_global.h storage/archive/ha_archive.cc: Added comment storage/blackhole/ha_blackhole.cc: Use my_global.h first storage/csv/ha_tina.cc: Use my_global.h first storage/csv/transparent_file.cc: Use my_global.h first storage/federated/ha_federated.cc: Use my_global.h first storage/federatedx/federatedx_io.cc: Use my_global.h first storage/federatedx/federatedx_io_mysql.cc: Use my_global.h first storage/federatedx/federatedx_io_null.cc: Use my_global.h first storage/federatedx/federatedx_txn.cc: Use my_global.h first storage/heap/ha_heap.cc: Use my_global.h first storage/innobase/handler/handler0alter.cc: Use my_global.h first storage/maria/ha_maria.cc: Use my_global.h first storage/maria/unittest/ma_maria_log_cleanup.c: Remove duplicated include files storage/maria/unittest/test_file.c: Added comment storage/myisam/ha_myisam.cc: Move sql_plugin.h first as this includes my_global.h storage/myisammrg/ha_myisammrg.cc: Use my_global.h first storage/oqgraph/oqgraph_thunk.cc: Use my_config.h and my_global.h first One could not include my_global.h before oqgraph_thunk.h (don't know why) storage/spider/ha_spider.cc: Use my_global.h first storage/spider/hs_client/config.cpp: Use my_global.h first storage/spider/hs_client/escape.cpp: Use my_global.h first storage/spider/hs_client/fatal.cpp: Use my_global.h first storage/spider/hs_client/hstcpcli.cpp: Use my_global.h first storage/spider/hs_client/socket.cpp: Use my_global.h first storage/spider/hs_client/string_util.cpp: Use my_global.h first storage/spider/spd_conn.cc: Use my_global.h first storage/spider/spd_copy_tables.cc: Use my_global.h first storage/spider/spd_db_conn.cc: Use my_global.h first storage/spider/spd_db_handlersocket.cc: Use my_global.h first storage/spider/spd_db_mysql.cc: Use my_global.h first storage/spider/spd_db_oracle.cc: Use my_global.h first storage/spider/spd_direct_sql.cc: Use my_global.h first storage/spider/spd_i_s.cc: Use my_global.h first storage/spider/spd_malloc.cc: Use my_global.h first storage/spider/spd_param.cc: Use my_global.h first storage/spider/spd_ping_table.cc: Use my_global.h first storage/spider/spd_sys_table.cc: Use my_global.h first storage/spider/spd_table.cc: Use my_global.h first storage/spider/spd_trx.cc: Use my_global.h first storage/xtradb/handler/handler0alter.cc: Use my_global.h first storage/xtradb/handler/i_s.cc: Use my_global.h first
* 5.5 mergeSergei Golubchik2013-07-171-1/+1
|\
| * mdev-4173: Wrong result (extra row) with semijoin=on, joins in outer query, ↵Sergey Petrunya2013-07-161-1/+1
| | | | | | | | | | | | | | | | | | | | LEFT JOIN in the subquery Apply the patch from Patryk Pomykalski: - create_internal_tmp_table_from_heap() will now return information whether the last row that we tried to write was a duplicate row. (mysql-5.6 also has this change)
* | MDEV-452 Add full support for auto-initialized/updated timestamp and datetimeunknown2012-10-171-1/+1
|/ | | | | | | | | | | | | | | | | | Generalized support for auto-updated and/or auto-initialized timestamp and datetime columns. This patch is a reimplementation of MySQL's "WL#5874: CURRENT_TIMESTAMP as DEFAULT for DATETIME columns". In order to ease future merges, this implementation reused few function and variable names from MySQL's patch, however the implementation is quite different. TODO: The only unresolved problem in this patch is the semantics of LOAD DATA for TIMESTAMP and DATETIME columns in the cases when there are missing or NULL columns. I couldn't fully comprehend the logic behind MySQL's behavior and its relationship with their own documentation, so I left the results to be more consistent with all other LOAD cases. The problematic test cases can be seen by running the test file function_defaults, and observing the test case differences. Those were left on purpose for discussion.
* don't forget to call ha_index_end before destroying the handlerSergei Golubchik2011-10-191-1/+2
|
* merge with 5.3Sergei Golubchik2011-10-191-66/+108
|\ | | | | | | | | | | | | | | | | | | | | | | | | sql/sql_insert.cc: CREATE ... IF NOT EXISTS may do nothing, but it is still not a failure. don't forget to my_ok it. ****** CREATE ... IF NOT EXISTS may do nothing, but it is still not a failure. don't forget to my_ok it. sql/sql_table.cc: small cleanup ****** small cleanup
| * Early check of subquery cache hit rate added to limit its performance impact ↵unknown2011-08-121-9/+29
| | | | | | | | | | | | | | | | | | | | in the worst case. sql/sql_expression_cache.cc: Early check of subquery cache hit rate added to limit its performance impact in the worst case. Disabling cache moved to method. sql/sql_expression_cache.h: Disabling cache moved to method.
| * Protect statistic variables of subquery cache.unknown2011-08-121-2/+5
| |
| * Subquery cache going on disk management fix: Do not go on disk if hit rate ↵unknown2011-07-281-6/+42
| | | | | | | | | | | | | | | | | | | | is not good. sql/sql_expression_cache.cc: Do not go on disk if hit rate is not good. Local hit/miss counters added. sql/sql_expression_cache.h: Local hit/miss counters added.
| * Fixed LP BUG#800696.unknown2011-07-191-44/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was that optimizer removes some outer references (it they are constant for example) and the list of outer items built during prepare phase is not actual during execution phase when we need it as the cache parameters. First solution was use pointer on pointer on outer reference Item and initialize temporary table on demand. This solved most problem except case when optimiser also reduce Item which contains outer references ('OR' in this bug test suite). The solution is to build the list of outer reference items on execution phase (after optimization) on demand (just before temporary table creation) by walking Item tree and finding outer references among Item_ident (Item_field/Item_ref) and Item_sum items. Removed depends_on list (because it is not neede any mnore for the cache, in the place where it was used it replaced with upper_refs). Added processor (collect_outer_ref_processor) and get_cache_parameters() methods to collect outer references (or other expression parameters in future). mysql-test/r/subselect_cache.result: A new test added. mysql-test/r/subselect_scache.result: Changes in creating the cache and its paremeters order or adding arguments of aggregate function (which is a parameter also, but this has no influence on the result). mysql-test/t/subselect_cache.test: Added a new test. sql/item.cc: depends_on removed. Added processor (collect_outer_ref_processor) and get_cache_parameters() methods to collect outer references. Item_cache_wrapper collect parameters befor initialization of its cache. sql/item.h: depends_on removed. Added processor (collect_outer_ref_processor) and get_cache_parameters() methods to collect outer references. sql/item_cmpfunc.cc: depends_on removed. Added processor (collect_outer_ref_processor) to collect outer references. sql/item_cmpfunc.h: Added processor (collect_outer_ref_processor) to collect outer references. sql/item_subselect.cc: depends_on removed. Added processor get_cache_parameters() method to collect outer references. sql/item_subselect.h: depends_on removed. Added processor get_cache_parameters() method to collect outer references. sql/item_sum.cc: Added processor (collect_outer_ref_processor) method to collect outer references. sql/item_sum.h: Added processor (collect_outer_ref_processor) and get_cache_parameters() methods to collect outer references. sql/opt_range.cc: depends_on removed. sql/sql_base.cc: depends_on removed. sql/sql_class.h: New iterator added. sql/sql_expression_cache.cc: Build of list of items resolved in outer query done just before creating expression cache on the first execution of the subquery which removes influence of optimizer removing items (all optimization already done). sql/sql_expression_cache.h: Build of list of items resolved in outer query done just before creating expression cache on the first execution of the subquery which removes influence of optimizer removing items (all optimization already done). sql/sql_lex.cc: depends_on removed. sql/sql_lex.h: depends_on removed. sql/sql_list.h: Added add_unique method to add only unique elements to the list. sql/sql_select.cc: Support of new Item list added. sql/sql_select.h: Support of new Item list added.
| * New status variables: Rows_tmp_read, Handler_tmp_update and Handler_tmp_writeMichael Widenius2011-06-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Split status variable Rows_read to Rows_read and Rows_tmp_read so that one can see how much real data is read. Same was done with with Handler_update and Handler_write. Fixed bug in MEMORY tables where some variables was counted twice. Added new internal handler call 'ha_close()' to have one place to gather statistics. Fixed bug where thd->open_options was set to wrong value when doing admin_recreate_table() mysql-test/r/status.result: Updated test results and added new tests mysql-test/r/status_user.result: Udated test results mysql-test/t/status.test: Added new test for temporary table status variables sql/ha_partition.cc: Changed to call ha_close() instead of close() sql/handler.cc: Added internal_tmp_table variable for easy checking of temporary tables. Added new internal handler call 'ha_close()' to have one place to gather statistics. Gather statistics for internal temporary tables. sql/handler.h: Added handler variables internal_tmp_table, rows_tmp_read. Split function update_index_statistics() to two. Added ha_update_tmp_row() for faster tmp table handling with more statistics. sql/item_sum.cc: ha_write_row() -> ha_write_tmp_row() sql/multi_range_read.cc: close() -> ha_close() sql/mysqld.cc: New status variables: Rows_tmp_read, Handler_tmp_update and Handler_tmp_write sql/opt_range.cc: close() -> ha_close() sql/sql_base.cc: close() -> ha_close() sql/sql_class.cc: Added handling of rows_tmp_read sql/sql_class.h: Added new satistics variables. rows_read++ -> update_rows_read() to be able to correctly count reads to internal temp tables. Added handler::ha_update_tmp_row() sql/sql_connect.cc: Added comment sql/sql_expression_cache.cc: ha_write_row() -> ha_write_tmp_row() sql/sql_select.cc: close() -> ha_close() ha_update_row() -> ha_update_tmp_row() sql/sql_show.cc: ha_write_row() -> ha_write_tmp_row() sql/sql_table.cc: Fixed bug where thd->open_options was set to wrong value when doing admin_recreate_table() sql/sql_union.cc: ha_write_row() -> ha_write_tmp_row() sql/sql_update.cc: ha_write_row() -> ha_write_tmp_row() sql/table.cc: close() -> ha_close() storage/heap/ha_heap.cc: Removed double counting of statistic variables. close -> ha_close() to get tmp table statistics. storage/maria/ha_maria.cc: close -> ha_close() to get tmp table statistics.
| * Fixed valgrind problem in expression cache (double opening the table).unknown2011-05-301-1/+2
| | | | | | | | | | sql/sql_expression_cache.cc: The call should not open the temporary table. It will be done later after its index creation.
| * Fixed all BUILD scripts to use g++ instead of gcc for linkingMichael Widenius2011-03-311-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed memory leak from HEAP tables that was not deleted properly BUILD/compile-alpha-ccc: Use g++ instead of gcc for linking BUILD/compile-alpha-debug: Use g++ instead of gcc for linking BUILD/compile-pentium-pgcc: Use g++ instead of gcc for linking BUILD/compile-solaris-sparc: Use g++ instead of gcc for linking BUILD/compile-solaris-sparc-debug: Use g++ instead of gcc for linking BUILD/compile-solaris-sparc-purify: Use g++ instead of gcc for linking sql/item.cc: Safety fixes for expr_cache Call Item_result:field::cleanup() in Item_cache_wrapper::cleanup() More DBUG_PRINT sql/sql_base.cc: Simple optimization for setup_wild More DBUG_PRINT sql/sql_expression_cache.cc: Added header Removed not needed initialization sql/sql_lex.cc: More DBUG_PRINT sql/sql_select.cc: More DBUG_PRINT Fixed memory leak from HEAP tables that was not deleted properly storage/heap/hp_create.c: More DBUG_PRINT
| * use normal unique (HA_NOSAME) keys for expression cacheSergei Golubchik2011-01-141-1/+0
| | | | | | | | | | | | | | | | temptables, not "uniques", that are hash-based keys. sql/sql_expression_cache.cc: Don't set uniques (we don't want or need an unique constraint on this table)
* | lots of post-merge changesSergei Golubchik2011-04-251-4/+8
|/
* fix windows embeddedSergei Golubchik2010-11-021-4/+2
|
* Type of the variables fixed.unknown2010-10-271-1/+1
| | | | | | | sql/sql_expression_cache.cc: Type of the variable fixed. sql/sql_expression_cache.h: Type of the variable fixed.
* (no commit message)unknown2010-09-081-59/+4
|
* Fixed LP BUG#615760: Check on double cache assignment added into the ↵unknown2010-09-061-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | transformation methods. Cache parameters print added in EXPLAIN EXTENDED output. mysql-test/r/compare.result: Cache parameters print added in EXPLAIN EXTENDED output. mysql-test/r/group_by.result: Cache parameters print added in EXPLAIN EXTENDED output. mysql-test/r/subselect.result: Cache parameters print added in EXPLAIN EXTENDED output. mysql-test/r/subselect3.result: Cache parameters print added in EXPLAIN EXTENDED output. mysql-test/r/subselect3_jcl6.result: Cache parameters print added in EXPLAIN EXTENDED output. mysql-test/r/subselect4.result: Cache parameters print added in EXPLAIN EXTENDED output. mysql-test/r/subselect_cache.result: Added test suite for LP BUG#615760 mysql-test/r/subselect_mat.result: Cache parameters print added in EXPLAIN EXTENDED output. mysql-test/r/subselect_no_mat.result: Cache parameters print added in EXPLAIN EXTENDED output. mysql-test/r/subselect_no_opts.result: Cache parameters print added in EXPLAIN EXTENDED output. mysql-test/r/subselect_no_semijoin.result: Cache parameters print added in EXPLAIN EXTENDED output. mysql-test/r/subselect_sj.result: Cache parameters print added in EXPLAIN EXTENDED output. mysql-test/r/subselect_sj_jcl6.result: Cache parameters print added in EXPLAIN EXTENDED output. mysql-test/suite/pbxt/r/subselect.result: Cache parameters print added in EXPLAIN EXTENDED output. mysql-test/t/subselect_cache.test: Cache parameters print added in EXPLAIN EXTENDED output. sql/item.cc: Item::set_expr_cache result fixed according to its description. Cache parameters print added in EXPLAIN EXTENDED output. sql/item.h: Cache parameters print added in EXPLAIN EXTENDED output. sql/item_cmpfunc.cc: Check on double cache assignment added into the transformation methods. sql/item_cmpfunc.h: Check on double cache assignment added into the transformation methods. sql/item_subselect.cc: Check on double cache assignment added into the transformation methods. sql/item_subselect.h: Check on double cache assignment added into the transformation methods. sql/sql_expression_cache.cc: Cache parameters print added. sql/sql_expression_cache.h: Cache parameters print added. sql/sql_select.cc: Removed unused method (now it is impossible to make double transformation with the cache). sql/sql_select.h: Removed unused method.
* Fix for LP bug#611625: Removing NULL references from subquery parameter list ↵unknown2010-08-091-12/+22
| | | | | | | | | | | | | | | | added. Incorrect limitation on number of parameters removed. mysql-test/r/subselect_cache.result: Test suite added. mysql-test/t/subselect_cache.test: Test suite added. sql/sql_class.h: Iterator changed. sql/sql_expression_cache.cc: Incorrect limitation removed. Removing NULL references from subquery parameter list added.
* Fix for luanchpad bug#609043unknown2010-07-301-9/+1
| | | | | | | | | | | | | | | | | | | | | Removed indirect reference in equalities for cache index lookup. We should use a direct reference because some optimization of the query may optimize out a condition predicate and if the outer reference is the only element of the condition predicate the indirect reference becomes NULL. We can resolve correctly the indirect reference in Expression_cache_tmptable::make_equalities because it is called before optimization of the cached subquery. mysql-test/r/subquery_cache.result: The test suite for the bug added. mysql-test/t/subquery_cache.test: The test suite for the bug added. sql/sql_expression_cache.cc: Removed indirect reference in equalities for cache index lookup.
* Subquery cache (MWL#66) added.unknown2010-07-101-0/+314
libmysqld/Makefile.am: The new file added. mysql-test/r/index_merge_myisam.result: subquery_cache optimization option added. mysql-test/r/myisam_mrr.result: subquery_cache optimization option added. mysql-test/r/subquery_cache.result: The subquery cache tests added. mysql-test/r/subselect3.result: Subquery cache switched off to avoid changing read statistics. mysql-test/r/subselect3_jcl6.result: Subquery cache switched off to avoid changing read statistics. mysql-test/r/subselect_no_mat.result: subquery_cache optimization option added. mysql-test/r/subselect_no_opts.result: subquery_cache optimization option added. mysql-test/r/subselect_no_semijoin.result: subquery_cache optimization option added. mysql-test/r/subselect_sj.result: subquery_cache optimization option added. mysql-test/r/subselect_sj_jcl6.result: subquery_cache optimization option added. mysql-test/t/subquery_cache.test: The subquery cache tests added. mysql-test/t/subselect3.test: Subquery cache switched off to avoid changing read statistics. sql/CMakeLists.txt: The new file added. sql/Makefile.am: The new files added. sql/item.cc: Expression cache item (Item_cache_wrapper) added. Item_ref and Item_field fixed for correct usage of result field and fast resolwing in SP. sql/item.h: Expression cache item (Item_cache_wrapper) added. Item_ref and Item_field fixed for correct usage of result field and fast resolwing in SP. sql/item_cmpfunc.cc: Subquery cache added. sql/item_cmpfunc.h: Subquery cache added. sql/item_subselect.cc: Subquery cache added. sql/item_subselect.h: Subquery cache added. sql/item_sum.cc: Registration of subquery parameters added. sql/mysql_priv.h: subquery_cache optimization option added. sql/mysqld.cc: subquery_cache optimization option added. sql/opt_range.cc: Fix due to subquery cache. sql/opt_subselect.cc: Parameters of the function cahnged. sql/procedure.h: .h file guard added. sql/sql_base.cc: Registration of subquery parameters added. sql/sql_class.cc: Option to allow add indeces to temporary table. sql/sql_class.h: Item iterators added. Option to allow add indeces to temporary table. sql/sql_expression_cache.cc: Expression cache for caching subqueries added. sql/sql_expression_cache.h: Expression cache for caching subqueries added. sql/sql_lex.cc: Registration of subquery parameters added. sql/sql_lex.h: Registration of subqueries and subquery parameters added. sql/sql_select.cc: Subquery cache added. sql/sql_select.h: Subquery cache added. sql/sql_union.cc: A new parameter to the function added. sql/sql_update.cc: A new parameter to the function added. sql/table.cc: Procedures to manage temporarty tables index added. sql/table.h: Procedures to manage temporarty tables index added. storage/maria/ha_maria.cc: Fix of handler to allow destoy a table in case of error during the table creation. storage/maria/ha_maria.h: .h file guard added. storage/myisam/ha_myisam.cc: Fix of handler to allow destoy a table in case of error during the table creation.