summaryrefslogtreecommitdiff
path: root/sql/item_subselect.cc
Commit message (Collapse)AuthorAgeFilesLines
* * Added comments and one assertunknown2004-12-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/item.cc: * More comments * Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/item.h: Assert added sql/item_cmpfunc.cc: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/item_func.cc: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/item_strfunc.h: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/item_subselect.cc: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/item_sum.cc: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/set_var.cc: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/sql_base.cc: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/sql_handler.cc: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/sql_help.cc: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/sql_select.cc: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields()
* new reference which refer to current value not to result used for ↵unknown2004-12-111-6/+7
| | | | | | | | | | | | | | | | | | | resolving outer refernces if subqueri is not in HAVING clause (BUG#7079) and the same used for subquery transformetion mysql-test/r/subselect.result: reference on changable fields from subquery mysql-test/t/subselect.test: reference on changable fields from subquery sql/item.cc: new reference which refer to current value not to result used sql/item.h: new reference which refer to current value not to result used sql/item_subselect.cc: new reference which refer to current value not to result used
* A fix and test case for Bug#6873 "PS, having with subquery, crash unknown2004-12-091-0/+2
| | | | | | | | | | | | | during execute" mysql-test/r/ps.result: Test results updated (Bug#6873) mysql-test/t/ps.test: A test case for Bug#6873 "PS, having with subquery, crash during execute". sql/item_subselect.cc: If we transform having subtree, modify SELECT_LEX::having pointer to point to the new having tree root.
* postreview fixunknown2004-12-071-2/+7
| | | | | | | | | | | | | | sql/item_cmpfunc.cc: comment fixed sql/item_subselect.cc: comment fixed debug info and inherited method call sql/item_subselect.h: comment fixed sql/item_sum.cc: comment fixed sql/item_sum.h: comment fixed
* reporting empty result added in case of max/min optimisation of ALL/ANY/SOME ↵unknown2004-11-181-7/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | subqueries fixed null processing in NOT operation used in ALL subquery (Bug #6247) mysql-test/r/subselect.result: new tests of ALL/ANY wiews mysql-test/t/subselect.test: new tests of ALL/ANY wiews sql/item_cmpfunc.cc: fixed special NOT ALL processing fixed processing max/min optimized subqueries with empty results (added methods to detect empty results) and special NOP operation to process them for SOME/ANY sobqueries sql/item_cmpfunc.h: fixed processing max/min optimized subqueries with empty results (added methods to detect empty results) and special NOP operation to process them for SOME/ANY sobqueries sql/item_subselect.cc: reporting empty result added for max/min subqueries sql/item_subselect.h: reporting empty result added for max/min subqueries sql/item_sum.cc: reporting empty result added fox max/min aggregate functions sql/item_sum.h: reporting empty result added fox max/min aggregate functions sql/sql_class.cc: reporting empty result added for max/min subqueries sql/sql_parse.cc: reporting empty result added for max/min subqueries sql/sql_union.cc: reporting empty result added for max/min subqueries
* Simpler arena swapping codeunknown2004-11-081-24/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now thd->mem_root is a pointer to thd->main_mem_root and THR_MALLOC is a pointer to thd->mem_root. This gives us the following benefits: - Allow us to easily detect if arena has already been swapped before (this fixes a bug in setup_conds() where arena was swaped twice in some cases) - Faster swaps of arenas (as we don't have to copy the whole MEM_ROOT) - We don't anymore have to call my_pthread_setspecific_ptr(THR_MALLOC,...) to change where memory is alloced. Now it's enough to set thd->mem_root client/mysqltest.c: Remove some not needed defines (Things like this should be done in config-win.h) include/config-win.h: Added popen() and pclose() compatibility macros mysql-test/t/rpl_failed_optimize-master.opt: Portability fix sql/ha_berkeley.cc: New thd->memroot handling sql/item_cmpfunc.cc: Simpler arena swapping code sql/item_func.cc: Simpler arena swapping code sql/item_subselect.cc: Simpler arena swapping code New thd->mem_root handling sql/item_sum.cc: New thd->mem_root handling sql/item_timefunc.cc: Fixed not-initalized usage errors found by valgrind sql/log_event.cc: New thd->mem_root handling sql/mysql_priv.h: New thd->mem_root handling sql/mysqld.cc: New thd->mem_root handling sql/opt_range.cc: New thd->mem_root handling sql/repl_failsafe.cc: New thd->mem_root handling sql/set_var.cc: New thd->mem_root handling sql/sql_acl.cc: New thd->mem_root handling sql/sql_base.cc: Simpler arena swapping code New thd->mem_root handling sql/sql_class.cc: New thd->mem_root handling sql/sql_class.h: Simpler arena swapping code New thd->mem_root handling sql/sql_db.cc: New thd->mem_root handling sql/sql_error.cc: New thd->mem_root handling sql/sql_help.cc: New thd->mem_root handling sql/sql_insert.cc: New thd->mem_root handling sql/sql_parse.cc: New thd->mem_root handling Added some extra checking of return value of new sql/sql_prepare.cc: New thd->mem_root handling sql/sql_select.cc: New thd->mem_root handling sql/sql_select.h: New thd->mem_root handling sql/sql_union.cc: Simpler arena swapping code sql/sql_yacc.yy: New thd->mem_root handling sql/table.cc: New thd->mem_root handling sql/thr_malloc.cc: New thd->mem_root handling tests/client_test.c: Added drop table to some tests Changed some table names to 't1'
* removed incorrect error message about aggregate functionsunknown2004-10-271-15/+76
| | | | | | | | | | | | | | | | | | | improved mechanisn of detection posibility to be NULL for single row queries switched off substitution optimisation for single row subqueries in PS due to problem in resolving substituted expressions (changes to make subselects test working with PS protocol) mysql-test/r/subselect.result: removed incorrect error message about aggregate functions improved mechanisn of detection posibility to be NULL for single row queries mysql-test/t/subselect.test: removed incorrect error message about aggregate functions sql/item_subselect.cc: removed incorrect error message about aggregate functions switched off substitution optimisation for single row subqueries in PS due to problem in resolving substituted expressions improved mechanisn of detection posibility to be NULL for single row queries sql/item_subselect.h: new method to help in NULL ability detection
* A lot of fixes for prepared statements (PS):unknown2004-10-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New mysqltest that can run mysqltest with PS Added support for ZEROFILL in PS Fixed crash when one called mysql_stmt_store_result() without a preceding mysql_stmt_bind_result() Updated test cases to support --ps-protocol (Some tests are still run using old protocol) Fixed crash in PS when using SELECT * FROM t1 NATURAL JOIN t2... Fixed crash in PS when using sub queries Create table didn't signal when table was created. This could cause a "DROP TABLE created_table" in another thread to wait "forever" Fixed wrong permissions check in PS and multi-table updates (one could get permission denied for legal quries) Fix for PS and SELECT ... PROCEDURE Reset all warnings when executing a new PS query group_concat(...ORDER BY) didn't work with PS Fixed problem with test suite when not using innodb BitKeeper/deleted/.del-innodb-lock-master.opt~f76a4a1999728f87: Delete: mysql-test/t/innodb-lock-master.opt client/Makefile.am: mysqltest now uses regex client/mysqltest.c: Added support for testing of prepared statements (with --ps-protocol) Main code was done by Kent, I did mainly some cleanups and minor bug fixes New test commands: --disable_ps_protocol --enable_ps_protocol NOTE: new code still has some things that needs to be cleaned up. For example run_query_stmt_handle_error() should be made more general so that same code can be used also by 'normal' queries configure.in: mysqltest now uses regex libmysql/libmysql.c: Reset warning_count after prepare (safety). In the future we should also provide warnings on prepare integer -> string conversion now handles ZEROFILL double -> string conversion is now closer to the one in the server Fixed crash when one called mysql_stmt_store_result() without preceding mysql_stmt_bind_result() libmysqld/examples/Makefile.am: mysqltest now uses regex mysql-test/include/have_query_cache.inc: Fixes for --ps-protocol mysql-test/include/ps_conv.inc: Fixes for --ps-protocol mysql-test/mysql-test-run.sh: Added options --ps-protocol mysql-test/r/ctype_utf8.result: Fixed test case mysql-test/r/fulltext_cache.result: Changed output of MATCH to use round() to get same numbers with --ps-protocol mysql-test/r/fulltext_left_join.result: Changed output of MATCH to use round() to get same numbers with --ps-protocol mysql-test/r/fulltext_multi.result: Changed output of MATCH to use round() to get same numbers with --ps-protocol mysql-test/r/innodb-lock.result: Fixed test to work even if Innodb is not compiled in. mysql-test/t/create.test: Fixes for --ps-protocol mysql-test/t/ctype_utf8.test: Remove warnings mysql-test/t/date_formats.test: Fixes for --ps-protocol mysql-test/t/fulltext_cache.test: Changed output of MATCH to use round() to get same numbers with --ps-protocol mysql-test/t/fulltext_left_join.test: Changed output of MATCH to use round() to get same numbers with --ps-protocol mysql-test/t/fulltext_multi.test: Changed output of MATCH to use round() to get same numbers with --ps-protocol mysql-test/t/func_group.test: Fixes for --ps-protocol mysql-test/t/func_sapdb.test: Fixes for --ps-protocol mysql-test/t/innodb-lock.test: Fixed test to work even if Innodb is not compiled in. mysql-test/t/insert.test: Fixes for --ps-protocol mysql-test/t/insert_select.test: Fixes for --ps-protocol mysql-test/t/insert_update.test: Fixes for --ps-protocol mysql-test/t/metadata.test: Fixes for --ps-protocol mysql-test/t/multi_statement.test: Fixes for --ps-protocol mysql-test/t/ps_1general.test: Fixes for --ps-protocol mysql-test/t/rollback.test: Fixes for --ps-protocol mysql-test/t/rpl_redirect.test: Fixes for --ps-protocol mysql-test/t/rpl_user_variables.test: Fixes for --ps-protocol mysql-test/t/select.test: Fixes for --ps-protocol mysql-test/t/status.test: Fixes for --ps-protocol mysql-test/t/type_blob.test: Fixes for --ps-protocol mysql-test/t/type_float.test: Fixes for --ps-protocol mysql-test/t/union.test: Fixes for --ps-protocol mysql-test/t/warnings.test: Fixes for --ps-protocol mysys/my_alloc.c: More debugging information sql-common/client.c: More debugging information sql-common/my_time.c: TIME didn't support full range with PS sql/field.cc: TIME didn't support full range with PS sql/item_cmpfunc.cc: IN(constants,...) didn't work with PS sql/item_subselect.cc: Some subqueries didn't work with PS sql/item_sum.cc: group_concat(...ORDER BY) didn't work with PS Removed variable warning_available as 'warning' can be used for this. sql/item_sum.h: Removed not needed variable sql/protocol.cc: TIME didn't support full range with PS sql/set_var.cc: Style fix sql/sql_base.cc: setup_wild() didn't properly restore old arena, which caused core dump in PS when using SELECT * FROM t1 NATURAL JOIN t2... sql/sql_class.cc: Style fix sql/sql_error.cc: Style fix sql/sql_insert.cc: Create table didn't signal when table was created. This could cause a "DROP TABLE created_table" in another thread to wait "forever" sql/sql_lex.h: Fix for PS and procedures sql/sql_parse.cc: More debugging information Make a copy of 'db' in PS as this may change Fixed wrong permissions check in PS and multi-table updates sql/sql_prepare.cc: Fix for PS and SELECT ... PROCEDURE Reset all warnings when executing a new query sql/sql_union.cc: Fixes for PS and SELECT ... PROCEDURE Reset 'with_wild' as 'wild' is resolved on prepare
* Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1unknown2004-10-131-2/+4
|\ | | | | | | | | | | | | | | into sanja.is.com.ua:/home/bell/mysql/bk/work-4.1 sql/item_subselect.cc: Auto merged
| * correct (high level) fix for BUG#5367 to privent problems in other enginesunknown2004-10-071-2/+4
| |
* | Deployment of centralized Item change registry, step 2: Item_ref unknown2004-10-081-4/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | doesn't need to have it's own recovery mechanism. sql/item.cc: Deployment of centralized Item change registry, step 2: Item_ref doesn't need to have it's own recovery mechanism, so it was simplified. sql/item.h: Deployment of centralized Item change registry, step 2: Item_ref doesn't need to have it's own recovery mechanism, so it was simplified. sql/item_cmpfunc.cc: - Item::split_sum_func now requires THD - use THD::register_item_tree_change sql/item_cmpfunc.h: - Item::split_sum_func now requires THD sql/item_func.cc: - Item::split_sum_func now requires THD - use THD::register_item_tree_change sql/item_func.h: - Item::split_sum_func now requires THD sql/item_row.cc: - Item::split_sum_func now requires THD - use THD::register_item_tree_change sql/item_row.h: - Item::split_sum_func now requires THD sql/item_strfunc.cc: - Item::split_sum_func now requires THD - use THD::register_item_tree_change to register changes in the item tree sql/item_strfunc.h: - Item::split_sum_func now requires THD sql/item_subselect.cc: - use updated Item_ref constructor sql/sql_base.cc: - Item::split_sum_func now requires THD sql/sql_select.cc: - Item::split_sum_func now requires THD sql/sql_yacc.yy: - use updated Item_ref constructor
* Comments to the single-select optimization algorithm.unknown2004-10-041-1/+24
|
* fixed error handling if creating derived table failedunknown2004-09-171-1/+0
| | | | | | | | | | | | | | | | single row subquery always can return NULL (no rows found) (BUG#5590) mysql-test/r/subselect.result: maybe_null flag returning by subquwery for temporary table creation mysql-test/t/subselect.test: maybe_null flag returning by subquwery for temporary table creation sql/item.cc: storing maybe_null in type holder sql/item_subselect.cc: single row subquery always can return NULL (no rows found) sql/sql_derived.cc: fixed error handling if creating derived table failed
* fixed temporary table processing expresions of subqueries and removed wrong ↵unknown2004-09-061-3/+0
| | | | | | | | | | | | | | | | | restrictions of field resolving (BUG#5326) mysql-test/r/subselect.result: tests of fields resolving mysql-test/t/subselect.test: tests of fields resolving sql/item.cc: fixed fild resolving sql/item_subselect.cc: removed aneed call sql/sql_base.cc: fixed case whan we scan un-fixfielded fields sql/sql_select.cc: fixed temporary table processing expresions of subqueries
* after review fixes:unknown2004-08-231-1/+8
| | | | | | | | | | | | | | | | | allowed parsing of table fields inside aggregate functions added new tests of fields resolving in grouping mysql-test/r/func_gconcat.result: allowed parsing of table fields inside aggregate functions mysql-test/r/subselect.result: added new tests of fields resolving in grouping mysql-test/t/func_gconcat.test: allowed parsing of table fields inside aggregate functions mysql-test/t/subselect.test: added new tests of fields resolving in grouping sql/item_subselect.cc: allowed parsing of table fields inside aggregate functions
* mergeunknown2004-08-231-62/+67
|\ | | | | | | | | | | | | | | | | | | | | | | | | sql/item_subselect.cc: Auto merged sql/item_subselect.h: Auto merged sql/mysql_priv.h: Auto merged sql/sql_lex.cc: Auto merged sql/sql_yacc.yy: Auto merged
| * skip resolving field in table list if table list is not accessable due to ↵unknown2004-08-131-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | groupping (BUG#4814) mysql-test/r/func_gconcat.result: fix of test queries mysql-test/r/subselect.result: resolving fields of grouped outer SELECT mysql-test/t/func_gconcat.test: fix of test queries mysql-test/t/subselect.test: resolving fields of grouped outer SELECT sql/item.cc: skip resolving field in table list if table list is not accessable due to groupping layout fixed sql/item_subselect.cc: detection of place of subquery sql/item_subselect.h: detection of place of subquery sql/mysql_priv.h: enum_parsing_place made global type sql/sql_lex.cc: enum_parsing_place made global type sql/sql_lex.h: enum_parsing_place made global type sql/sql_yacc.yy: enum_parsing_place made global type
| * in case of compound index fill all parts in optimized IN (BUG#4435)unknown2004-08-121-61/+64
| | | | | | | | | | | | | | | | | | mysql-test/r/subselect.result: Optimized IN with compound index test mysql-test/t/subselect.test: Optimized IN with compound index test sql/item_subselect.cc: in case of compound index fill all parts
* | Fix for bug#4912 "mysqld crashs in case a statement is executedunknown2004-08-211-24/+26
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a second time". The bug was caused by incompatibility of negations elimination algorithm and PS: during first statement execute a subtree with negation was replaced with equivalent subtree without NOTs. The problem was that although this transformation was permanent, items of the new subtree were created in execute-local memory. The patch adds means to check if it is the first execute of a prepared statement, and if this is the case, to allocate items in memory of the prepared statement. The implementation: - backports Item_arena from 5.0 - adds Item_arena::is_stmt_prepare(), Item_arena::is_first_stmt_execute(). - deletes THD::allocate_temporary_pool_for_ps_preparing(), THD::free_temporary_pool_for_ps_preparing(); they were redundant. and adds a few invariants: - thd->free_list never contains junk (= freed items) - thd->current_arena is never null. If there is no prepared statement, it points at the thd. The rest of the patch contains mainly mechanical changes and cleanups. mysql-test/r/ps.result: Test results updated (test case for Bug#4912) mysql-test/t/ps.test: A test case for Bug#4912 "mysqld crashs in case a statement is executed a second time" sql/item_cmpfunc.cc: current_statement -> current_arena sql/item_subselect.cc: Statement -> Item_arena, current_statement -> current_arena sql/item_subselect.h: Item_subselect does not need to save thd->current_statement. sql/item_sum.cc: Statement -> Item_arena sql/item_sum.h: Statement -> Item_arena sql/mysql_priv.h: Statement -> Item_arena sql/sql_base.cc: current_statement -> current_arena sql/sql_class.cc: - Item_arena - convenient set_n_backup_statement, restore_backup_statement (nice idea, Sanja) sql/sql_class.h: - Item_arena: backport from 5.0 - allocate_temporary_pool_for_ps_preparing, free_temporary_pool_for_ps_preparing removed. sql/sql_derived.cc: current_statement -> current_arena sql/sql_lex.cc: current_statement -> current_arena sql/sql_parse.cc: Deploy invariant that thd->free_list never contains junk items (backport from 5.0). sql/sql_prepare.cc: - backporting Item_arena - no need to allocate_temporary_pool_for_ps_preparing(). sql/sql_select.cc: Fix for bug#4912 "mysqld crashs in case a statement is executed a second time": if this is the first execute of a prepared statement, negation elimination is done in memory of the prepared statement. sql/sql_union.cc: Backporting Item_arena from 5.0.
* Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1unknown2004-07-171-1/+6
|\ | | | | | | | | | | | | | | into sanja.is.com.ua:/home/bell/mysql/bk/work-subs-4.1 sql/item_subselect.cc: Auto merged
| * stack overflow check added for subqueries processing (BUG#4554)unknown2004-07-141-1/+6
| | | | | | | | | | sql/item_subselect.cc: stack overflow check added for subqueries processing
* | aggregate functions check during substitution made only for single row ↵unknown2004-07-041-22/+22
|/ | | | | | | | | | | | | | | | | | | | subselects (BUG#4400) restoring current senect pointer before PS rexecution (backport from 5.0) removed spaces at lines ends mysql-test/r/subselect.result: Aggregate function comparation with ALL/ANY/SOME subselect test mysql-test/t/subselect.test: Aggregate function comparation with ALL/ANY/SOME subselect test sql/item_subselect.cc: removed spaces at lines ends aggregate functions check during substitution made only for single row subselects sql/item_subselect.h: removed spaces at lines ends sql/sql_prepare.cc: restoring current senect pointer before PS rexecution (backport from 5.0)
* Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1unknown2004-06-241-0/+5
|\ | | | | | | | | | | | | | | | | | | into sanja.is.com.ua:/home/bell/mysql/bk/work-innodb-4.1 sql/item_subselect.cc: Auto merged sql/sql_select.cc: Auto merged
| * Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1unknown2004-06-231-0/+5
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into sanja.is.com.ua:/home/bell/mysql/bk/work-innodb-4.1 sql/item_subselect.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_select.cc: Auto merged
| | * do not unlock tables early if we have subquery in HAVING clause (BUG#3984)unknown2004-06-091-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql-test/r/subselect_innodb.result: test of unlocking innodb tables and subquery in HAVING clause mysql-test/t/subselect_innodb.test: test of unlocking innodb tables and subquery in HAVING clause sql/item_subselect.cc: mark SELECT with subquery in HAVING clause sql/sql_lex.cc: mark SELECT with subquery in HAVING clause sql/sql_lex.h: mark SELECT with subquery in HAVING clause sql/sql_select.cc: do not unlock tables early if we have subquery in HAVING clause
* | | mergedunknown2004-06-231-2/+6
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | configure.in: Auto merged mysql-test/Makefile.am: Auto merged mysql-test/r/fulltext.result: Auto merged sql/field.cc: Auto merged sql/ha_berkeley.cc: Auto merged sql/ha_innodb.cc: Auto merged sql/ha_innodb.h: Auto merged sql/handler.cc: Auto merged sql/handler.h: Auto merged sql/item_subselect.cc: Auto merged sql/lex.h: Auto merged sql/opt_range.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_cache.cc: Auto merged sql/sql_delete.cc: Auto merged sql/sql_help.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_update.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/table.cc: Auto merged sql/unireg.cc: Auto merged
| * | handler interface cleanups:unknown2004-06-231-2/+6
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | more logical table/index_flags return HA_ERR_WRONG_COMMAND instead of abstract methods where appropriate max_keys and other limits renamed to max_supported_keys/etc max_keys/etc are now wrappers to max_supported_keys/etc ha_index_init/ha_rnd_init/ha_index_end/ha_rnd_end are now wrappers to real {index,rnd}_{init,end} to enforce strict pairing include/myisam.h: increasing myisam_max_temp_file_length include/my_base.h: handler interface cleanup myisam/mi_static.c: warning removed mysql-test/Makefile.am: followup mysql-test/r/fulltext.result: fulltext indexes are not ordered mysql-test/r/rpl_user_variables.result: followup sql/field.cc: index_flags sql/filesort.cc: rnd_init -> ha_rnd_init rnd_end -> ha_rnd_end sql/ha_berkeley.cc: cleanup sql/ha_berkeley.h: table/index_flags revamped sql/ha_heap.cc: ensure index is accessed only after index_init (esp. important for temp tables) sql/ha_heap.h: table/index_flags revamped sql/ha_innodb.cc: don't workaround MySQL sloppiness sql/ha_innodb.h: table/index_flags revamped sql/ha_isam.h: table/index_flags revamped sql/ha_isammrg.h: table/index_flags revamped sql/ha_myisam.cc: ensure index is accessed only after index_init (esp. important for temp tables) sql/ha_myisam.h: table/index_flags revamped sql/ha_myisammrg.h: table/index_flags revamped sql/handler.cc: handler interface cleanups sql/handler.h: handler interface cleanups: more logical table/index_flags return HA_ERR_WRONG_COMMAND instead of abstract methods max_keys and other limits renamed to max_supported_keys/etc max_keys/etc are now wrappers to max_supported_keys/etc ha_index_init/ha_rnd_init/ha_index_end/ha_rnd_end are now wrappers to enforce strict pairing sql/item_subselect.cc: index_init/index_end/rnd_init/rnd_end strict pairing fixed sql/lex.h: renamed to avoid conflicts sql/opt_range.cc: index_init/index_end/rnd_init/rnd_end strict pairing fixed table/index_flags cleanup sql/opt_range.h: index_init/index_end/rnd_init/rnd_end strict pairing fixed sql/opt_sum.cc: index_init/index_end/rnd_init/rnd_end strict pairing fixed table/index_flags cleanup sql/records.cc: index_init/index_end/rnd_init/rnd_end strict pairing fixed sql/sql_acl.cc: index_init/index_end/rnd_init/rnd_end strict pairing fixed sql/sql_cache.cc: cleanup sql/sql_delete.cc: index_init/index_end/rnd_init/rnd_end strict pairing fixed sql/sql_handler.cc: index_init/index_end/rnd_init/rnd_end strict pairing fixed sql/sql_help.cc: index_init/index_end/rnd_init/rnd_end strict pairing fixed sql/sql_insert.cc: table/index_flags cleanup sql/sql_select.cc: index_init/index_end/rnd_init/rnd_end strict pairing fixed table/index_flags cleanup sql/sql_table.cc: index_init/index_end/rnd_init/rnd_end strict pairing fixed table/index_flags cleanup sql/sql_update.cc: index_init/index_end/rnd_init/rnd_end strict pairing fixed sql/sql_yacc.yy: INDEX -> INDEX_SYM sql/table.cc: table/index_flags cleanup
* | Unused variables removed (many files).unknown2004-06-211-1/+0
|/ | | | | | | | | | | | | | | | | sql/item_func.cc: Unused variable 'thd' removed. sql/item_subselect.cc: Unused variable 'type' removed. sql/slave.cc: Unused variable 'return_val' removed. sql/sql_derived.cc: Unused variable 'is_subsel' removed. sql/sql_parse.cc: Unused variables 'pstr' and 'create_info' removed. sql/sql_prepare.cc: Unused variable 'res' removed. sql/time.cc: Unused variable 'str_begin' removed.
* keep old engine & JOIN if we changed subquery Item (Bug #3646)unknown2004-05-071-9/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql-test/r/subselect.result: ALL/ANY test mysql-test/t/subselect.test: ALL/ANY test sql/item_subselect.cc: keep old engine & JOIN if we changed subquery Item, which allow avoid second all SELECT items fix_fields call with pervios clean up (because of second setup_tables which remove table->key_use and maybe something else) keep list when we change Item in SELECT list processing inserted max/min function (now JOIN::prepare will be called only once) methods of changing item for subselect engines sql/item_subselect.h: change item & results procedure sql/item_sum.cc: Item_sum_hybrid::clear moved to .cc file (to keep .h clean and to make inserving/removing debug info easy) sql/item_sum.h: Item_sum_hybrid::clear moved to .cc file (to keep .h clean and to make inserving/removing debug info easy) sql/sql_lex.cc: note about new method sql/sql_lex.h: method for changing result of UNION JOINs sql/sql_select.cc: method for changing result in JOIN sql/sql_select.h: method for changing result in JOIN sql/sql_union.cc: method for changing result in JOIN
* Formatting changes requested by Montyunknown2004-04-151-1/+1
| | | | | | | | | | | | | | | sql/gen_lex_hash.cc: Minor changes - fix space between for and ( sql/item_subselect.cc: Minor changes - fix space between for and ( sql/sql_lex.cc: Minor changes - fix space between for and ( sql/sql_string.cc: Minor changes - fix space between for and (
* after review changesunknown2004-03-201-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sql/item.cc: removed double_fix & already_fixed in Item_field sql/item.h: added quick_fix_field() for cases when we are sure that no need full fix_field processing fixed neg() method for numeric constants to have the same logic as constant parser Item_null, Item_real, ... are constant which are fixed by creation sql/item_cmpfunc.h: right fix_fields in and_conds call sql/item_func.cc: changed Item_field constructor call fix_field emulation call sql/item_strfunc.cc: correct layout sql/item_subselect.cc: correct layout changed Item_field constructor call sql/item_sum.cc: changed Item_field constructor call sql/item_sum.h: changed Item_field constructor call sql/sql_base.cc: fixed layout right fix_fields calls sql/sql_help.cc: changed Item_field constructor call sql/sql_load.cc: changed Item_field constructor call sql/sql_parse.cc: constant changed sql/sql_select.cc: fixed layout fix_field emulation insted of real fix_fields call sql/sql_show.cc: changed Item_field constructor call sql/sql_union.cc: changed Item_field constructor call double_fix removed sql/sql_update.cc: renamed variable, fixed layout sql/sql_yacc.yy: typo fixed fix_fields emulation calls hegation of numbers fixed
* DBUG_ASSERT(fixed == 1); added to val*unknown2004-03-181-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | small optimisation in signed_literal sql/field.cc: layout fixed sql/item.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed fixed= 1; added where it was forgoten in fix_fields Item_string can be used without fix_fields sql/item.h: DBUG_ASSERT(fixed == 1); added to val* Item_string can be used without fix_fields sql/item_cmpfunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_cmpfunc.h: fixed layout and getting Item statistic sql/item_func.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_func.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_geofunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_strfunc.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed sql/item_strfunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_subselect.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_uniq.h: DBUG_ASSERT(fixed == 1); added to val* sql/sql_base.cc: Item creation revised sql/sql_help.cc: Item creation revised sql/sql_load.cc: Item creation revised sql/sql_parse.cc: fix_field call added sql/sql_select.cc: Item creation revised sql/sql_show.cc: Item creation revised sql/sql_union.cc: Item creation revised sql/sql_update.cc: Item creation revised sql/sql_yacc.yy: Item creation revised small optimisation in signed_literal
* DBUG_ASSERT(fixed == 0) added to fix_fields()unknown2004-03-171-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sql/item.cc: layout fixed fixed bug in prepared statements with subqueries and outer references sql/item.h: neg_transformer get thd argument to call fix_fields sql/item_cmpfunc.cc: DBUG_ASSERT(fixed == 0) added to fix_fields() fixed Item_in_optimizer fixed flag neg_arguments(), neg_transformer() call fix_field() on created items to avoid bouble fix field or non-called fixfields() sql/item_cmpfunc.h: neg_transformer get thd argument to call fix_fields fixed forgoten cleanup() call of parent class sql/item_func.cc: DBUG_ASSERT(fixed == 0) and fixed flag check added to fix_fields() sql/item_func.h: DBUG_ASSERT(fixed == 0) added to fix_fields() fixed forgoten cleanup() call of parent class sql/item_row.cc: DBUG_ASSERT(fixed == 0) added to fix_fields() added forgoten 'fixed' flag set sql/item_subselect.cc: DBUG_ASSERT(fixed == 0) added to fix_fields() fixed subquery transformation sql/sql_base.cc: check of fixed flag added sql/sql_derived.cc: fixed cleunup union in derived table during EXPLAIN command processing sql/sql_select.cc: thd argument add to function to allow call fix_fields() of new created items fixed EXPLAIN double preparation check of fixed flag added eliminate_not_funcs fixed for corrcet fix_fields call of new created items sql/sql_select.h: thd argument add to function to allow call fix_fields() of new created items sql/sql_union.cc: union processing fixed tests/client_test.c: layout fixed new test of outer references fron subqueries
* fix test during mergeunknown2004-03-161-3/+3
|\ | | | | | | | | | | | | sql/item_subselect.cc: Auto merged sql/sql_select.cc: Auto merged
| * mergeunknown2004-03-151-3/+3
| |\ | | | | | | | | | | | | | | | | | | sql/item_subselect.cc: Auto merged sql/sql_select.cc: Auto merged
| | * avoid null check on fields where NULL is impossibleunknown2004-02-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (BUG#2393) mysql-test/r/subselect.result: BUG#2393 test suite test ref replaced ref_of_null joining mysql-test/t/subselect.test: BUG#2393 test suite test ref replaced ref_of_null joining sql/item_subselect.cc: avoid null check on fields where NULL is impossible sql/sql_select.cc: convert JT_REF_OR_NULL to JT_REF in case of impossible NULL and protect buffer of rewriting through join_tab->null_ref_key
* | | after merge fixunknown2004-03-091-1/+2
| | |
* | | mergeunknown2004-03-091-2/+2
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql-test/r/subselect.result: Auto merged mysql-test/t/subselect.test: Auto merged sql/item.cc: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_sum.cc: Auto merged sql/set_var.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.cc: Auto merged
| * | revision of fix_fields() calls (BUG2838)unknown2004-02-181-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql-test/r/subselect.result: test suite for BUG#2838 mysql-test/t/subselect.test: test suite for BUG#2838 sql/item.cc: revision of fix_fields() calls removed unnecessary variabl, and used correct last parameter of fix_fields() sql/item_cmpfunc.cc: revision of fix_fields() calls (BUG#2838) sql/item_func.cc: revision of fix_fields() calls sql/item_row.cc: changed for efficience (and to be similar for Item_func::fix_fields) sql/item_subselect.cc: fixed last arguments for fix_fields call sql/item_sum.cc: layout fixed revision of fix_fields() calls sql/log_event.cc: revision of fix_fields() calls sql/set_var.cc: revision of fix_fields() calls sql/sql_base.cc: revision of fix_fields() calls sql/sql_class.cc: revision of fix_fields() calls sql/sql_handler.cc: revision of fix_fields() calls
* | | Mergingunknown2004-03-041-0/+6
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sql/item_subselect.cc: Auto merged sql/item_subselect.h: Auto merged mysql-test/r/subselect.result: merging mysql-test/t/subselect.test: merging
| * | | Fix for #1992unknown2003-12-061-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bug happens when a query, having subselects in the fields list, needs temporary table. Item_subselect::get_tmp_table_item isn't implemented and just returns *this. So the tmp_table_item takes value not from temporary but from original table. mysql-test/r/subselect.result: appropriate test result added mysql-test/t/subselect.test: test case added sql/item_subselect.cc: Item_subselect::get_tmp_table_item implementation sql/item_subselect.h: Item_subselect::get_tmp_table_item declaration
* | | | after review fixunknown2004-02-201-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sql/item.h: typo fixed sql/item_func.h: clear refernce on deleted variable sql/item_subselect.cc: layout fixed sql/sql_base.cc: temporary memory pool allocation moved from open_and_lock_tables sql/sql_prepare.cc: temporary memory pool allocation moved changing in routine suggeted by Monty tests/client_test.c: uncomment accidently commented test
* | | | revision of fix_fields calls in subqueries transformationunknown2004-02-181-7/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | after merge fix sql/item_subselect.cc: revision of fix_fields calls in subqueries transformation sql/sql_prepare.cc: after merge fix
* | | | memory leacks in PS with subqueries fixed (adddition to fix of BUG#2462)unknown2004-02-121-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sql/item.h: mechanism to keep reference in cache array for row IN sql/item_cmpfunc.cc: mechanism to keep reference in cache array for row IN layout fixed sql/item_cmpfunc.h: mechanism to keep reference in cache array for row IN sql/item_subselect.cc: fixed memory pools swapping prevented deleting Item_in_optimizer cache in case of row IN subquery sql/mysql_priv.h: declarations of function moved to be useful in sql_class.h sql/sql_base.cc: keep fields expanded from '*' in statement memory pool sql/sql_class.cc: fixed restoring/backup of memory pool and list of items sql/sql_class.h: memory allocation methods moved to Statement memory pool substituting for preparing sql/sql_lex.cc: ref_pointer_array kept in statement memory sql/sql_lex.h: reinitialization of UNIT sql/sql_prepare.cc: memory allocation/swapping fixed tests/client_test.c: layout fixed
* | | | fixed subquery with PS (BUG#2462)unknown2004-02-081-84/+177
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fixed UNION preparation sql/item.cc: debug output added sql/item.h: debug output added sql/item_cmpfunc.cc: correct cleunup() for Item_in_optimizer sql/item_cmpfunc.h: correct cleunup() for Item_in_optimizer debug output added sql/item_func.h: debug output added sql/item_subselect.cc: support of prepared statemnts added - mostly memorry allocation manegement, only one trabsformatio & correct cleupup() sql/item_subselect.h: support of prepared statemnts added - mostly memorry allocation manegement, only one trabsformatio & correct cleupup() sql/item_sum.cc: debug output added sql/item_sum.h: debug output added sql/sql_class.cc: function to switch allocation arena for Items sql/sql_class.h: function to switch allocation arena for Items pointer on current prepared statement added sql/sql_lex.cc: comment fixed sql/sql_lex.h: item cleanup support sql/sql_prepare.cc: - fixed preparation of PS to avoid storing junk in its memory + correct work with union - fixed tables cleanup for UNION & subqueries sql/sql_select.cc: removed condition which is always true for now fixed layout sql/sql_union.cc: support of UNION subquery cleanup tests/client_test.c: test of repeatable subqueries test of correct UNION initialisation
* | | fix for the bug #2419: order by ignores rows.unknown2004-01-311-2/+2
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | null_ref_key moved to TABLE_REF. new null range created if necessary. mysql-test/r/order_by.result: fix for the bug #2419: order by ignores rows mysql-test/t/order_by.test: fix for the bug #2419: order by ignores rows sql/item_subselect.cc: fix for the bug #2419: order by ignores rows sql/opt_range.cc: fix for the bug #2419: order by ignores rows sql/sql_select.cc: fix for the bug #2419: order by ignores rows sql/sql_select.h: fix for the bug #2419: order by ignores rows
* | Merge deer.(none):/home/hf/work/mysql-4.1.cleanunknown2004-01-191-11/+9
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into deer.(none):/home/hf/work/mysql-4.1.1676 sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_func.h: Auto merged sql/item_strfunc.cc: Auto merged sql/item_subselect.cc: Auto merged sql/mysql_priv.h: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_yacc.yy: Auto merged
| * \ Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1unknown2004-01-191-9/+6
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into gw.mysql.r18.ru:/usr/home/ram/work/4.1.b2182 client/mysqldump.c: Auto merged sql/item_strfunc.cc: Auto merged sql/item_subselect.cc: Auto merged
| | * | Fix for the bug #2198: SELECT INTO OUTFILE (with Sub-Select) Problem.unknown2003-12-251-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Proper Item_cache::setup() method. Code cleanup. (discussed with sanja) sql/item.cc: code cleanup sql/item.h: fix for the bug #2198: SELECT INTO OUTFILE (with Sub-Select) Problem. proper Item_cache::setup() method code cleanup sql/item_subselect.cc: fix for the bug #2198: SELECT INTO OUTFILE (with Sub-Select) Problem. proper Item_cache::setup() method code cleanup
| * | | Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1unknown2004-01-171-2/+3
| |\ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into sanja.is.com.ua:/home/bell/mysql/bk/work-sub-4.1 mysql-test/r/subselect_innodb.result: Auto merged mysql-test/t/subselect_innodb.test: Auto merged sql/item_subselect.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_union.cc: Auto merged