summaryrefslogtreecommitdiff
path: root/sql/opt_sum.cc
Commit message (Collapse)AuthorAgeFilesLines
* Merge dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.0-optunknown2006-09-181-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.1 mysql-test/r/func_gconcat.result: Auto merged mysql-test/r/func_group.result: Auto merged mysql-test/r/func_str.result: Auto merged mysql-test/r/func_time.result: Auto merged mysql-test/r/group_by.result: Auto merged mysql-test/r/heap_hash.result: Auto merged mysql-test/r/information_schema.result: Auto merged mysql-test/r/innodb_mysql.result: Auto merged mysql-test/r/join_outer.result: Auto merged mysql-test/r/olap.result: Auto merged mysql-test/r/query_cache.result: Auto merged mysql-test/r/range.result: Auto merged mysql-test/r/row.result: Auto merged mysql-test/r/subselect.result: Auto merged mysql-test/r/type_date.result: Auto merged mysql-test/r/union.result: Auto merged mysql-test/r/view_grant.result: Auto merged mysql-test/t/func_group.test: Auto merged mysql-test/t/func_str.test: Auto merged mysql-test/t/func_time.test: Auto merged mysql-test/t/view.test: Auto merged sql/item.cc: Auto merged sql/item_func.cc: Auto merged sql/item_func.h: Auto merged sql/log.cc: Auto merged sql/mysql_priv.h: Auto merged sql/opt_range.cc: Auto merged sql/opt_range.h: Auto merged sql/opt_sum.cc: Auto merged sql/sql_delete.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_list.h: Auto merged sql/sql_parse.cc: Auto merged sql/sql_update.cc: Auto merged sql/sql_yacc.yy: Auto merged mysql-test/t/sp.test: SCCS merged sql/item_cmpfunc.cc: SCCS merged sql/sql_select.cc: SCCS merged
| * Merge macbook.gmz:/Users/kgeorge/mysql/work/B16792-4.1-optunknown2006-09-051-2/+2
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into macbook.gmz:/Users/kgeorge/mysql/work/B16792-5.0-opt mysql-test/r/func_gconcat.result: Auto merged mysql-test/r/subselect.result: Auto merged sql/opt_sum.cc: Auto merged mysql-test/r/func_group.result: merge 4.1->5.0 for bug #16792 mysql-test/t/func_group.test: merge 4.1->5.0 for bug #16792 sql/sql_select.cc: merge 4.1->5.0 for bug #16792
| | * Bug #16792 query with subselect, join, and group not returning proper valuesunknown2006-08-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Treat queries with no FROM and aggregate functions as normal queries, so the aggregate function get correctly calculated as if there is 1 row. This means that they will be considered to have one row, so COUNT(*) will return 1 instead of 0. Other aggregates will behave in compatible manner. mysql-test/r/func_gconcat.result: Bug #16792 query with subselect, join, and group not returning proper values - test case. Note how it improves the support for DUAL. mysql-test/r/func_group.result: Bug #16792 query with subselect, join, and group not returning proper values - test case. Note how it improves the support for DUAL. mysql-test/r/subselect.result: Bug #16792 query with subselect, join, and group not returning proper values - consequence of (SELECT MAX(<const>)) now returning <const> instead of 0 mysql-test/t/func_group.test: Bug #16792 query with subselect, join, and group not returning proper values - test case. sql/opt_sum.cc: Bug #16792 query with subselect, join, and group not returning proper values - cannot do the optimization if the index is already opened by (say) UPDATE as it invloves opening reading and closing the index. sql/sql_select.cc: Bug #16792 query with subselect, join, and group not returning proper values - Treat queries with no FROM and aggregate functions as normal queries, so the aggregate function get correctly calculated as if there is 1 row.
* | | Merge mysql.com:/home/emurphy/src/bk-clean/tmp_mergeunknown2006-06-251-0/+6
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into mysql.com:/home/emurphy/src/bk-clean/mysql-5.1 mysql-test/mysql-test-run.sh: Auto merged mysql-test/valgrind.supp: Auto merged mysql-test/r/func_str.result: Auto merged mysql-test/r/insert_select.result: Auto merged mysql-test/r/myisam.result: Auto merged mysql-test/t/func_time.test: Auto merged mysql-test/t/myisam.test: Auto merged mysql-test/t/select.test: Auto merged mysys/Makefile.am: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_strfunc.cc: Auto merged sql/item_strfunc.h: Auto merged sql/mysqld.cc: Auto merged sql/opt_sum.cc: Auto merged sql/slave.cc: Auto merged sql/sql_select.cc: Auto merged storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: Auto merged storage/ndb/src/ndbapi/ndberror.c: Auto merged include/Makefile.am: manual merge mysql-test/r/func_time.result: manual merge mysql-test/r/select.result: manual merge
| * | Merge may.pils.ru:/home/svoj/devel/mysql/BUG20357/mysql-4.1unknown2006-06-211-0/+6
| |\ \ | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into may.pils.ru:/home/svoj/devel/mysql/BUG20357/mysql-5.0 mysql-test/r/myisam.result: Auto merged mysql-test/t/myisam.test: Auto merged sql/opt_sum.cc: Auto merged mysql-test/mysql-test-run.sh: Auto merged
| | * Merge april:devel/BitKeeper/mysql-4.1unknown2006-06-211-0/+6
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into may.pils.ru:/home/svoj/devel/mysql/BUG20357/mysql-4.1 sql/opt_sum.cc: Auto merged mysql-test/r/myisam.result: SCCS merged mysql-test/t/myisam.test: SCCS merged
| | | * BUG#20357 - Got error 124 from storage engine using MIN and MAXunknown2006-06-211-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | functions in queries Using MAX()/MIN() on table with disabled indexes (by ALTER TABLE) results in error 124 (wrong index) from storage engine. The problem was that optimizer use disabled index to optimize MAX()/MIN(). Normally it must skip disabled index and perform table scan. This patch skips disabled indexes for min/max optimization. mysql-test/r/myisam.result: Test case for BUG#20357. mysql-test/t/myisam.test: Test case for BUG#20357. sql/opt_sum.cc: Skip disabled/ignored indexes for min/max optimization.
* | | | Manually mergedunknown2006-06-181-3/+12
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | configure.in: Auto merged client/mysqlbinlog.cc: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/r/archive.result: Auto merged mysql-test/r/auto_increment.result: Auto merged mysql-test/r/cast.result: Auto merged mysql-test/r/ctype_utf8.result: Auto merged mysql-test/r/func_group.result: Auto merged mysql-test/r/func_str.result: Auto merged mysql-test/r/func_time.result: Auto merged mysql-test/r/multi_update.result: Auto merged mysql-test/r/ndb_lock.result: Auto merged mysql-test/r/replace.result: Auto merged mysql-test/r/union.result: Auto merged mysql-test/t/archive.test: Auto merged mysql-test/t/auto_increment.test: Auto merged mysql-test/t/delayed.test: Auto merged mysql-test/t/func_time.test: Auto merged mysql-test/t/multi_update.test: Auto merged mysql-test/t/ndb_lock.test: Auto merged mysql-test/t/select.test: Auto merged sql/field.cc: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.h: Auto merged sql/item_func.cc: Auto merged sql/item_strfunc.cc: Auto merged sql/item_timefunc.cc: Auto merged sql/opt_range.cc: Auto merged sql/opt_sum.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_insert.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_select.h: Auto merged sql/sql_yacc.yy: Auto merged sql/structs.h: Auto merged storage/archive/ha_archive.cc: Auto merged tests/mysql_client_test.c: Auto merged
| * | | Merge rurik.mysql.com:/home/igor/mysql-4.1-optunknown2006-06-151-2/+4
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into rurik.mysql.com:/home/igor/mysql-5.0-opt mysql-test/t/func_group.test: Auto merged sql/field.cc: Auto merged sql/opt_sum.cc: Auto merged mysql-test/r/func_group.result: SCCS merged
| | * | | Post-review corrections of the fix for bug #18206.unknown2006-06-131-2/+4
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | mysql-test/r/func_group.result: Added another test case for bug #18206. mysql-test/t/func_group.test: Added another test case for bug #18206.
| * | | Merge rurik.mysql.com:/home/igor/mysql-4.1-optunknown2006-06-131-4/+0
| |\ \ \ | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into rurik.mysql.com:/home/igor/mysql-5.0-opt mysql-test/t/ctype_utf8.test: Auto merged sql/opt_sum.cc: Auto merged mysql-test/r/ctype_utf8.result: Manual merge sql/field.cc: Manual merge
| | * | Cleanup for the fix of bug 18206.unknown2006-06-021-4/+0
| | | | | | | | | | | | | | | | | | | | sql/opt_sum.cc: Cleanup
| * | | Merge rurik.mysql.com:/home/igor/mysql-4.1-optunknown2006-06-021-3/+14
| |\ \ \ | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into rurik.mysql.com:/home/igor/mysql-5.0-opt sql/opt_sum.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_select.h: Auto merged mysql-test/r/func_group.result: SCCS merged mysql-test/t/func_group.test: SCCS merged
| | * | Fixed bug #18206.unknown2006-06-021-3/+14
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug report revealed two problems related to min/max optimization: 1. If the length of a constant key used in a SARGable condition for for the MIN/MAX fields is greater than the length of the field an unwanted warning on key truncation is issued; 2. If MIN/MAX optimization is applied to a partial index, like INDEX(b(4)) than can lead to returning a wrong result set. mysql-test/r/func_group.result: Added test cases for bug #18206. mysql-test/t/func_group.test: Added test cases for bug #18206. sql/opt_sum.cc: Fixed bug #18206. Suppressed the warning about data truncation when store_val_in_field was used to store keys for the field used in MIN/MAX optimization. Blocked MIN/MAX optimization for partial keys, such as in INDEX(b(4)). sql/sql_select.cc: Fixed bug #18206. Added a parameter for the function store_val_in_field allowing to control setting warnings about data truncation in the function. sql/sql_select.h: Fixed bug #18206. Added a parameter for the function store_val_in_field allowing to control setting warnings about data truncation in the function.
* | | This changeset is largely a handler cleanup changeset (WL#3281), but ↵unknown2006-06-041-9/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | includes fixes and cleanups that was found necessary while testing the handler changes Changes that requires code changes in other code of other storage engines. (Note that all changes are very straightforward and one should find all issues by compiling a --debug build and fixing all compiler errors and all asserts in field.cc while running the test suite), - New optional handler function introduced: reset() This is called after every DML statement to make it easy for a handler to statement specific cleanups. (The only case it's not called is if force the file to be closed) - handler::extra(HA_EXTRA_RESET) is removed. Code that was there before should be moved to handler::reset() - table->read_set contains a bitmap over all columns that are needed in the query. read_row() and similar functions only needs to read these columns - table->write_set contains a bitmap over all columns that will be updated in the query. write_row() and update_row() only needs to update these columns. The above bitmaps should now be up to date in all context (including ALTER TABLE, filesort()). The handler is informed of any changes to the bitmap after fix_fields() by calling the virtual function handler::column_bitmaps_signal(). If the handler does caching of these bitmaps (instead of using table->read_set, table->write_set), it should redo the caching in this code. as the signal() may be sent several times, it's probably best to set a variable in the signal and redo the caching on read_row() / write_row() if the variable was set. - Removed the read_set and write_set bitmap objects from the handler class - Removed all column bit handling functions from the handler class. (Now one instead uses the normal bitmap functions in my_bitmap.c instead of handler dedicated bitmap functions) - field->query_id is removed. One should instead instead check table->read_set and table->write_set if a field is used in the query. - handler::extra(HA_EXTRA_RETRIVE_ALL_COLS) and handler::extra(HA_EXTRA_RETRIEVE_PRIMARY_KEY) are removed. One should now instead use table->read_set to check for which columns to retrieve. - If a handler needs to call Field->val() or Field->store() on columns that are not used in the query, one should install a temporary all-columns-used map while doing so. For this, we provide the following functions: my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set); field->val(); dbug_tmp_restore_column_map(table->read_set, old_map); and similar for the write map: my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->write_set); field->val(); dbug_tmp_restore_column_map(table->write_set, old_map); If this is not done, you will sooner or later hit a DBUG_ASSERT in the field store() / val() functions. (For not DBUG binaries, the dbug_tmp_restore_column_map() and dbug_tmp_restore_column_map() are inline dummy functions and should be optimized away be the compiler). - If one needs to temporary set the column map for all binaries (and not just to avoid the DBUG_ASSERT() in the Field::store() / Field::val() methods) one should use the functions tmp_use_all_columns() and tmp_restore_column_map() instead of the above dbug_ variants. - All 'status' fields in the handler base class (like records, data_file_length etc) are now stored in a 'stats' struct. This makes it easier to know what status variables are provided by the base handler. This requires some trivial variable names in the extra() function. - New virtual function handler::records(). This is called to optimize COUNT(*) if (handler::table_flags() & HA_HAS_RECORDS()) is true. (stats.records is not supposed to be an exact value. It's only has to be 'reasonable enough' for the optimizer to be able to choose a good optimization path). - Non virtual handler::init() function added for caching of virtual constants from engine. - Removed has_transactions() virtual method. Now one should instead return HA_NO_TRANSACTIONS in table_flags() if the table handler DOES NOT support transactions. - The 'xxxx_create_handler()' function now has a MEM_ROOT_root argument that is to be used with 'new handler_name()' to allocate the handler in the right area. The xxxx_create_handler() function is also responsible for any initialization of the object before returning. For example, one should change: static handler *myisam_create_handler(TABLE_SHARE *table) { return new ha_myisam(table); } -> static handler *myisam_create_handler(TABLE_SHARE *table, MEM_ROOT *mem_root) { return new (mem_root) ha_myisam(table); } - New optional virtual function: use_hidden_primary_key(). This is called in case of an update/delete when (table_flags() and HA_PRIMARY_KEY_REQUIRED_FOR_DELETE) is defined but we don't have a primary key. This allows the handler to take precisions in remembering any hidden primary key to able to update/delete any found row. The default handler marks all columns to be read. - handler::table_flags() now returns a ulonglong (to allow for more flags). - New/changed table_flags() - HA_HAS_RECORDS Set if ::records() is supported - HA_NO_TRANSACTIONS Set if engine doesn't support transactions - HA_PRIMARY_KEY_REQUIRED_FOR_DELETE Set if we should mark all primary key columns for read when reading rows as part of a DELETE statement. If there is no primary key, all columns are marked for read. - HA_PARTIAL_COLUMN_READ Set if engine will not read all columns in some cases (based on table->read_set) - HA_PRIMARY_KEY_ALLOW_RANDOM_ACCESS Renamed to HA_PRIMARY_KEY_REQUIRED_FOR_POSITION. - HA_DUPP_POS Renamed to HA_DUPLICATE_POS - HA_REQUIRES_KEY_COLUMNS_FOR_DELETE Set this if we should mark ALL key columns for read when when reading rows as part of a DELETE statement. In case of an update we will mark all keys for read for which key part changed value. - HA_STATS_RECORDS_IS_EXACT Set this if stats.records is exact. (This saves us some extra records() calls when optimizing COUNT(*)) - Removed table_flags() - HA_NOT_EXACT_COUNT Now one should instead use HA_HAS_RECORDS if handler::records() gives an exact count() and HA_STATS_RECORDS_IS_EXACT if stats.records is exact. - HA_READ_RND_SAME Removed (no one supported this one) - Removed not needed functions ha_retrieve_all_cols() and ha_retrieve_all_pk() - Renamed handler::dupp_pos to handler::dup_pos - Removed not used variable handler::sortkey Upper level handler changes: - ha_reset() now does some overall checks and calls ::reset() - ha_table_flags() added. This is a cached version of table_flags(). The cache is updated on engine creation time and updated on open. MySQL level changes (not obvious from the above): - DBUG_ASSERT() added to check that column usage matches what is set in the column usage bit maps. (This found a LOT of bugs in current column marking code). - In 5.1 before, all used columns was marked in read_set and only updated columns was marked in write_set. Now we only mark columns for which we need a value in read_set. - Column bitmaps are created in open_binary_frm() and open_table_from_share(). (Before this was in table.cc) - handler::table_flags() calls are replaced with handler::ha_table_flags() - For calling field->val() you must have the corresponding bit set in table->read_set. For calling field->store() you must have the corresponding bit set in table->write_set. (There are asserts in all store()/val() functions to catch wrong usage) - thd->set_query_id is renamed to thd->mark_used_columns and instead of setting this to an integer value, this has now the values: MARK_COLUMNS_NONE, MARK_COLUMNS_READ, MARK_COLUMNS_WRITE Changed also all variables named 'set_query_id' to mark_used_columns. - In filesort() we now inform the handler of exactly which columns are needed doing the sort and choosing the rows. - The TABLE_SHARE object has a 'all_set' column bitmap one can use when one needs a column bitmap with all columns set. (This is used for table->use_all_columns() and other places) - The TABLE object has 3 column bitmaps: - def_read_set Default bitmap for columns to be read - def_write_set Default bitmap for columns to be written - tmp_set Can be used as a temporary bitmap when needed. The table object has also two pointer to bitmaps read_set and write_set that the handler should use to find out which columns are used in which way. - count() optimization now calls handler::records() instead of using handler->stats.records (if (table_flags() & HA_HAS_RECORDS) is true). - Added extra argument to Item::walk() to indicate if we should also traverse sub queries. - Added TABLE parameter to cp_buffer_from_ref() - Don't close tables created with CREATE ... SELECT but keep them in the table cache. (Faster usage of newly created tables). New interfaces: - table->clear_column_bitmaps() to initialize the bitmaps for tables at start of new statements. - table->column_bitmaps_set() to set up new column bitmaps and signal the handler about this. - table->column_bitmaps_set_no_signal() for some few cases where we need to setup new column bitmaps but don't signal the handler (as the handler has already been signaled about these before). Used for the momement only in opt_range.cc when doing ROR scans. - table->use_all_columns() to install a bitmap where all columns are marked as use in the read and the write set. - table->default_column_bitmaps() to install the normal read and write column bitmaps, but not signaling the handler about this. This is mainly used when creating TABLE instances. - table->mark_columns_needed_for_delete(), table->mark_columns_needed_for_delete() and table->mark_columns_needed_for_insert() to allow us to put additional columns in column usage maps if handler so requires. (The handler indicates what it neads in handler->table_flags()) - table->prepare_for_position() to allow us to tell handler that it needs to read primary key parts to be able to store them in future table->position() calls. (This replaces the table->file->ha_retrieve_all_pk function) - table->mark_auto_increment_column() to tell handler are going to update columns part of any auto_increment key. - table->mark_columns_used_by_index() to mark all columns that is part of an index. It will also send extra(HA_EXTRA_KEYREAD) to handler to allow it to quickly know that it only needs to read colums that are part of the key. (The handler can also use the column map for detecting this, but simpler/faster handler can just monitor the extra() call). - table->mark_columns_used_by_index_no_reset() to in addition to other columns, also mark all columns that is used by the given key. - table->restore_column_maps_after_mark_index() to restore to default column maps after a call to table->mark_columns_used_by_index(). - New item function register_field_in_read_map(), for marking used columns in table->read_map. Used by filesort() to mark all used columns - Maintain in TABLE->merge_keys set of all keys that are used in query. (Simplices some optimization loops) - Maintain Field->part_of_key_not_clustered which is like Field->part_of_key but the field in the clustered key is not assumed to be part of all index. (used in opt_range.cc for faster loops) - dbug_tmp_use_all_columns(), dbug_tmp_restore_column_map() tmp_use_all_columns() and tmp_restore_column_map() functions to temporally mark all columns as usable. The 'dbug_' version is primarily intended inside a handler when it wants to just call Field:store() & Field::val() functions, but don't need the column maps set for any other usage. (ie:: bitmap_is_set() is never called) - We can't use compare_records() to skip updates for handlers that returns a partial column set and the read_set doesn't cover all columns in the write set. The reason for this is that if we have a column marked only for write we can't in the MySQL level know if the value changed or not. The reason this worked before was that MySQL marked all to be written columns as also to be read. The new 'optimal' bitmaps exposed this 'hidden bug'. - open_table_from_share() does not anymore setup temporary MEM_ROOT object as a thread specific variable for the handler. Instead we send the to-be-used MEMROOT to get_new_handler(). (Simpler, faster code) Bugs fixed: - Column marking was not done correctly in a lot of cases. (ALTER TABLE, when using triggers, auto_increment fields etc) (Could potentially result in wrong values inserted in table handlers relying on that the old column maps or field->set_query_id was correct) Especially when it comes to triggers, there may be cases where the old code would cause lost/wrong values for NDB and/or InnoDB tables. - Split thd->options flag OPTION_STATUS_NO_TRANS_UPDATE to two flags: OPTION_STATUS_NO_TRANS_UPDATE and OPTION_KEEP_LOG. This allowed me to remove some wrong warnings about: "Some non-transactional changed tables couldn't be rolled back" - Fixed handling of INSERT .. SELECT and CREATE ... SELECT that wrongly reset (thd->options & OPTION_STATUS_NO_TRANS_UPDATE) which caused us to loose some warnings about "Some non-transactional changed tables couldn't be rolled back") - Fixed use of uninitialized memory in ha_ndbcluster.cc::delete_table() which could cause delete_table to report random failures. - Fixed core dumps for some tests when running with --debug - Added missing FN_LIBCHAR in mysql_rm_tmp_tables() (This has probably caused us to not properly remove temporary files after crash) - slow_logs was not properly initialized, which could maybe cause extra/lost entries in slow log. - If we get an duplicate row on insert, change column map to read and write all columns while retrying the operation. This is required by the definition of REPLACE and also ensures that fields that are only part of UPDATE are properly handled. This fixed a bug in NDB and REPLACE where REPLACE wrongly copied some column values from the replaced row. - For table handler that doesn't support NULL in keys, we would give an error when creating a primary key with NULL fields, even after the fields has been automaticly converted to NOT NULL. - Creating a primary key on a SPATIAL key, would fail if field was not declared as NOT NULL. Cleanups: - Removed not used condition argument to setup_tables - Removed not needed item function reset_query_id_processor(). - Field->add_index is removed. Now this is instead maintained in (field->flags & FIELD_IN_ADD_INDEX) - Field->fieldnr is removed (use field->field_index instead) - New argument to filesort() to indicate that it should return a set of row pointers (not used columns). This allowed me to remove some references to sql_command in filesort and should also enable us to return column results in some cases where we couldn't before. - Changed column bitmap handling in opt_range.cc to be aligned with TABLE bitmap, which allowed me to use bitmap functions instead of looping over all fields to create some needed bitmaps. (Faster and smaller code) - Broke up found too long lines - Moved some variable declaration at start of function for better code readability. - Removed some not used arguments from functions. (setup_fields(), mysql_prepare_insert_check_table()) - setup_fields() now takes an enum instead of an int for marking columns usage. - For internal temporary tables, use handler::write_row(), handler::delete_row() and handler::update_row() instead of handler::ha_xxxx() for faster execution. - Changed some constants to enum's and define's. - Using separate column read and write sets allows for easier checking of timestamp field was set by statement. - Remove calls to free_io_cache() as this is now done automaticly in ha_reset() - Don't build table->normalized_path as this is now identical to table->path (after bar's fixes to convert filenames) - Fixed some missed DBUG_PRINT(.."%lx") to use "0x%lx" to make it easier to do comparision with the 'convert-dbug-for-diff' tool. Things left to do in 5.1: - We wrongly log failed CREATE TABLE ... SELECT in some cases when using row based logging (as shown by testcase binlog_row_mix_innodb_myisam.result) Mats has promised to look into this. - Test that my fix for CREATE TABLE ... SELECT is indeed correct. (I added several test cases for this, but in this case it's better that someone else also tests this throughly). Lars has promosed to do this. BitKeeper/etc/ignore: added mysys/test_bitmap include/base64.h: Removed my_global.h, as this must be included first in any program include/heap.h: Added heap_reset() (Required by new handler interface) include/my_base.h: Removed HA_EXTRA_RESET. MySQL will now call ::reset() instead of ::extra(HA_EXTRA_RESET). HA_EXTRA_RETRIVE_ALL_COLS and HA_EXTRA_RETRIVE_PRIMARY key are deleted as the column bitmaps makes these unnecessary include/my_bitmap.h: Remove my_pthread.h (should be included at upper level) Introduced my_bitmap_map typedef to make it the bitmap handling more like a black box Added bitmap_is_overlapping(), bitmap_test_and_clear(), bitmap_copy() and bitmap_cmp() Made bitmap_set_bit(), bitmap_flip_bit(), bitmap_clear_bit() return void include/myisam.h: Added mi_reset() (Required by new handler interface) include/myisammrg.h: Added myrg_reset() (Required by new handler interface) include/mysql_com.h: Added flag FIELD_IN_ADD_INDEX to be able to remove Field->add_index mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test: Added testing of CREATE ... SELECT in a mixed environment (This found some bugs that Mats is going to fix shortly) mysql-test/install_test_db.sh: Simplify ldata usage Added --tmpdir=. option to mysqld bootstrap (Removed some warnings when TMPDIR was wrongly set) mysql-test/mysql-test-run.pl: Added --tmpdir=. to bootstrap mysql-test/mysql-test-run.sh: Use copy instead of INSTALL_DB for master and slave databases. (Speeds up startup time a lot!) Remove snapshot directories at startup (removes some strange warnings) mysql-test/r/binlog_row_mix_innodb_myisam.result: Added testing of CREATE ... SELECT in a mixed environment (This found some bugs that Mats is going to fix shortly) mysql-test/r/binlog_stm_mix_innodb_myisam.result: Added testing of CREATE ... SELECT in a mixed environment mysql-test/r/create.result: Some extra tests of warnings and number of tables opened by CREATE ... SELECT mysql-test/r/federated.result: Drop some left over tables Added testing of multiple table update and multiple table delete (with and without keys) mysql-test/r/func_gconcat.result: Enable some disabled tests (converted them slightly to be predictable) mysql-test/r/func_time.result: Added drop of test function mysql-test/r/innodb_mysql.result: Added tests for CREATE ... SELECT mysql-test/r/insert.result: More tests Added testing of duplicate columns in insert mysql-test/r/loaddata.result: Added testing LOAD DATA ... SET ... mysql-test/r/multi_update.result: Test multi updates and deletes using primary key and without mysql-test/r/ndb_index_unique.result: Better error message mysql-test/r/ndb_replace.result: New correct result after fixing REPLACE handling with NDB mysql-test/r/rpl_ddl.result: Now we don't get these (wrong) warnings anymore mysql-test/r/view_grant.result: Drop used views mysql-test/t/create.test: Some extra tests of warnings and number of tables opened by CREATE ... SELECT mysql-test/t/federated.test: Drop some left over tables Added testing of multiple table update and multiple table delete (with and without keys) mysql-test/t/func_gconcat.test: Enable some disabled tests (converted them slightly to be predictable) mysql-test/t/func_time.test: Added drop of test function mysql-test/t/innodb_mysql.test: Added tests for CREATE ... SELECT mysql-test/t/insert.test: More tests Added testing of duplicate columns in insert mysql-test/t/loaddata.test: Added testing LOAD DATA ... SET ... mysql-test/t/multi_update.test: Test multi updates and deletes using primary key and without mysql-test/t/view_grant.test: Drop used views mysql-test/valgrind.supp: Added supression of not needed warnings when printing stack trace mysys/base64.c: Include my_global.h first mysys/my_bitmap.c: Added bitmap_is_overlapping(), bitmap_test_and_clear() and bitmap_copy() Changed logic of bitmap handling to be a bit more efficent (Did this together with Mikael Ronström) Now the 'extra, not used bits' in the bitmap are assumed to have a 'random value' and the bitmap functions are free to change them whenever needed. Changed how mutex is allocated to make 'bitmap_free()' function simpler. mysys/thr_lock.c: Added 0x before thread pointers (for easier comparison of DBUG traces) sql/event.cc: Ensure 'use_all_columns()' is used for event tables Don't print warning that event table is damaged if it doesn't exists. sql/field.cc: Added ASSERT_COLUMN_MARKED_FOR_WRITE in all store() methods and ASSERT_COLUMN_MARKED_FOR_READ in all val() methods to catch wrong setting if table->read_set and table->write_set (Rest of changes are only indentation cleanups) sql/field.h: Removed Field->query_id (replaced by table->read_set and table->write_set) Removed Field->fieldnr (use Field->field_index instead) Removed Field->add_index (Use Field->flags instead) Add Field->part_of_key_not_clustered (for usage in opt_range.cc) sql/filesort.cc: Added paramater sort_postion to filesort() to force sorting by position instead of storing all fields in the result set. This allowed me to remove checking of sql_command. Create a temporary column bitmap for fields that are used by the sorting process. Use column bitmaps instead of query_id sql/ha_berkeley.cc: Update to 'newer' table handler interface sql/ha_berkeley.h: Update to 'newer' table handler interface sql/ha_federated.cc: Update to 'newer' table handler interface Only read columns that are needed from remote server. In case of eq ranges, don't generate two conditions in the WHERE clause (this can still be optimized, but would require a bigger code change) Use 'simpler to use' XXXX_LEN' macros A bit simpler logic in ::write_row() when creating statements. In update, only include test of fields actually read. (This greatly simplifies the queries sent by the federated engine) Similar changes done for delete_row() sql/ha_federated.h: Update to 'newer' table handler interface Changed XXX_LEN macros to use sizeof(...)-1, to simplify usage in ha_federated.cc Added HA_PRIMARY_KEY_REQUIRED_FOR_DELETE to tell MySQL to read all primary key columns in case of DELETE sql/ha_heap.cc: Update to 'newer' table handler interface sql/ha_heap.h: Update to 'newer' table handler interface sql/ha_innodb.cc: Update to 'newer' table handler interface - Update innobase_create_handler() to new interface - Removed HA_NOT_EXACT_COUNT (not needed) - Renamed HA_PRIMARY_KEY_ALLOW_RANDOM_ACCESS to HA_PRIMARY_KEY_REQUIRED_FOR_POSITION. - Prefixed base status variables with 'stats' - Use table column bitmaps instead of ha_get_bit_in_read_set() - Added ::reset(), with code from ::extra(HA_EXTRA_RESET) - Removed HA_EXTRA_RETRIVE_ALL_COLS and HA_EXTRA_RETRIEVE_PRIMARY_KEY as the table->read_set and table->write_set bitmaps now are accurate sql/ha_innodb.h: Update to 'newer' table handler interface - table_flags are now ulonglong - Added reset() method - Removed not needed ha_retrieve_all_cols() and ha_retrieve_all_pk() columns. - Made build_template() a class function to be able to easier access class variables sql/ha_myisam.cc: Update to 'newer' table handler interface sql/ha_myisam.h: Update to 'newer' table handler interface sql/ha_myisammrg.cc: Update to 'newer' table handler interface sql/ha_myisammrg.h: Update to 'newer' table handler interface sql/ha_ndbcluster.cc: Update to 'newer' table handler interface Fixed use_blob_value() to be accurate In ::complemented_read() we have to check both the read and write bitmap as the old code did mark all changed columns also in the read map Correct dumping of field data with DBUG_DUMP Prefix addresses in DBUG_PRINT with 0x Fixed usage of not initialized memory Update to use field->flags & FIELD_IN_ADD_INDEX instead of field->add_index. sql/ha_ndbcluster.h: Update to 'newer' table handler interface sql/ha_ndbcluster_binlog.cc: Mark usage of all columns in ndbcluster binlog tables false -> FALSE, true -> TRUE Use table->s->all_set instead of creating a temporary bitmap. sql/ha_partition.cc: Update to 'newer' table handler interface Added memroot to initialise_partitions() and related functions to get faster memory allocation. partition_create_handler() is now responsible for initialisation of the partition object Some trivial optimizations and indentation fixes Ensure that table_flags() are up to date Removed documentation for removed HA_EXTRA flags Fixed 'strange' usage of m_file[i] in new_handlers_from_part_info()that worked in current code 'by chance' sql/ha_partition.h: Update to 'newer' table handler interface sql/handler.cc: create_xxx handler now takes MEMROOT as an argument to simplify memory allocation. Much simpler get_new_handler() (Initialization of the object is now handled by the create method for the engine) Moved all allocation of bitmap handling to the TABLE object (in table.cc) Added column_bitmaps_signal() to signal column usage changes. Changed binlog_log_row() to use the exiusting all_set bitmap in the table object. Added ha_reset() function to test that the file object is ok at end of statement and call handler::reset() Added use_hidden_primary_key() to signal handler that we we are going to read and update + delete the row and the handler should thus remember the position for the row sql/handler.h: Added HA_NO_TRANSACTIONS, HA_PARTIAL_COLUMN_READ, HA_REQUIRES_KEY_COLUMNS_FOR_DELETE,HA_PRIMARY_KEY_REQUIRED_FOR_DELETE and HA_HAS_RECORDS Removed HA_NOT_EXACT_COUNT, HA_READ_RND_SAME HA_DUPP_POS -> HA_DUPLICATE_POS HA_NOT_EXACT_COUNT replaced by HA_STATS_RECORDS_IS_EXACT, HA_HAS_RECORDS and records() HA_PRIMARY_KEY_ALLOW_RANDOM_ACCESS renamed to HA_PRIMARY_KEY_REQUIRED_FOR_POSITION Added future row type 'ROW_TYPE_PAGES' Added MEM_ROOT to handlerton 'create' function Added ha_statistics, a structure for all status variable in the base handler class. Moved all status variables in the handler class into a stats structs to improve readability. ha_table_flags() is now a cached (not virtual) version of table_flags() reset() doesn't anymore call extra(HA_EXTRA_RESET) but is a function of it's own. Renamed dupp_ref to dup_ref Renamed not used handler::sortkey Moved read_set and write_set to TABLE structure handler::init() function added for cacheing of virtual constants from engine. sql/item.cc: Added register_field_in_read_map() for marking used columns in expression. This is used by filesort() for creating an optimal column bitmap while retrieving columns for sorting. Initalize value.cs_info.character_set_client to fix core dump bug with --debug set_query_id -> mark_used_columns Mark used columns in read_set OR write_set. sql/item.h: Removed reset_query_id_processor() as it's not needed anymore. Added register_field_in_read_map() Added extra argument to Item::walk() to indicate if we should also traverse sub queries. sql/item_cmpfunc.cc: Temporary mark used columns to be read/writable Update Item::walk to new interface sql/item_cmpfunc.h: Added extra argument to Item::walk() to indicate if we should also traverse sub queries. sql/item_func.cc: Update Item::walk() to new interface table_flags() -> ha_table_flags() sql/item_func.h: Update Item::walk() to new interface sql/item_row.cc: Update Item::walk() to new interface sql/item_row.h: Update Item::walk() to new interface sql/item_strfunc.h: Update Item::walk() to new interface sql/item_subselect.cc: Added Item_subselect::walk() (It was a bug it was missing before. Not sure what kind of bugs this could have caused) sql/item_subselect.h: Update Item::walk() to new interface sql/item_sum.cc: Update Item::walk() to new interface Updates for new handler interace sql/item_sum.h: Update Item::walk() to new interface sql/key.cc: Updates for new handler interace sql/log.cc: Mark all columns used for log tables Split options flag Ensured that second argument to trans_register_ha is a bool sql/log_event.cc: Fixed comments to be withing 79 characters Use OPTION_KEEP_LOG instead of OPTION_STATUS_NO_TRANS_UPDATE to remove wrong warnings Updates for new handler interface Use 0x%lx instead of %p (portability problem) sql/mysql_priv.h: Added OPTION_KEEP_LOG to indicate that we should replicate the binlog even on rollback Removed not used 'conds' argument to setup_tables sql/mysqld.cc: Indentation fixes and removed old comment sql/opt_range.cc: Update to new handler and bitmap interface. Fixed calls to cp_buffer_from_ref() and walk() (new argument). Create new temporary bitmaps for ror scans. (Needed because of handler changes and to get more accurate column bitmaps than before) Remove not needed file->ha_reset() call before file->close(). Some trivial optimization and indentation fixes. Use Field->part_of_key_not_clustered() to check if field is part of a key, instead of looping over all key parts. Added flag 'in_ror_merged_scan' to allow ::get_next() to know that we need a special column bitmap to only fetch pointer to record. This is needed because ror scan uses the same TABLE object but different file objects, which creates problem for the column bitmap handling. (This is a temporary solution. A better one would be to allocate an own TABLE object for ROR scans) Optimized bitmap handling in ror scans: - Start bitmap at position 0, not 1 - Use same bitmap size as in TABLE - Use table->read_set and table->write_set to create column bitmaps instead of looping over all fields in table sql/opt_range.h: Added 'in_ror_merged_scan' to indicate if we are doing a ROR scan Added temporary column bitmaps used in ROR scans sql/opt_sum.cc: Added get_ext_record_count() which is used in COUNT() optimization if handler has HA_HAS_RECORDS Note that we don't call this if handler has HA_STATS_RECORDS_IS_EXACT set. sql/protocol.cc: We need to mark columns as readable in ::store() as we sometimes return default value for fields to the user sql/records.cc: Updates for new handler interface sql/set_var.cc: Handle splitting OPTION_STATUS_NO_TRANS_UPDATE to two flags sql/share/errmsg.txt: Fixed wrong sql/sp.cc: Mark that we are using all columns for the proc table Update call to setup_tables() to use new prototype sql/sp_head.cc: Removed QQ comment sql/spatial.cc: Removed wrong QQ comment sql/sql_acl.cc: Mark that we need all columns for acl tables Supply memroot to some 'new' calls. Indentation fixes sql/sql_base.cc: set_query_id removed Ensure we call ha_reset() at end of each statement Mark read columns in read_set and changed columns in write_set (Before all columns was marked in read set) Fixed marking of some columns that was not proplerly marked before Maintain in TABLE->merge_keys set of all keys that are used in some way Removed not used 'conds' argument from setup_tables() Remove not used setting of 'dupp_field' in insert_fields() Added missing FN_LIBCHAR in mysql_rm_tmp_tables() (This has probably caused us to not properly remove temporary files after crash) sql/sql_bitmap.h: Added is_overlapping() sql/sql_class.cc: Slow_logs was not properly initialized, which could maybe cause extra/lost entries in slow log. set_query_id -> mark_used_columns Simpler variable usage in pack_row() (cleanup) Moved some variable declartion at start of function for better code readability sql/sql_class.h: Added enum_mark_columns Updated comments Renamed dupp_field -> dup_field Added virtual function 'can_rollback_data()' to select_insert() to be used in CREATE ... SELECT to optimize use of OPTION_STATUS_NO_TRANS_UPDATE. (This fixes a bug in CREATE ... SELECT where we did give wrong warnings when using non transacational tables) sql/sql_delete.cc: Updates to new handler interface Call table->mark_columns_needed_for_delete() to allow us to put additional columns in column usage maps if handler so requires. Call table->prepare_for_position() to tell handler that we are going to call ha_position(). Removed call to free_io_cache(). (io_cache is now removed in ha_reset()). Fixed calls to setup_tables() sql/sql_do.cc: Update call to setup_fields() sql/sql_handler.cc: Tell handler tables to always read all columns. Use temporary column map when storing value in field for later index usage sql/sql_help.cc: Makr all used fields to be read Update call to setup_fields() sql/sql_insert.cc: Tell handler we are going to update the auto_increment column dupp_field -> dup_field Set column usage bits for timestamp field. Call table->mark_columns_needed_for_insert() and table->mark_auto_increment_column() Removed not used argument from mysql_prepare_insert_check_table(). If we get an duplicate row on insert, change column map to read and write all columns while retrying the operatation. This is required by the definition of REPLACE and also ensures that fields that are only part of UPDATE are properly handled. This fixed a bug in NDB and REPLACE where REPLACE wrongly copied some column values from the replaced row. Setup new bitmaps for delayed insert rows Remove reseting of next_number_fields as it will be reset on next call to handler_insert() Fixed usage of thd->options and OPTION_STATUS_NO_TRANS_UPDATE. The issue was that one should not to reset this flag as it may be set by a previous statement. The way it was now used caused us to loose some warnings and get other wrong warnings when using non transactional tables mixed with transactional. I fixed it by introducing 'select_insert::can_rollback_data' to inform send_error() that the given statement can be rolled back (which in case of CREATE TABLE can always be done) Don't close tables created with CREATE ... SELECT but keep them in the table cache. Moved out MY_HOOKS from inside function (better readability) sql/sql_load.cc: Update to use new handler and column marking interface Update using setup_tables() sql/sql_olap.cc: Update calls to setup_tables Use enums instead of constants to setup_fields() sql/sql_parse.cc: Handle OPTION_KEEP_LOG: - Set it on CREATE TEMPORARY TABLE / DROP TABLE - Reset it when OPTION_STATUS_NO_TRANS_UPDATE is reset - Don't set it for CREATE ... SELECT (this is handled in select_create class) Remove reseting of OPTION_STATUS_NO_TRANS_UPDATE in begin_trans() as this should already be reset. If in autocommit mode, reset OPTION_KEEP_LOG and OPTION_STATUS_NO_TRANS_UPDATE to not give warnings in future commands sql/sql_partition.cc: Update walk() usage Trivial indentation fixes sql/sql_plugin.cc: Mark all columns as used for plugins sql/sql_prepare.cc: Added assert to find out hidden bugs in character_set_client (got an error in debug binary when this not set correctly) Updates for new handler interface Update calls to setup_fields() sql/sql_repl.cc: Indentation fixes sql/sql_select.cc: Update call to setup_tables() and setup_fields() Remove some old disabled code Update to new hadler interface Indentation cleanups Added column bitmaps for temporary tables. Remove updating of the removed slots in the Field class Added TABLE argument to cp_buffer_from_ref() (To be able to install temporary column maps) For internal temporary tables, use handler::write_row(), handler::delete_row() and handler::update_row() instead of handler::ha_xxxx() for faster execution. sql/sql_select.h: Indentaition fixes. Install temporary column usage maps when needed Added TABLE element to cp_buffer_from_ref() sql/sql_show.cc: Update to new handler interface Mark all columns used for internal tables. Style fixes. Added support for 'future' ROW_TYPE_PAGES. Don't allocate TMP_TABLE_PARAM with calloc. The 'init()' function will initialize the structure properly. sql/sql_table.cc: Update to new handler interface Simple my_snprintf -> strmake() Changed some constants to defines Don't test for NULL in primary key (as we a couple of line above force the PRIMARY KEY to be NOT NULL) Change field->add_index to use field->flags & FIELD_IN_ADD_INDEX Mark all columns as used for ALTER TABLE Style fixes Update call to filesort() sql/sql_trigger.h: Added friend functions to be able to test if triggers exists for table we are going to insert/update or delete in. sql/sql_udf.cc: Mark all columns as used for udf system table. sql/sql_union.cc: Update call to walk() Update to new handler interface sql/sql_update.cc: Remove query_id argument from compare_record() Use column bitmaps instead of query_id. We can't use compare_records() to skip updates for handlers that returns a partial column set and the read_set doesn't cover all columns in the write set, because compare_record() can't in this case know if a not read column changed value. Update call to setup_fields() Using separate column read and write sets allows for easier checking of timestamp field was set by statement. Removed call to free_io_cache() as this is now done in ha_reset() Call table->mark_columns_needed_for_update() and table->prepare_for_position() Style fixes sql/sql_view.cc: Style fixes sql/table.cc: Remove implicitely include 'errno.h' Remove code for building normalized path, as this is now identical to 'path' Remove field->fieldnr Added update of field->part_of_key_not_clustered() Create column bitmaps in TABLE and TABLE_SHARE Don't setup a temporary MEM_ROOT object as a thread specific variable for the handler. Instead we send the to-be-used MEMROOT to get_new_handler() Update to new handler interface Update call to walk() Added new functions: - st_table::clear_column_bitmaps() - st_table::prepare_for_position() - st_table::mark_columns_used_by_index() - st_table::restore_column_maps_after_mark_index() - st_table::mark_columns_used_by_index_no_reset() - st_table::mark_auto_increment_column() - st_table::mark_columns_needed_for_delete() - st_table::mark_columns_needed_for_update() - st_table::mark_columns_needed_for_insert() sql/table.h: Moved column usage bitmaps from handler to TABLE Added to TABLE_SHARE all_set and column_bitmap_size Added to TABLE merge_keys, bitmap_init_values, def_read_set, def_write_set, tmp_set, read_set and write_set. Declared all new table column bitmap functions Added TABLE functions column_bitmaps_set(), column_bitmaps_set_no_signal(), use_all_columns() and default_column_bitmaps() Added functions: tmp_use_all_columns() and tmp_restore_column_map() to temporarly switch column bitmaps Added functions: dbug_tmp_use_all_columns() and dbug_tmp_restore_column_map() to temporarly switch column bitmaps to avoid asserts in Field::store() and Field::val(). sql/tztime.cc: Mark all columns as used for timezone tables storage/archive/ha_archive.cc: Update to new handler interface storage/archive/ha_archive.h: Update to new handler interface storage/blackhole/ha_blackhole.cc: Update to new handler interface storage/blackhole/ha_blackhole.h: Update to new handler interface removed not needed flag HA_DUPP_POS storage/csv/ha_tina.cc: Update to new handler interface storage/csv/ha_tina.h: Update to new handler interface storage/example/ha_example.cc: Update to new handler interface storage/example/ha_example.h: Update to new handler interface storage/heap/hp_extra.c: Added heap_reset() (Required by new handler interface) storage/heap/hp_test2.c: Use heap_reset() storage/myisam/ft_boolean_search.c: Fixed compiler warning storage/myisam/mi_extra.c: Added mi_reset() (Required by new handler interface) storage/myisam/mi_search.c: Fixed DBUG_PRINT messages to use 0x%lx instead of %lx storage/myisam/mi_test2.c: Use mi_reset() storage/myisam/myisampack.c: Use mi_reset() storage/myisammrg/myrg_extra.c: Added myrg_reset() (Required by new handler interface) unittest/mysys/base64.t.c: Include my_global.h Don't include implictely include file 'stdlib.h'
* | | Merge mysql.com:/home/hartmut/projects/mysql/dev/5.0unknown2006-04-071-20/+7
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into mysql.com:/home/hartmut/projects/mysql/dev/5.1 mysql-test/r/ctype_ucs.result: Auto merged mysql-test/r/func_gconcat.result: Auto merged mysql-test/r/func_time.result: Auto merged mysql-test/r/information_schema.result: Auto merged mysql-test/t/ctype_ucs.test: Auto merged mysql-test/t/information_schema.test: Auto merged sql/item_sum.cc: Auto merged sql/item_timefunc.cc: Auto merged sql/opt_sum.cc: Auto merged
| * | Remove redundant code in opt_sum_query()unknown2006-04-061-20/+7
| | |
* | | Merge rurik.mysql.com:/home/igor/dev/mysql-5.0-0unknown2006-04-051-1/+7
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into rurik.mysql.com:/home/igor/dev/mysql-5.1-0 mysql-test/r/view.result: Auto merged mysql-test/t/view.test: Auto merged sql/opt_sum.cc: Auto merged
| * | Fixed bug #18237.unknown2006-04-041-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code in opt_sum_query that prevented the COUNT/MIN/MAX optimization from being applied to outer joins was not adjusted after introducing nested joins. As a result if an outer join contained a reference to a view as an inner table the code of opt_sum_query missed the presence of an on expressions and erroneously applied the mentioned optimization. mysql-test/r/view.result: Added a test case for bug #18237. mysql-test/t/view.test: Added a test case for bug #18237.
* | | Merge rurik.mysql.com:/home/igor/dev/mysql-5.0-0unknown2006-01-061-5/+5
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into rurik.mysql.com:/home/igor/dev/mysql-5.1-0 mysql-test/r/view.result: Auto merged mysql-test/t/view.test: Auto merged sql/opt_sum.cc: Auto merged
| * | Fixed bug #16016: MIN/MAX optimization was not applied to views.unknown2006-01-061-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql-test/r/view.result: Added a test case for bug #16016. mysql-test/t/view.test: Added a test case for bug #16016. sql/opt_sum.cc: Fixed bug #16016: MIN/MAX optimization was not applied to views. The fix employs the standard way of handling direct references to view fields.
* | | Mergeunknown2005-10-061-10/+64
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BitKeeper/etc/ignore: auto-union BUILD/autorun.sh: Auto merged BitKeeper/deleted/.del-bdb.vcproj~ed8534936e40cefb: Auto merged BitKeeper/deleted/.del-heap.vcproj~70c0cc1d680a51c1: Auto merged BitKeeper/deleted/.del-innobase.vcproj~71e1de81f11138bf: Auto merged BitKeeper/deleted/.del-myisam.vcproj~32bb9e4a163fcb5a: Auto merged BitKeeper/deleted/.del-myisammrg.vcproj~6534e59acbfbb63: Auto merged BitKeeper/deleted/.del-mysqld.vcproj~703886a28862bb2: Auto merged Makefile.am: Auto merged client/mysqltest.c: Auto merged include/my_global.h: Auto merged include/mysql_com.h: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/r/ndb_alter_table.result: Auto merged mysql-test/r/ps_6bdb.result: Auto merged mysql-test/r/ps_7ndb.result: Auto merged mysql-test/t/query_cache.test: Auto merged mysys/default.c: Auto merged scripts/make_win_src_distribution.sh: Auto merged scripts/mysql_create_system_tables.sh: Auto merged scripts/mysql_fix_privilege_tables.sql: Auto merged sql/Makefile.am: Auto merged sql/field.cc: Auto merged sql/ha_berkeley.cc: Auto merged sql/ha_berkeley.h: Auto merged sql/ha_federated.cc: Auto merged sql/ha_heap.cc: Auto merged sql/ha_innodb.cc: Auto merged sql/ha_innodb.h: Auto merged sql/ha_myisam.cc: Auto merged sql/ha_myisammrg.cc: Auto merged sql/ha_ndbcluster.h: Auto merged sql/handler.cc: Auto merged sql/item.cc: Auto merged sql/item_subselect.cc: Auto merged sql/log.cc: Auto merged sql/mysql_priv.h: Auto merged sql/opt_sum.cc: Auto merged sql/repl_failsafe.cc: Auto merged sql/set_var.cc: Auto merged sql/sp.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_acl.h: Auto merged sql/sql_base.cc: Auto merged sql/sql_cache.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_delete.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_load.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_select.h: Auto merged sql/sql_show.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_update.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/table.h: Auto merged sql/unireg.cc: Auto merged storage/innobase/buf/buf0buf.c: Auto merged storage/innobase/buf/buf0flu.c: Auto merged storage/innobase/data/data0data.c: Auto merged storage/innobase/dict/dict0dict.c: Auto merged storage/innobase/include/btr0btr.h: Auto merged storage/innobase/include/data0type.ic: Auto merged storage/innobase/include/dict0dict.h: Auto merged storage/innobase/include/dict0mem.h: Auto merged storage/innobase/include/mem0mem.h: Auto merged storage/innobase/include/mem0mem.ic: Auto merged storage/innobase/include/os0file.h: Auto merged storage/innobase/include/row0mysql.h: Auto merged storage/innobase/include/trx0trx.h: Auto merged storage/innobase/include/ut0mem.h: Auto merged storage/innobase/mem/mem0mem.c: Auto merged storage/innobase/os/os0file.c: Auto merged storage/innobase/os/os0proc.c: Auto merged storage/innobase/rem/rem0rec.c: Auto merged storage/innobase/row/row0ins.c: Auto merged storage/innobase/row/row0mysql.c: Auto merged storage/innobase/srv/srv0start.c: Auto merged storage/innobase/trx/trx0sys.c: Auto merged storage/innobase/trx/trx0trx.c: Auto merged storage/innobase/ut/ut0mem.c: Auto merged storage/myisam/ft_boolean_search.c: Auto merged storage/myisam/mi_check.c: Auto merged storage/myisam/mi_dbug.c: Auto merged storage/myisam/mi_delete.c: Auto merged storage/myisam/mi_delete_all.c: Auto merged storage/myisam/mi_key.c: Auto merged storage/myisam/mi_open.c: Auto merged storage/myisam/mi_rkey.c: Auto merged storage/myisam/mi_search.c: Auto merged storage/myisam/mi_test1.c: Auto merged storage/myisam/mi_update.c: Auto merged storage/myisam/mi_write.c: Auto merged storage/myisam/myisamchk.c: Auto merged storage/myisam/myisamdef.h: Auto merged storage/myisam/myisampack.c: Auto merged storage/myisam/sp_key.c: Auto merged storage/myisammrg/myrg_rkey.c: Auto merged storage/ndb/include/kernel/GlobalSignalNumbers.h: Auto merged storage/ndb/include/kernel/signaldata/ApiVersion.hpp: Auto merged storage/ndb/include/kernel/signaldata/EventReport.hpp: Auto merged storage/ndb/include/kernel/signaldata/StopReq.hpp: Auto merged storage/ndb/include/mgmapi/ndb_logevent.h: Auto merged storage/ndb/include/ndbapi/NdbBlob.hpp: Auto merged storage/ndb/include/ndbapi/NdbIndexOperation.hpp: Auto merged storage/ndb/include/ndbapi/NdbIndexScanOperation.hpp: Auto merged storage/ndb/include/ndbapi/NdbOperation.hpp: Auto merged storage/ndb/include/ndbapi/NdbRecAttr.hpp: Auto merged storage/ndb/include/ndbapi/NdbTransaction.hpp: Auto merged storage/ndb/src/common/util/SimpleProperties.cpp: Auto merged storage/ndb/src/kernel/blocks/backup/Backup.cpp: Auto merged storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Auto merged storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp: Auto merged storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp: Auto merged storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp: Auto merged storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp: Auto merged storage/ndb/src/mgmapi/ndb_logevent.cpp: Auto merged storage/ndb/src/mgmclient/CommandInterpreter.cpp: Auto merged storage/ndb/src/mgmsrv/Config.cpp: Auto merged storage/ndb/src/mgmsrv/Config.hpp: Auto merged storage/ndb/src/mgmsrv/ConfigInfo.cpp: Auto merged storage/ndb/src/mgmsrv/InitConfigFileParser.cpp: Auto merged storage/ndb/src/mgmsrv/InitConfigFileParser.hpp: Auto merged storage/ndb/src/mgmsrv/MgmtSrvr.hpp: Auto merged storage/ndb/src/mgmsrv/MgmtSrvrConfig.cpp: Auto merged storage/ndb/src/mgmsrv/MgmtSrvrGeneralSignalHandling.cpp: Auto merged storage/ndb/src/mgmsrv/Services.cpp: Auto merged storage/ndb/src/mgmsrv/Services.hpp: Auto merged storage/ndb/src/mgmsrv/main.cpp: Auto merged storage/ndb/src/ndbapi/NdbApiSignal.cpp: Auto merged storage/ndb/src/ndbapi/NdbApiSignal.hpp: Auto merged storage/ndb/src/ndbapi/NdbBlob.cpp: Auto merged storage/ndb/src/ndbapi/NdbImpl.hpp: Auto merged storage/ndb/src/ndbapi/NdbRecAttr.cpp: Auto merged storage/ndb/src/ndbapi/NdbUtil.cpp: Auto merged storage/ndb/src/ndbapi/NdbUtil.hpp: Auto merged storage/ndb/src/ndbapi/Ndbif.cpp: Auto merged storage/ndb/src/ndbapi/Ndblist.cpp: Auto merged storage/ndb/src/ndbapi/ObjectMap.hpp: Auto merged storage/ndb/test/include/NDBT_Test.hpp: Auto merged storage/ndb/test/ndbapi/bank/BankLoad.cpp: Auto merged storage/ndb/test/ndbapi/testOIBasic.cpp: Auto merged storage/ndb/test/src/HugoCalculator.cpp: Auto merged storage/ndb/test/src/NDBT_Test.cpp: Auto merged storage/ndb/test/src/NdbBackup.cpp: Auto merged storage/ndb/test/src/NdbRestarts.cpp: Auto merged storage/ndb/tools/ndb_condig.cpp: Auto merged storage/ndb/tools/restore/Restore.cpp: Auto merged storage/ndb/tools/restore/consumer_restore.cpp: Auto merged support-files/mysql.spec.sh: Auto merged configure.in: merge BUILD/SETUP.sh: merge BitKeeper/deleted/.del-mysql.sln~f2120278f8a437be: SCCS merged libmysqld/Makefile.am: merge sql/ha_ndbcluster.cc: merge sql/handler.h: merge sql/mysqld.cc: merge sql/opt_range.cc: merge sql/slave.cc: merge sql/slave.h: e merge sql/sql_parse.cc: merge sql/table.cc: merge sql/examples/ha_tina.cc: merge sql/examples/ha_tina.h: merge sql/share/errmsg.txt: merge storage/ndb/include/ndbapi/Ndb.hpp: merge storage/ndb/src/common/debugger/EventLogger.cpp: merge storage/ndb/src/kernel/blocks/dbdict/Makefile.am: merge storage/ndb/src/mgmsrv/MgmtSrvr.cpp: merge storage/ndb/src/ndbapi/Ndbinit.cpp: SCCS merged
| * | Merge neptunus.(none):/home/msvensson/mysql/mysql-4.1unknown2005-09-281-5/+5
| |\ \ | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into neptunus.(none):/home/msvensson/mysql/mysql-5.0 client/mysql.cc: Auto merged client/mysqltest.c: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/r/mysqltest.result: Auto merged mysql-test/t/mysqltest.test: Auto merged mysys/my_init.c: Auto merged sql/sql_update.cc: Auto merged Makefile.am: Manual merge mysql-test/r/cast.result: Manual merge mysql-test/t/cast.test: Manual merge ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp: Manual merge sql/ha_ndbcluster.cc: Manual merge sql/item.h: Manual merge sql/opt_sum.cc: Manual merge sql/sql_delete.cc: Manual merge sql/sql_lex.cc: Manual merge sql/sql_load.cc: Manual merge sql/sql_prepare.cc: Manual merge
| | * Fixed error found during review of new pushed codeunknown2005-09-251-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | client/mysql.cc: Don't use c_ptr() for cgets() and ensure buffer is not overwritten mysql-test/r/cast.result: More test for CAST(0x.... as signed) sql/opt_sum.cc: Fix bugs found during review - Changed code to be able to remove one if - Ensure that count == 0 only if is_exact_count == TRUE sql/sql_delete.cc: Ensure 'allow_sum_func' is reset before call to setup_conds sql/sql_lex.cc: allow_sum_func doesn't have to be reset for each query (It's to be reset in setup_fields() or before call to setup_conds() sql/sql_load.cc: Move set of auto_increment_field_not_null so that it's not set if field value is NULL sql/sql_prepare.cc: allow_sum_func doesn't have to be reset for each query (It's to be reset in setup_fields() or before call to setup_conds() sql/sql_update.cc: Ensure 'allow_sum_func' is reset before call to setup_conds
| * | Merge from 4.1 to 5.0unknown2005-09-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql-test/r/loaddata.result: Add drop tablea after test case mysql-test/r/type_decimal.result: Update warnings mysql-test/r/union.result: Miss in merge mysql-test/t/loaddata.test: Add drop table after test case sql/opt_sum.cc: Add missing } sql/sql_load.cc: Manual merge
| * | Merge neptunus.(none):/home/msvensson/mysql/mysql-4.1unknown2005-09-231-12/+65
| |\ \ | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into neptunus.(none):/home/msvensson/mysql/mysql-5.0 client/mysqltest.c: Auto merged myisam/myisamchk.c: Auto merged mysql-test/t/func_group.test: Auto merged mysql-test/t/loaddata.test: Auto merged mysql-test/t/type_decimal.test: Auto merged mysql-test/t/union.test: Auto merged sql/item_sum.cc: Auto merged sql/mysqld.cc: Auto merged sql/sql_parse.cc: Auto merged mysql-test/r/func_group.result: Manual merge mysql-test/r/loaddata.result: Manual merge mysql-test/r/type_decimal.result: Manual merge mysql-test/r/union.result: Manual merge sql/field_conv.cc: aborting fix for 7589 sql/opt_sum.cc: Manual merge sql/sql_load.cc: Manual merge sql/sql_yacc.yy: Aborting fix for 11553
| | * Merge mysql.com:/home/timka/mysql/src/4.1-virginunknown2005-09-211-29/+67
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | into mysql.com:/home/timka/mysql/src/4.1-dbg sql/opt_sum.cc: Auto merged
| | | * Fix for BUG#12882 - min/max inconsistent on empty table.unknown2005-09-211-29/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was in that the MIN/MAX optimization in opt_sum_query was replacing MIN/MAX functions with their constant argument without taking into account that a query has no result rows. mysql-test/r/func_group.result: Test for BUG#12882. mysql-test/t/func_group.test: Test for BUG#12882. sql/item_sum.cc: If it is known that a query has no result rows, do not call add() via the call to Item_sum::no_rows_in_result() which calls reset(). Instead directly call clear() so that the MIN and MAX functions produce NULL when there are no result rows. sql/opt_sum.cc: * Do not apply MIN/MAX optimization when the operand of MIN/MAX is a constant if it can't be determined whether the query has any result rows. The reason is that if the query has result rows, then the result of MIN/MAX is its constant argument, but if the query result is empty, then the result of MIN/MAX must be NULL irrespective of its argument. * The patch also simplifies a bit the branch that hadles COUNT().
| | * | Fix bug #13218: InnoDB: using a partial-field key prefix in searchunknown2005-09-191-1/+2
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is backport from 5.0 of fix for bug #11039 mysql-test/t/innodb.test: Backport from 5.0 of test case for bug#11039 mysql-test/r/innodb.result: Backport from 5.0 of test case for bug#11039 sql/opt_sum.cc: Fix bug #13218: backport from 5.0 of bug #11039 fix
* | | Patch for push of wl1354 Partitioningunknown2005-07-181-2/+2
|/ /
* | Fixed wrong key length when using MIN() optimization (non fatal, but caused ↵unknown2005-06-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | InnoDB to write warnings to the log file) This fixed bug #11039: InnoDB: Warning: using a partial-field key prefix in search mysql-test/r/innodb.result: Added extra test for bug #11039: InnoDB: Warning: using a partial-field key prefix in search mysql-test/t/innodb.test: Added extra test for bug #11039: InnoDB: Warning: using a partial-field key prefix in search sql/opt_sum.cc: Fixed wrong key length when using MIN() optimization
* | Fixes while reviewing new codeunknown2005-05-061-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added option --count to mysqlshow (to show number of rows) Fixed possible core dump in information schema client/client_priv.h: --count for mysqlshow client/mysqlshow.c: Added option --count to be used when the user want's number of rows per table in the output (We shouldn't use count(*) as default as this can be a slow operation) mysys/my_thr_init.c: Correct comment sql/ha_berkeley.cc: Remove not used variable sql/ha_berkeley.h: Remove not used variable sql/ha_innodb.cc: Remove not used function sql/ha_ndbcluster.cc: false -> FALSE true -> TRUE sql/handler.cc: Added and fixed comments Remove 'strange' code to remove compiler warnings (better to do things like this with attribute) sql/item.cc: false -> FALSE sql/item_cmpfunc.cc: Fixed indentation sql/item_cmpfunc.h: marked BETWEEN as a bool function sql/item_func.cc: Simple optimzation sql/key.cc: Removed wrong code sql/log.cc: Check result from open_index_file() sql/mysql_priv.h: Simplyfy some test of netware sql/mysqld.cc: Fixed indentation Check result form open_index_file() Simplify code with IF_NETWARE() sql/opt_range.cc: false -> FALSE true -> TRUE Fixed indentation sql/opt_sum.cc: Fixed comments sql/sp_head.cc: Simple optimzation Move variable declarations to begining of blocks sql/sql_acl.cc: Fix long lines Rename xx -> column Move declaration to beginning of block sql/sql_parse.cc: Removed comment sql/sql_select.cc: Indentation fixes sql/sql_show.cc: Fixed reference outside of array (possible core dump) sql/sql_table.cc: Simplify code Combine common code sql/sql_test.cc: false -> FALSE sql/sql_trigger.cc: false -> false true -> TRUE sql/sql_yacc.yy: Simpler test sql/unireg.cc: Added comment
* | Mergeunknown2005-03-051-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BitKeeper/etc/logging_ok: auto-union innobase/trx/trx0trx.c: Auto merged mysql-test/r/ctype_collate.result: Auto merged mysql-test/r/func_system.result: Auto merged mysql-test/r/type_blob.result: Auto merged sql/ha_innodb.cc: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_create.cc: Auto merged sql/item_func.cc: Auto merged sql/item_strfunc.cc: Auto merged sql/item_strfunc.h: Auto merged sql/opt_sum.cc: Auto merged innobase/ut/ut0mem.c: e merge from 4.1 mysql-test/r/func_group.result: merge from 4.1 mysql-test/r/func_str.result: merge from 4.1 mysql-test/t/func_group.test: merge from 4.1
| * logging_ok:unknown2005-03-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Logging to logging@openlogging.org accepted func_group.result, func_group.test: Added a test case for bug #8893. opt_sum.cc: A misplaced initialization for the returned parameter prefix_len in the function find_key_for_maxmin caused usage of a wrong key prefix by the min/max optimization in cases when the matching index was not the first index that contained the min/max field. sql/opt_sum.cc: A misplaced initialization for the returned parameter prefix_len in the function find_key_for_maxmin caused usage of a wrong key prefix by the min/max optimization in cases when the matching index was not the first index that contained the min/max field. mysql-test/t/func_group.test: Added a test case for bug #8893. mysql-test/r/func_group.result: Added a test case for bug #8893. BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
* | First stage of table definition cacheunknown2005-01-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Split TABLE to TABLE and TABLE_SHARE (TABLE_SHARE is still allocated as part of table, will be fixed soon) Created Field::make_field() and made Field_num::make_field() to call this Added 'TABLE_SHARE->db' that points to database name; Changed all usage of table_cache_key as database name to use this instead Changed field->table_name to point to pointer to alias. This allows us to change alias for a table by just updating one pointer. Renamed TABLE_SHARE->real_name to table_name Renamed TABLE->table_name to alias Renamed TABLE_LIST->real_name to table_name include/myisam.h: Added const before names mysql-test/r/group_min_max.result: Make results repeatable mysql-test/t/group_min_max.test: Make results repeatable sql/field.cc: Created Field::make_field() and made Field_num::make_field() to call this Use TABLE_SHARE Use sql_strmake() instead of sql_memdup() to simplify code sql/field.h: Changed table_name to be pointer to table_name. This allows us to change alias for all fields by just changing one pointer. Use TABLE_SHARE sql/field_conv.cc: Use TABLE_SHARE sql/filesort.cc: Use TABLE_SHARE sql/ha_berkeley.cc: Use TABLE_SHARE sql/ha_heap.cc: Use TABLE_SHARE sql/ha_innodb.cc: Use TABLE_SHARE sql/ha_myisam.cc: Use TABLE_SHARE sql/ha_myisammrg.cc: Use TABLE_SHARE Change some pointer handling to use const char* sql/ha_ndbcluster.cc: Use TABLE_SHARE sql/handler.cc: Use TABLE_SHARE sql/item.cc: Use TABLE_SHARE sql/item_func.cc: Use TABLE_SHARE sql/item_subselect.cc: Use TABLE_SHARE sql/item_sum.cc: Use TABLE_SHARE sql/key.cc: Use TABLE_SHARE sql/lock.cc: Use TABLE_SHARE sql/log_event.cc: real_name -> table_name sql/mysql_priv.h: Use TABLE_SHARE sql/opt_range.cc: Use TABLE_SHARE sql/opt_sum.cc: Use TABLE_SHARE sql/records.cc: Use TABLE_SHARE sql/repl_failsafe.cc: real_name -> table_name sql/slave.cc: Use TABLE_SHARE sql/sp.cc: Use TABLE_SHARE sql/sp_head.cc: real_name -> table_name sql/sql_acl.cc: Use TABLE_SHARE removed unnecessary assert fixed indentation changed some char * -> const char* sql/sql_acl.h: changed some char* -> const char* sql/sql_base.cc: Use TABLE_SHARE sql/sql_cache.cc: Use TABLE_SHARE sql/sql_class.cc: Use TABLE_SHARE sql/sql_db.cc: real_name -> table_name sql/sql_delete.cc: Use TABLE_SHARE sql/sql_derived.cc: Use TABLE_SHARE sql/sql_handler.cc: Use TABLE_SHARE sql/sql_help.cc: Use TABLE_SHARE sql/sql_insert.cc: Use TABLE_SHARE sql/sql_load.cc: Use TABLE_SHARE sql/sql_parse.cc: Use TABLE_SHARE sql/sql_rename.cc: real_name -> table_name sql/sql_select.cc: Use TABLE_SHARE table->blob_fields now points to field offsets, not fields tmp_table->table_name now points to alias name sql/sql_show.cc: Use TABLE_SHARE sql/sql_table.cc: Use TABLE_SHARE sql/sql_test.cc: Use TABLE_SHARE sql/sql_trigger.cc: Use TABLE_SHARE sql/sql_udf.cc: Use TABLE_SHARE sql/sql_union.cc: real_name -> table_name sql/sql_update.cc: Use TABLE_SHARE sql/sql_view.cc: Use TABLE_SHARE sql/table.cc: Split TABLE to TABLE and TABLE_SHARE Changed blob_field to be field offsets instead of pointer to fields Only initialize table->s->default_values with default record (not all table->record[#]) Some indentation changes sql/table.h: Split TABLE to TABLE and TABLE_SHARE sql/tztime.cc: real_name -> table_name sql/unireg.cc: Use TABLE_SHARE sql/unireg.h: Use TABLE_SHARE
* | Merge with new VARCHAR codeunknown2004-12-061-2/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | configure.in: Auto merged BitKeeper/deleted/.del-acinclude.m4~f4ab416bac5003: Auto merged BitKeeper/deleted/.del-ha_isam.cc~4dce65904db2675e: Auto merged BitKeeper/deleted/.del-ha_isammrg.cc~dc682e4755d77a2e: Auto merged client/mysqldump.c: Auto merged client/mysqltest.c: Auto merged heap/hp_create.c: Auto merged heap/hp_delete.c: Auto merged heap/hp_hash.c: Auto merged heap/hp_write.c: Auto merged include/decimal.h: Auto merged include/m_ctype.h: Auto merged libmysql/libmysql.c: Auto merged libmysqld/Makefile.am: Auto merged myisam/mi_check.c: Auto merged myisam/mi_create.c: Auto merged myisam/mi_write.c: Auto merged mysql-test/r/ctype_tis620.result: Auto merged mysql-test/r/ctype_ucs.result: Auto merged mysql-test/r/myisam.result: Auto merged mysql-test/r/mysqldump.result: Auto merged mysql-test/r/order_by.result: Auto merged mysql-test/r/ps.result: Auto merged mysql-test/r/ps_1general.result: Auto merged mysql-test/r/ps_2myisam.result: Auto merged mysql-test/r/ps_3innodb.result: Auto merged mysql-test/r/ps_4heap.result: Auto merged mysql-test/r/ps_5merge.result: Auto merged mysql-test/r/ps_6bdb.result: Auto merged mysql-test/r/select.result: Auto merged mysql-test/r/strict.result: Auto merged mysql-test/r/subselect.result: Auto merged mysql-test/r/type_blob.result: Auto merged mysql-test/t/ctype_ucs.test: Auto merged mysql-test/t/endspace.test: Auto merged mysql-test/t/myisam.test: Auto merged mysql-test/t/ps_1general.test: Auto merged mysql-test/t/strict.test: Auto merged mysql-test/t/type_blob.test: Auto merged ndb/src/common/util/NdbSqlUtil.cpp: Auto merged scripts/mysql_fix_privilege_tables.sh: Auto merged sql/field.h: Auto merged sql/field_conv.cc: Auto merged sql/ha_heap.cc: Auto merged sql/ha_innodb.cc: Auto merged sql/ha_innodb.h: Auto merged sql/ha_myisam.cc: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/handler.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_sum.cc: Auto merged sql/opt_range.cc: Auto merged sql/opt_sum.cc: Auto merged sql/protocol.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_help.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/structs.h: Auto merged sql/table.cc: Auto merged strings/ctype-czech.c: Auto merged strings/ctype-uca.c: Auto merged strings/ctype-utf8.c: Auto merged strings/ctype-win1250ch.c: Auto merged strings/decimal.c: Auto merged tests/client_test.c: Auto merged mysql-test/r/bdb.result: Merge with VARCHAR code mysql-test/r/heap.result: Merge with VARCHAR code mysql-test/r/innodb.result: Merge with VARCHAR code mysql-test/r/select.result.es: Merge with VARCHAR code mysql-test/t/bdb.test: Merge with VARCHAR code mysql-test/t/heap.test: Merge with VARCHAR code mysql-test/t/innodb.test: Merge with VARCHAR code sql/field.cc: Merge with VARCHAR code sql/item.cc: Merge with VARCHAR code sql/sql_acl.cc: Merge with VARCHAR code sql/sql_parse.cc: Merge with VARCHAR code sql/sql_table.cc: Merge with VARCHAR code sql/sql_update.cc: Merge with VARCHAR code sql/table.h: Merge with VARCHAR code strings/ctype-mb.c: Don't pad my_like_range with max_str for simple LIKE expression strings/ctype-tis620.c: Merge with VARCHAR code strings/ctype-ucs2.c: Added new argument to my_strnncollsp_ucs2() Simply code
| * | Add support for up to VARCHAR (size up to 65535)unknown2004-12-061-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Renamed HA_VAR_LENGTH to HA_VAR_LENGTH_PART Renamed in all files FIELD_TYPE_STRING and FIELD_TYPE_VAR_STRING to MYSQL_TYPE_STRING and MYSQL_TYPE_VAR_STRING to make it easy to catch all possible errors Added support for VARCHAR KEYS to heap Removed support for ISAM Now only long VARCHAR columns are changed to TEXT on demand (not CHAR) Internal temporary files can now use fixed length tables if the used VARCHAR columns are short BitKeeper/deleted/.del-ha_isam.cc~4dce65904db2675e: Delete: sql/ha_isam.cc BitKeeper/deleted/.del-_cache.c~b5d80b5c3ae233b1: Delete: isam/_cache.c BitKeeper/deleted/.del-_dbug.c~88d7964ae5e3c9bd: Delete: isam/_dbug.c BitKeeper/deleted/.del-_dynrec.c~48dd758f5a5450df: Delete: isam/_dynrec.c BitKeeper/deleted/.del-_key.c~ce62d47a6c681084: Delete: isam/_key.c BitKeeper/deleted/.del-_locking.c~dea4cdc6ea425c67: Delete: isam/_locking.c BitKeeper/deleted/.del-_packrec.c~47ae1b16c007e9be: Delete: isam/_packrec.c BitKeeper/deleted/.del-_page.c~148b1a613d052ee8: Delete: isam/_page.c BitKeeper/deleted/.del-_search.c~f509292aa1ff18ff: Delete: isam/_search.c BitKeeper/deleted/.del-_statrec.c~58d9263b3475d58b: Delete: isam/_statrec.c BitKeeper/deleted/.del-changed.c~d075de80a314b02d: Delete: isam/changed.c BitKeeper/deleted/.del-close.c~fd62629496ee5bcc: Delete: isam/close.c BitKeeper/deleted/.del-create.c~96cecc433c0c2242: Delete: isam/create.c BitKeeper/deleted/.del-delete.c~65ee8daaa75a14b6: Delete: isam/delete.c BitKeeper/deleted/.del-extra.c~706f29d72beb2565: Delete: isam/extra.c BitKeeper/deleted/.del-info.c~96cfb747af8da0d: Delete: isam/info.c BitKeeper/deleted/.del-isamchk.c~c0f59c2687d2248f: Delete: isam/isamchk.c BitKeeper/deleted/.del-isamlog.c~85b6b31c6e2b8519: Delete: isam/isamlog.c BitKeeper/deleted/.del-log.c~55a973013d55cade: Delete: isam/log.c BitKeeper/deleted/.del-open.c~95b3b75042fae00a: Delete: isam/open.c BitKeeper/deleted/.del-pack_isam.c~43801f0df7504834: Delete: isam/pack_isam.c BitKeeper/deleted/.del-panic.c~f7fd71605324f8f3: Delete: isam/panic.c BitKeeper/deleted/.del-range.c~142f1f8ac4948082: Delete: isam/range.c BitKeeper/deleted/.del-rfirst.c~66f494291dc005d3: Delete: isam/rfirst.c BitKeeper/deleted/.del-rkey.c~cc54c6498352f999: Delete: isam/rkey.c BitKeeper/deleted/.del-rlast.c~d1fe1866139e9866: Delete: isam/rlast.c BitKeeper/deleted/.del-rnext.c~b308eaa1e11ea7de: Delete: isam/rnext.c BitKeeper/deleted/.del-rprev.c~b359f71fdea4bbce: Delete: isam/rprev.c BitKeeper/deleted/.del-rrnd.c~7fcfcce88d4a5200: Delete: isam/rrnd.c BitKeeper/deleted/.del-rsame.c~75a62d5548103a15: Delete: isam/rsame.c BitKeeper/deleted/.del-rsamepos.c~5b5652dd2cda6d5d: Delete: isam/rsamepos.c BitKeeper/deleted/.del-sort.c~e2e56b5a37ce86f4: Delete: isam/sort.c BitKeeper/deleted/.del-static.c~3a1354b84f4a9cc7: Delete: isam/static.c BitKeeper/deleted/.del-test1.c~64d52e9412d457ed: Delete: isam/test1.c BitKeeper/deleted/.del-test2.c~2f9a632cab572958: Delete: isam/test2.c BitKeeper/deleted/.del-test3.c~e8a7a4afe8a087: Delete: isam/test3.c BitKeeper/deleted/.del-isamdef.h~ac8d49e7e2201c66: Delete: isam/isamdef.h BitKeeper/deleted/.del-update.c~670264f51dc44934: Delete: isam/update.c BitKeeper/deleted/.del-write.c~8f1918b1f6770e54: Delete: isam/write.c BitKeeper/deleted/.del-Makefile.am~6cfa0db5e7778d09: Delete: isam/Makefile.am BitKeeper/deleted/.del-make-ccc~3ee55391eda0b0ab: Delete: isam/make-ccc BitKeeper/deleted/.del-ChangeLog~208984fb7a51e568: Delete: isam/ChangeLog BitKeeper/deleted/.del-test_all.res~c2aafb49a3a77db7: Delete: isam/test_all.res BitKeeper/deleted/.del-test_all~93c701e44a9c5b65: Delete: isam/test_all BitKeeper/deleted/.del-.cvsignore~54f6f0f2d5012561: Delete: isam/.cvsignore BitKeeper/deleted/.del-ha_isammrg.cc~dc682e4755d77a2e: Delete: sql/ha_isammrg.cc BitKeeper/deleted/.del-ha_isam.h~bf53d533be3d3927: Delete: sql/ha_isam.h BitKeeper/deleted/.del-ha_isammrg.h~66fd2e5bfe7207dc: Delete: sql/ha_isammrg.h acinclude.m4: Remove ISAM client/mysqldump.c: FIELD_TYPE -> MYSQL_TYPE client/mysqltest.c: Add missing DBUG_RETURN configure.in: Remove ISAM heap/heapdef.h: Add support for VARCHAR heap/hp_create.c: Add support for VARCHAR heap/hp_delete.c: Add support for VARCHAR heap/hp_hash.c: Add support for VARCHAR (VARCHAR keys was not supported before) heap/hp_rkey.c: Add support for VARCHAR heap/hp_update.c: Add support for VARCHAR heap/hp_write.c: Add support for VARCHAR (Added flag SEARCH_UPDATE to mark that this is an update) include/decimal.h: Remove not needed my_global.h include/m_ctype.h: Add support for VARCHAR include/my_base.h: Add support for VARCHAR include/my_handler.h: Moved general purpose macro from MyISAM code include/mysql_com.h: Add support for VARCHAR libmysql/libmysql.c: Add support for VARCHAR libmysqld/Makefile.am: Removed ISAM myisam/ft_static.c: Add support for VARCHAR myisam/ft_test1.c: Add support for VARCHAR myisam/ft_update.c: Add support for VARCHAR myisam/mi_check.c: Add support for VARCHAR myisam/mi_create.c: Add support for VARCHAR - VARCHAR key segments are marked with HA_VAR_LENGTH_PART myisam/mi_key.c: Add support for VARCHAR Fixed bug in old VARCHAR code when reading index-only myisam/mi_range.c: Fixed comment style myisam/mi_rnext_same.c: Handle case where equal keys can be of different length myisam/mi_search.c: Add support for VARCHAR myisam/mi_test1.c: Add support for VARCHAR myisam/mi_unique.c: Add support for VARCHAR (Some new code to handle keys that are equal but have different lengths) myisam/mi_write.c: Fixed comment myisam/myisamchk.c: Better infotext if wrong type mysql-test/r/bdb.result: Updated old result and new results for VARCHAR mysql-test/r/create.result: Updated old result and new results for VARCHAR mysql-test/r/ctype_tis620.result: Updated old result and new results for VARCHAR (Old code sorted tis620 wrong) mysql-test/r/ctype_ucs.result: Updated old result and new results for VARCHAR mysql-test/r/endspace.result: Updated old result and new results for VARCHAR mysql-test/r/func_like.result: Updated old result and new results for VARCHAR mysql-test/r/heap.result: Updated old result and new results for VARCHAR mysql-test/r/innodb.result: Updated old result. This will change a bit when also InnoDB supports VARCHAR mysql-test/r/merge.result: Updated old result and new results for VARCHAR mysql-test/r/myisam.result: Updated old result and new results for VARCHAR mysql-test/r/mysqldump.result: Updated old result and new results for VARCHAR mysql-test/r/order_by.result: Updated old result and new results for VARCHAR (Key length is different for VARCHAR) mysql-test/r/ps.result: Updated old result and new results for VARCHAR mysql-test/r/ps_1general.result: Updated results for new .frm version Don't print seconds in show full process list as this may change mysql-test/r/ps_2myisam.result: Updated old result and new results for VARCHAR mysql-test/r/ps_3innodb.result: Updated old result and new results for VARCHAR mysql-test/r/ps_4heap.result: Updated old result and new results for VARCHAR mysql-test/r/ps_5merge.result: Updated old result and new results for VARCHAR mysql-test/r/ps_6bdb.result: Updated old result and new results for VARCHAR mysql-test/r/select.result.es: Updated results by hand mysql-test/r/select.result: Updated old result and new results for VARCHAR mysql-test/r/select_found.result: Updated old result and new results for VARCHAR mysql-test/r/show_check.result: Updated old result and new results for VARCHAR mysql-test/r/strict.result: Updated old result and new results for VARCHAR mysql-test/r/subselect.result: Updated old result and new results for VARCHAR mysql-test/r/system_mysql_db.result: Updated old result and new results for VARCHAR mysql-test/r/type_blob.result: Updated old result and new results for VARCHAR mysql-test/r/type_ranges.result: Updated old result and new results for VARCHAR mysql-test/r/type_ranges.result.es: Updated some results by hand mysql-test/t/bdb.test: Test VARCHAR mysql-test/t/ctype_ucs.test: Some fixes related to VARCHAR mysql-test/t/endspace.test: Fixes to make it easier to compare columns with end space mysql-test/t/heap.test: Test VARCHAR mysql-test/t/innodb.test: Prepare for testing VARCHAR mysql-test/t/myisam.test: Test VARCHAR mysql-test/t/ps_1general.test: Don't show seconds for show processlist mysql-test/t/ps_4heap.test: Update for VARCHAR mysql-test/t/strict.test: Fix test for VARCHAR mysql-test/t/type_blob.test: Update test for VARCHAR Note that now you can't store 'a' and 'a ' in an unique varchar/text index if the column is not binary mysys/my_handler.c: Add support for VARCHAR ndb/src/common/util/NdbSqlUtil.cpp: Fix for usage of strnncollsp scripts/mysql_fix_privilege_tables.sh: Simple fix so that my_print_defaults works sql/Makefile.am: Remove ISAM sql/field.cc: Add support for VARCHAR Fixed the keys for blob's are compared with strnncollsp Ensure that old tables from MySQL 4.0 works as they did before. (Old VARCHAR will be converted to new VARCHAR on ALTER TABLE) sql/field.h: Add support for VARCHAR sql/field_conv.cc: Change FIELD_TYPE_VAR_STRING -> MYSQL_TYPE_VARCHAR Added usage of HA_KEY_BLOB_LENGTH sql/ha_berkeley.cc: Add support for VARCHAR Added usage of table->insert_or_update if we would ever want to know in key_cmp if we are changing keys sql/ha_heap.cc: Add support for VARCHAR sql/ha_innodb.cc: Changed MYSQL_TYPE_VAR_STRING to MYSQL_TYPE_VARCHAR. Waiting for Heikki to add full VARCHAR support sql/ha_innodb.h: InnoDB doesn't support full VARCHAR yet sql/ha_myisam.cc: Add support for VARCHAR sql/ha_ndbcluster.cc: Add support for VARCHAR sql/handler.h: Added HA_NO_VARCHAR for table handler that doesn't support VARCHAR. In this case MySQL will create a normal CHAR instead sql/item.cc: Fixed access of already freed memory Added support of VARCHAR - varchar length is now checked in mysql_prepare sql/item_cmpfunc.cc: Added new parameter to strncollsp sql/item_sum.cc: Added new parameter to strncollsp FIELD_TYPE -> MYSQL_TYPE sql/key.cc: Add support for VARCHAR sql/opt_range.cc: Remove character set parameter from set_key_image() sql/opt_sum.cc: Remove character set parameter from set_key_image() sql/protocol.cc: Return MYSQL_TYPE_VAR_STRING instead of MYSQL_TYPE_VARCHAR to clients (to not cause compatiblity problems) sql/sql_acl.cc: Change key handling code so that we can use CHAR or VARCHAR for the user table columns sql/sql_base.cc: Remove old, not used code sql/sql_help.cc: Remove charset from get_key_image sql/sql_parse.cc: Ensure that OPTION_TABLE_LOCK is cleared ASAP; This fixed a problem in BDB transaction code when one used LOCK TABLES on a BDB table Added support for VARCHAR Moved field length checking and VARCHAR -> TEXT convert to mysql_prepare (as we need the know the character set for the column) sql/sql_select.cc: Added support of VARCHAR Added heuristic to use fixed size rows for tmp tables if we are using only a few short VARCHAR's sql/sql_string.cc: Added extra argument to strnncollsp sql/sql_table.cc: Add support for VARCHAR Automaticly convert (with warning) big VARCHAR (but not CHAR) to TEXT If handler doesn't support VARCHAR convert VARCHAR to CHAR sql/sql_update.cc: Fixed compiler warning sql/sql_yacc.yy: Add support for VARCHAR sql/strfunc.cc: Fixed valgrind warning sql/structs.h: Added 'table' to KEY structure to make life easier for some handler functions sql/table.cc: Add support for VARCHAR - New .frm version - FIELD_TYPE -> MYSQL_TYPE sql/table.h: Added insert_or_update; A bool flag a handler can set/reset if needed (for handler internal usage) sql/unireg.h: Add support for VARCHAR strings/ctype-big5.c: Added new argument to strnncollsp() to allow one to define if end space are significant or not Changed my_like_range... to correctly calculate min_length & max_length strings/ctype-bin.c: Added new argument to strnncollsp() to allow one to define if end space are significant or not strings/ctype-czech.c: Changed my_like_range... to correctly calculate min_length & max_length strings/ctype-gbk.c: Added new argument to strnncollsp() to allow one to define if end space are significant or not Changed my_like_range... to correctly calculate min_length & max_length strings/ctype-latin1.c: Added new argument to strnncollsp() to allow one to define if end space are significant or not strings/ctype-mb.c: Added new argument to strnncollsp() to allow one to define if end space are significant or not Changed my_like_range... to correctly calculate min_length & max_length strings/ctype-simple.c: Added new argument to strnncollsp() to allow one to define if end space are significant or not Changed my_like_range... to correctly calculate min_length & max_length strings/ctype-sjis.c: Added new argument to strnncollsp() to allow one to define if end space are significant or not Changed my_like_range... to correctly calculate min_length & max_length strings/ctype-tis620.c: Added new argument to strnncollsp() to allow one to define if end space are significant or not Changed my_like_range... to correctly calculate min_length & max_length strings/ctype-uca.c: Added new argument to strnncollsp() to allow one to define if end space are significant or not strings/ctype-ucs2.c: Changed my_like_range... to correctly calculate min_length & max_length strings/ctype-utf8.c: Added new argument to strnncollsp() to allow one to define if end space are significant or not strings/ctype-win1250ch.c: Changed my_like_range... to correctly calculate min_length & max_length strings/decimal.c: Fixed include files usage Fixed some compiler warnings tests/client_test.c: Ensure tests works with VARCHAR
* | | mergeunknown2004-11-211-5/+5
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.h: Auto merged sql/item_subselect.cc: Auto merged sql/mysql_priv.h: Auto merged sql/opt_sum.cc: Auto merged sql/sp.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_delete.cc: Auto merged sql/sql_help.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_load.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_view.h: Auto merged sql/sql_yacc.yy: Auto merged
| * \ \ mergeunknown2004-11-111-5/+5
| |\ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sql/item_cmpfunc.h: Auto merged sql/item_subselect.cc: Auto merged sql/mysql_priv.h: Auto merged sql/opt_sum.cc: Auto merged sql/sp.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_delete.cc: Auto merged sql/sql_help.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_load.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_view.h: Auto merged sql/sql_yacc.yy: Auto merged
| | * | fixed merged view fields names (BUG#5147)unknown2004-09-141-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | support of merged VIEW over several tables added (WL#1809) mysql-test/r/view.result: merge of VIEW with several tables mysql-test/t/view.test: merge of VIEW with several tables sql/item.cc: renaming Item and restoring item name on cleunup() sql/item.h: renaming Item and restoring item name on cleunup() debug output added sql/item_cmpfunc.h: setup_conds() changed to support two tables lists sql/item_subselect.cc: list of table leaves used instead of local table list for name resolving sql/mysql_priv.h: setup_conds() and setup_tables() changed to support two tables lists sql/opt_sum.cc: list of table leaves used instead of local table list for name resolving sql/sp.cc: setup_tables() changed to support two tables lists sql/sql_base.cc: skip temporary tables in table finding fixed merged view fields names (BUG#5147) sql/sql_delete.cc: setup_conds() and setup_tables() changed to support two tables lists sql/sql_help.cc: setup_tables() changed to support two tables lists sql/sql_insert.cc: setup_tables() changed to support two tables lists name handling support sql/sql_lex.cc: allow view with several tables for MERGE sql/sql_lex.h: new table list sql/sql_load.cc: setup_tables() changed to support two tables lists sql/sql_olap.cc: setup_tables() changed to support two tables lists sql/sql_parse.cc: new list support sql/sql_prepare.cc: new list support sql/sql_select.cc: list of table leaves used instead of local table list for name resolving sql/sql_update.cc: setup_conds() and setup_tables() changed to support two tables lists sql/sql_view.cc: support of MERGED VIEWS with several tables sql/sql_yacc.yy: removed blanks in new code sql/table.cc: fixed setup view code support of merged VIEW over several tables added sql/table.h: fixed merged view fields names (BUG#5147)
* | | | WL#1629: SHOW with WHERE(partially) &unknown2004-11-131-1/+1
|/ / / | | | | | | | | | | | | | | | | | | WL#173: Create Data Dictionary Tables for SHOW Commands
* | | merge with 4.1unknown2004-10-291-10/+6
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BitKeeper/etc/ignore: auto-union BitKeeper/etc/logging_ok: auto-union BitKeeper/triggers/post-commit: Auto merged Docs/Support/texi2html: Auto merged Makefile.am: Auto merged client/Makefile.am: Auto merged client/mysql.cc: Auto merged client/mysqldump.c: Auto merged include/my_base.h: Auto merged include/my_global.h: Auto merged include/my_pthread.h: Auto merged include/my_sys.h: Auto merged include/my_time.h: Auto merged include/mysql.h: Auto merged include/mysql_com.h: Auto merged innobase/buf/buf0buf.c: Auto merged innobase/include/row0mysql.h: Auto merged innobase/row/row0sel.c: Auto merged libmysql/libmysql.c: Auto merged libmysqld/examples/Makefile.am: Auto merged myisam/mi_check.c: Auto merged mysql-test/include/ps_modify.inc: Auto merged mysql-test/install_test_db.sh: Auto merged mysql-test/r/alter_table.result: Auto merged mysql-test/r/auto_increment.result: Auto merged mysql-test/r/bdb.result: Auto merged mysql-test/r/ctype_latin1_de.result: Auto merged mysql-test/r/ctype_recoding.result: Auto merged mysql-test/r/fulltext.result: Auto merged mysql-test/r/func_gconcat.result: Auto merged mysql-test/r/func_group.result: Auto merged mysql-test/r/func_if.result: Auto merged mysql-test/t/derived.test: Auto merged mysql-test/t/insert.test: merge with 4.1 Fixed test case to not use 'if exists' when it shouldn't mysql-test/t/range.test: merge with 4.1 Added missing drop table sql/ha_ndbcluster.cc: merge with 4.1 Simple optimization: use max() instead of ? : sql/item_func.cc: merge with 4.1 (Added back old variable names for easier merges) sql/opt_range.cc: merge with 4.1 Removed argument 'parent_alloc' from QUICK_RANGE_SELECT as this was not used Added assert if using QUICK_GROUP_MIN_MAX_SELECT with parent_alloc as the init() function can't handle this Changed back get_quick_select_for_ref() to use it's own alloc root becasue this function may be called several times for one query sql/sql_handler.cc: merge with 4.1 change variable 'err' to 'error' as same function had a label named 'err' sql/sql_update.cc: Use multi-update code from 5.0 instead of 4.1 We will fix the locking code shortly in 5.0 to be faster than in 4.1
| * | opt_sum.cc:unknown2004-09-151-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | Slightly improved the fix for bug #5406. sql/opt_sum.cc: Slightly improved the fix for bug #5406.
| * | func_group.test, func_group.result:unknown2004-09-071-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added test case for bug #5406. opt_sum.cc: Fixed bug #5406. sql/opt_sum.cc: Fixed bug #5406. mysql-test/r/func_group.result: Added test case for bug #5406. mysql-test/t/func_group.test: Added test case for bug #5406.
* | | Merge for post-merge fixes for Item_equal patch.unknown2004-10-191-0/+15
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BitKeeper/etc/ignore: auto-union mysql-test/r/range.result: Auto merged mysql-test/r/select.result: Auto merged mysql-test/t/range.test: Auto merged sql/item.cc: Auto merged sql/opt_range.cc: Auto merged sql/opt_sum.cc: Auto merged sql/sql_select.h: Auto merged sql/item.h: Manual merge sql/sql_select.cc: Manual merge
| * \ \ Merge for Item_equal.unknown2004-10-091-0/+15
| |\ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BitKeeper/etc/ignore: auto-union mysql-test/r/bdb.result: Auto merged mysql-test/r/func_group.result: Auto merged mysql-test/r/innodb.result: Auto merged mysql-test/r/heap_btree.result: Auto merged mysql-test/r/select.result: Auto merged mysql-test/r/user_var.result: Auto merged mysql-test/t/range.test: Auto merged sql/item_func.cc: Auto merged sql/item_func.h: Auto merged sql/item_row.cc: Auto merged sql/item_strfunc.h: Auto merged sql/opt_sum.cc: Auto merged sql/sql_list.h: Auto merged mysql-test/r/func_test.result: Post-automerge resolution of conflicts mysql-test/r/index_merge.result: Post-automerge resolution of conflicts mysql-test/r/join_outer.result: Post-automerge resolution of conflicts mysql-test/r/range.result: Post-automerge resolution of conflicts mysql-test/r/subselect.result: Post-automerge resolution of conflicts sql/item.cc: Post-automerge resolution of conflicts sql/item.h: Post-automerge resolution of conflicts sql/item_cmpfunc.cc: Post-automerge resolution of conflicts sql/item_cmpfunc.h: Post-automerge resolution of conflicts sql/opt_range.cc: Post-automerge resolution of conflicts sql/sql_select.cc: Post-automerge resolution of conflicts sql/sql_select.h: Post-automerge resolution of conflicts
| | * | Mergeunknown2003-12-011-1/+0
| | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysql-test/t/range.test: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_cmpfunc.h: Auto merged sql/item_func.cc: Auto merged sql/opt_range.cc: Auto merged sql/opt_sum.cc: Auto merged sql/sql_list.h: Auto merged sql/sql_select.h: Auto merged
| | * | | This ChangeSet Introdices Item_equal.unknown2003-11-261-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The objects of this class represent multiple conjunctive equalities in where conditions: =(f1,f2,...fn) <=> f1=f2 and f2= ... and =fn. The objects are used to generate new possibale paths to access the tables when executing a query. They are also used to optimize the execution plan chosen by the optimizer for the query. sql/item.cc: Introduced Item_equal sql/item.h: Introduced Item_equal. Added traverse method. sql/item_cmpfunc.cc: Introduced Item_equal. Added traverse mehtod. sql/item_cmpfunc.h: Itroduced Item_equal and Item_equal_iterator. sql/item_func.cc: Added traverse method. Introduced Item_equal. sql/item_func.h: Introduced Item_equal. Added traverse method. sql/item_row.cc: Added traverse method. sql/item_row.h: Added traverse method. sql/item_strfunc.h: Added traverse method. sql/opt_range.cc: Used Item_equal in range analysis. sql/opt_sum.cc: Introduced Item_equal. sql/sql_list.h: Added concat and disjoin methods to lists. Fixed remove method for lists. sql/sql_select.cc: Introdiced Item_equal: created Item_equal; used Item_equal objects to generate new paths to access tables. used Item_equal objects to optimize the execution plan chosen by optimizer. sql/sql_select.h: Introduced Item_equal.
* | | | | WL#1724 "Min/Max Optimization for Queries with Group By Clause"unknown2004-08-271-1/+1
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - after-review changes - merged with the source tree from 204-08-27 mysql-test/r/distinct.result: Different plans due to group-by optimization. sql/ha_myisam.cc: More general interface to key_copy. sql/handler.cc: More general interface to key_copy. sql/item.cc: New method to collect all Item_field objects. Used by Item::walk. sql/item.h: Several methods to collect different kinds of items from expression trees. Used by Item::walk. sql/item_sum.cc: Added helper to collect Item_sum objects. sql/item_sum.h: Methods to collect and test Item_sum objects. sql/key.cc: More general interface to key_copy and key_restore. sql/mysql_priv.h: More general interface to key_copy and key_restore. sql/opt_range.cc: Complete implementaion of WL#1724 "Min/Max Optimization for Queries with Group By Clause". sql/opt_range.h: Complete implementaion of WL#1724 "Min/Max Optimization for Queries with Group By Clause". sql/opt_sum.cc: simple_pred is re-used in opt_range.cc sql/sql_acl.cc: More general interface to key_copy and key_restore. sql/sql_handler.cc: More general interface to key_copy. sql/sql_insert.cc: More general interface to key_copy. sql/sql_select.cc: Changes to hook the new QUICK_GROUP_MIN_MAX_SELECT due to two differences from all other quick selects: 1) This quick select may be created (and used) even if there is no WHERE clause. Several places assumed that a QUICK_SELECT is constructed only if there is a WHERE clause, which had to be changed so that QUICK_GROUP_MIN_MAX can be used. 2) Unlike all other quick selects, this QUICK_GROUP_MIN_MAX_SELECT operates for GROUP BY queries. Since for the caller the quick select already produces one result tuple per group, there is no need to call end_send_group, instead we have to call end_send as for a regular quick select. sql/sql_select.h: simple_pred is re-used in opt_range.cc
* | | | VIEWunknown2004-07-161-2/+2
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | two TABLE_LIST copy eliminated include/mysqld_error.h: errors of view libmysqld/Makefile.am: new view file mysql-test/r/connect.result: SHOW TABLE show type of table mysql-test/r/ctype_recoding.result: SHOW TABLE show type of table mysql-test/r/drop.result: SHOW TABLE show type of table mysql-test/r/grant.result: new two privileges (CRETEA|SHOW VIEW) mysql-test/r/lowercase_table.result: SHOW TABLE show type of table mysql-test/r/ps_1general.result: SHOW TABLE show type of table mysql-test/r/rename.result: SHOW TABLE show type of table mysql-test/r/rpl000009.result: SHOW TABLE show type of table mysql-test/r/rpl_error_ignored_table.result: SHOW TABLE show type of table mysql-test/r/select.result: SHOW TABLE show type of table mysql-test/r/system_mysql_db.result: SHOW TABLE show type of table new two privileges (CRETEA|SHOW VIEW) mysql-test/t/system_mysql_db_fix.test: removing all system tables scripts/mysql_fix_privilege_tables.sql: new two privileges (CRETEA|SHOW VIEW) sql/Makefile.am: new VIEW related file sql/ha_myisammrg.cc: two TABLE_LIST copy eliminated sql/item.cc: VIEW sql/item.h: VIEW sql/item_subselect.cc: VIEW sql/item_subselect.h: VIEW sql/lex.h: VIEW sql/lock.cc: VIEW sql/mysql_priv.h: VIEW sql/mysqld.cc: VIEW new parameter - sql_updatable_view_key sql/opt_sum.cc: two TABLE_LIST copy eliminated sql/set_var.cc: new parameter - sql_updatable_view_key sql/share/czech/errmsg.txt: errors messages of views sql/share/danish/errmsg.txt: errors messages of views sql/share/dutch/errmsg.txt: errors messages of views sql/share/english/errmsg.txt: errors messages of views sql/share/estonian/errmsg.txt: errors messages of views sql/share/french/errmsg.txt: errors messages of views sql/share/german/errmsg.txt: errors messages of views sql/share/greek/errmsg.txt: errors messages of views sql/share/hungarian/errmsg.txt: errors messages of views sql/share/italian/errmsg.txt: errors messages of views sql/share/japanese/errmsg.txt: errors messages of views sql/share/korean/errmsg.txt: errors messages of views sql/share/norwegian-ny/errmsg.txt: errors messages of views sql/share/norwegian/errmsg.txt: errors messages of views sql/share/polish/errmsg.txt: errors messages of views sql/share/portuguese/errmsg.txt: errors messages of views sql/share/romanian/errmsg.txt: errors messages of views sql/share/russian/errmsg.txt: errors messages of views sql/share/serbian/errmsg.txt: errors messages of views sql/share/slovak/errmsg.txt: errors messages of views sql/share/spanish/errmsg.txt: errors messages of views sql/share/swedish/errmsg.txt: errors messages of views sql/share/ukrainian/errmsg.txt: errors messages of views sql/slave.cc: two TABLE_LIST copy eliminated sql/sp.cc: VIEW sql/sql_acl.cc: VIEW sql/sql_acl.h: VIEW sql/sql_base.cc: VIEW sql/sql_cache.cc: two TABLE_LIST copy eliminated sql/sql_class.h: VIEW sql/sql_db.cc: two TABLE_LIST copy eliminated sql/sql_delete.cc: VIEW sql/sql_derived.cc: VIEW sql/sql_handler.cc: two TABLE_LIST copy eliminated sql/sql_help.cc: two TABLE_LIST copy eliminated sql/sql_insert.cc: VIEW sql/sql_lex.cc: VIEW sql/sql_lex.h: VIEW sql/sql_load.cc: VIEW sql/sql_olap.cc: VIEW sql/sql_parse.cc: two TABLE_LIST copy eliminated VIEW sql/sql_prepare.cc: VIEW sql/sql_rename.cc: two TABLE_LIST copy eliminated sql/sql_select.cc: VIEW sql/sql_show.cc: VIEW sql/sql_table.cc: VIEW sql/sql_union.cc: VIEW sql/sql_update.cc: VIEW sql/sql_yacc.yy: VIEW sql/table.cc: VIEW sql/table.h: VIEW sql/tztime.cc: two TABLE_LIST copy eliminated sql/unireg.h: VIEW tests/client_test.c: VIEW