Commit graph

338 commits

Author SHA1 Message Date
unknown
306ebf7b1c Fixes during review of new code
- Mostly indentation fixes
- Added missing test
- Ensure that Item_func_case() checks for stack overruns
- Use real_item() instead of (Item_ref*) item
- Fixed wrong error handling


myisam/mi_unique.c:
  Improved comments
myisam/myisampack.c:
  Updated version number
mysql-test/r/group_by.result:
  Added test that was lost during earlier merge
mysql-test/r/information_schema.result:
  Safety fix: Drop procedures before used
mysql-test/t/group_by.test:
  Added test that was lost during earlier merge
mysql-test/t/information_schema.test:
  Safety fix: Drop procedures before used
mysys/hash.c:
  Updated comment
sql/field.cc:
  false -> FALSE
sql/ha_ndbcluster.cc:
  Fix some style issues
  - No () around argument to 'case'
  - Space before ( in switch and if
  - Removed 'goto'
  - Added {}
  - Added () to make expressions easier to read
  - my_snprintf -> strmov
sql/handler.cc:
  if( -> if (
sql/item.cc:
  Indentation changes
sql/item.h:
  false -> FALSE
sql/item_cmpfunc.cc:
  Ensure that Item_func_case() check for stack overrun properly
sql/item_cmpfunc.h:
  Ensure that Item_func_case() check for stack overrun properly
sql/item_func.cc:
  Indentation fixes
  Fixed wrong goto label
sql/mysqld.cc:
  Remove test for opt_disable_networking as this flag can never be set here
sql/opt_range.cc:
  Simplify code
sql/sql_class.h:
  Move define out from middle of class definition
sql/sql_parse.cc:
  Remove extra empty lines
sql/sql_select.cc:
  use real_item() instead of (Item_ref*) item
  Modifed function comment to be align with others
  Simple optimization
sql/sql_union.cc:
  Portability fix:
  Don't use 'bool_variable|=...'
sql/sql_view.cc:
  Move List_iterator_fast out from loops (rewind is faster than creating a new itearator)
strings/ctype-utf8.c:
  if( -> if (
strings/ctype.c:
  Remove disabled code
strings/decimal.c:
  Indentation fixes
strings/xml.c:
  Indentation fixes
2005-07-04 03:42:33 +03:00
unknown
1aa6343fe8 Simple optimization
nsure that delete works not only on table->record[0] for federated tables


sql/field.cc:
  Test OOM condition
sql/ha_federated.cc:
  Simple optimizations
  Ensure that delete works not only on table->record[0]
sql/opt_range.cc:
  Simplify code
2005-06-29 12:44:40 +03:00
unknown
3bfb668fac Merge mysql.com:/home/timka/mysql/src/5.0-virgin
into mysql.com:/home/timka/mysql/src/5.0-dbg


sql/opt_range.cc:
  Auto merged
2005-06-23 17:23:48 +03:00
unknown
dfaf7a0184 opt_range.cc:
Identation correction.


sql/opt_range.cc:
  Identation correction.
2005-06-23 04:10:43 -07:00
unknown
dadda87f54 Merge rurik.mysql.com:/home/igor/mysql-5.0
into rurik.mysql.com:/home/igor/dev/mysql-5.0-0


sql/opt_range.cc:
  Auto merged
2005-06-23 04:10:42 -07:00
unknown
a91620aeff Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/psergey/mysql-5.0-back-vac-look


sql/opt_range.cc:
  Auto merged
2005-06-23 11:10:41 +00:00
unknown
1a8c334b30 Fix for BUG#11185.
The source of the problem is in Field_longlong::cmp. If 'this' is
  an unsigned number, the method casts both the current value, and
  the constant that we compare with to an unsigned number. As a
  result if the constant we compare with is a negative number, it
  wraps to some unsigned number, and the comparison is incorrect.
  
  When the optimizer chooses the "range" access method, this problem
  causes handler::read_range_next to reject the current key when the
  upper bound key is a negative number because handler::compare_key
  incorrectly considers the positive and negative keys to be equal.
  
  The current patch does not correct the source of the problem in
  Field_longlong::cmp because it is not easy to propagate sign
  information about the constant at query execution time. Instead
  the patch changes the range optimizer so that it never compares
  unsiged fields with negative constants. As an added benefit,
  queries that do such comparisons will execute faster because
  the range optimizer replaces conditions like:
  (a) (unsigned_int [< | <=] negative_constant) == FALSE
  (b) (unsigned_int [> | >=] negative_constant) == TRUE
  with the corresponding constants.
  In some cases this may even result in constant time execution.


mysql-test/r/range.result:
  - Added test for BUG#11185
  - Added missing test from 4.1. This test also tests the fix for BUG#11185.
mysql-test/t/range.test:
  - Added test for BUG#11185
  - Added missing test from 4.1. This test also tests the fix for BUG#11185.
sql/opt_range.cc:
  Added a new optimization to the range optimizer where we detect that
  an UNSIGNED field is compared with a negative constant. Depending on
  the comparison operator, we know directly that the result of the
  comparison is either TRUE or FALSE for all input values, and we need
  not check each value.
      
  This optimization is also necessary so that the index range access
  method produces correct results when comparing unsigned fields with
  negative constants.
2005-06-23 12:08:56 +03:00
unknown
c4a8325da2 opt_range.cc:
Fixed buf #11487.
  Added a call of  QUICK_RANGE_SELECT::init to the
  QUICK_RANGE_SELECT::reset method. Without it the second
  evaluation of a subquery employing the range access failed.
subselect.result, subselect.test:
  Added a test case for bug #11487.


mysql-test/t/subselect.test:
  Added a test case for bug #11487.
mysql-test/r/subselect.result:
  Added a test case for bug #11487.
sql/opt_range.cc:
  Fixed buf #11487.
  Added a call of  QUICK_RANGE_SELECT::init to the
  QUICK_RANGE_SELECT::reset method. Without it the second
  evaluation of a subquery employing the range access failed.
2005-06-23 02:08:30 -07:00
unknown
e4296f5868 Fix for BUG#11185.
The source of the problem is in Field_longlong::cmp. If 'this' is
an unsigned number, the method casts both the current value, and
the constant that we compare with to an unsigned number. As a
result if the constant we compare with is a negative number, it
wraps to some unsigned number, and the comparison is incorrect.

When the optimizer chooses the "range" access method, this problem
causes handler::read_range_next to reject the current key when the
upper bound key is a negative number because handler::compare_key
incorrectly considers the positive and negative keys to be equal.

The current patch does not correct the source of the problem in
Field_longlong::cmp because it is not easy to propagate sign
information about the constant at query execution time. Instead
the patch changes the range optimizer so that it never compares
unsiged fields with negative constants. As an added benefit,
queries that do such comparisons will execute faster because
the range optimizer replaces conditions like:
(a) (unsigned_int [< | <=] negative_constant) == FALSE
(b) (unsigned_int [> | >=] negative_constant) == TRUE
with the corresponding constants.
In some cases this may even result in constant time execution.


mysql-test/r/range.result:
  - Changed incorrect result of an old test
  - Added new results for BUG#11185
mysql-test/t/range.test:
  - Added new tests for BUG#11185
  - Deleted an old comment because now the problem is fixed
sql/opt_range.cc:
  Added a new optimization to the range optimizer where we detect that
  an UNSIGNED field is compared with a negative constant. Depending on
  the comparison operator, we know directly that the result of the
  comparison is either TRUE or FALSE for all input values, and we need
  not check each value.
  
  This optimization is also necessary so that the index range access
  method produces correct results when comparing unsigned fields with
  negative constants.
2005-06-23 10:56:44 +03:00
unknown
80a621321b WL#2286 - Compile MySQL w/YASSL support
Fix GCC 4.0 link failure.
Better CXX_VERSION guessing.


config/ac-macros/misc.m4:
  Better CXX_VERSION guessing.
configure.in:
  CXX_VERSION guessing moved to misc.m4.
  HAVE_EXPLICIT_TEMPLATE_INSTANTIATION moved to config.h.
  Use compiler AR with MIPSpro and Forte instead of instantiating templates explicitly.
extra/yassl/src/crypto_wrapper.cpp:
  EXPLICIT_TEMPLATE_INSTANTIATION renamed to HAVE_EXPLICIT_TEMPLAE_INSTANTIATION.
extra/yassl/src/template_instnt.cpp:
  EXPLICIT_TEMPLATE_INSTANTIATION renamed to HAVE_EXPLICIT_TEMPLAE_INSTANTIATION.
extra/yassl/src/yassl_int.cpp:
  GCC 4.0 link fix. This file needs __cxa_pure_virtual.
extra/yassl/taocrypt/include/runtime.hpp:
  Fix GCC 4.0 link failure. Instruct compiler to always emit __cxa_pure_virtual even if
  it seems to be never used.
extra/yassl/taocrypt/include/types.hpp:
  Include config.h.
extra/yassl/taocrypt/src/algebra.cpp:
  EXPLICIT_TEMPLATE_INSTANTIATION renamed to HAVE_EXPLICIT_TEMPLAE_INSTANTIATION.
extra/yassl/taocrypt/src/dh.cpp:
  GCC 4.0 link fix. This file needs __cxa_pure_virtual.
extra/yassl/taocrypt/src/dsa.cpp:
  GCC 4.0 link fix. This file needs __cxa_pure_virtual.
extra/yassl/taocrypt/src/integer.cpp:
  EXPLICIT_TEMPLATE_INSTANTIATION renamed to HAVE_EXPLICIT_TEMPLAE_INSTANTIATION.
extra/yassl/taocrypt/src/rsa.cpp:
  GCC 4.0 link fix. This file needs __cxa_pure_virtual.
extra/yassl/taocrypt/src/template_instnt.cpp:
  EXPLICIT_TEMPLATE_INSTANTIATION renamed to HAVE_EXPLICIT_TEMPLAE_INSTANTIATION.
sql/field.cc:
  EXPLICIT_TEMPLATE_INSTANTIATION renamed to HAVE_EXPLICIT_TEMPLAE_INSTANTIATION.
sql/item.cc:
  EXPLICIT_TEMPLATE_INSTANTIATION renamed to HAVE_EXPLICIT_TEMPLAE_INSTANTIATION.
sql/item_buff.cc:
  EXPLICIT_TEMPLATE_INSTANTIATION renamed to HAVE_EXPLICIT_TEMPLAE_INSTANTIATION.
sql/mysqld.cc:
  EXPLICIT_TEMPLATE_INSTANTIATION renamed to HAVE_EXPLICIT_TEMPLAE_INSTANTIATION.
sql/opt_range.cc:
  EXPLICIT_TEMPLATE_INSTANTIATION renamed to HAVE_EXPLICIT_TEMPLAE_INSTANTIATION.
sql/set_var.cc:
  EXPLICIT_TEMPLATE_INSTANTIATION renamed to HAVE_EXPLICIT_TEMPLAE_INSTANTIATION.
sql/slave.cc:
  EXPLICIT_TEMPLATE_INSTANTIATION renamed to HAVE_EXPLICIT_TEMPLAE_INSTANTIATION.
sql/sql_acl.cc:
  EXPLICIT_TEMPLATE_INSTANTIATION renamed to HAVE_EXPLICIT_TEMPLAE_INSTANTIATION.
sql/sql_class.cc:
  EXPLICIT_TEMPLATE_INSTANTIATION renamed to HAVE_EXPLICIT_TEMPLAE_INSTANTIATION.
sql/sql_insert.cc:
  EXPLICIT_TEMPLATE_INSTANTIATION renamed to HAVE_EXPLICIT_TEMPLAE_INSTANTIATION.
sql/sql_map.cc:
  EXPLICIT_TEMPLATE_INSTANTIATION renamed to HAVE_EXPLICIT_TEMPLAE_INSTANTIATION.
sql/sql_select.cc:
  EXPLICIT_TEMPLATE_INSTANTIATION renamed to HAVE_EXPLICIT_TEMPLAE_INSTANTIATION.
sql/sql_show.cc:
  EXPLICIT_TEMPLATE_INSTANTIATION renamed to HAVE_EXPLICIT_TEMPLAE_INSTANTIATION.
sql/table.cc:
  EXPLICIT_TEMPLATE_INSTANTIATION renamed to HAVE_EXPLICIT_TEMPLAE_INSTANTIATION.
2005-06-22 14:08:28 +05:00
unknown
b603e47d90 Fix for BUG#8441: in index_merge code when creating index search tuples use
KEY_PART_INFO::store_length, not KEY_PART_INFO::length (like range code does)


mysql-test/r/index_merge_innodb.result:
  Testcase for BUG8441
mysql-test/t/index_merge_innodb.test:
  Testcase for BUG8441
2005-06-20 08:56:37 +00:00
unknown
2c8ee686d8 WL#2286 - Compile MySQL w/YASSL support
Fix for yaSSL link failures with Forte Developer 7, MIPSpro Compilers, Compaq C++.
These compilers have problem with implicit template instantiation in archives
(libyassl.a, libtaocrypt.a). Instantiate templates explicitly.

Fix for yaSSL link failure on powermacg5 (gcc 3.3). When -O3 is specified gcc inlines
__cxa_pure_virtual. This is wrong behavior, __cxa_pure_virtual must never be inlined.


configure.in:
  Better CXX_VERSION guessing.
  EXPLICIT_TEMPLATE_INSTANTIATION macro indicates whether to instantiate templates explicitly.
  Instantiate templates explicitly on MIPSpro, Compaq, Forte.
extra/yassl/src/crypto_wrapper.cpp:
  Replace __GNUC__ by EXPLICIT_TEMPLATE_INSTANTIATION.
extra/yassl/src/template_instnt.cpp:
  Replace __GNUC__ by EXPLICIT_TEMPLATE_INSTANTIATION.
  More portable templates instantiation.
extra/yassl/src/yassl_int.cpp:
  Replace __GNUC__ by EXPLICIT_TEMPLATE_INSTANTIATION.
  More portable templates instantiation.
extra/yassl/taocrypt/include/runtime.hpp:
  Fix for link failure on powermacg5 (gcc 3.3). __cxa_pure_virtual must never be inlined.
extra/yassl/taocrypt/src/algebra.cpp:
  Replace __GNUC__ by EXPLICIT_TEMPLATE_INSTANTIATION.
extra/yassl/taocrypt/src/integer.cpp:
  Replace __GNUC__ by EXPLICIT_TEMPLATE_INSTANTIATION.
extra/yassl/taocrypt/src/template_instnt.cpp:
  Replace __GNUC__ by EXPLICIT_TEMPLATE_INSTANTIATION.
sql/field.cc:
  Replace __GNUC__ by EXPLICIT_TEMPLATE_INSTANTIATION.
sql/item.cc:
  Replace __GNUC__ by EXPLICIT_TEMPLATE_INSTANTIATION.
sql/item_buff.cc:
  Replace __GNUC__ by EXPLICIT_TEMPLATE_INSTANTIATION.
sql/mysqld.cc:
  Replace __GNUC__ by EXPLICIT_TEMPLATE_INSTANTIATION.
sql/opt_range.cc:
  Replace __GNUC__ by EXPLICIT_TEMPLATE_INSTANTIATION.
sql/set_var.cc:
  Replace __GNUC__ by EXPLICIT_TEMPLATE_INSTANTIATION.
sql/slave.cc:
  Replace __GNUC__ by EXPLICIT_TEMPLATE_INSTANTIATION.
sql/sql_acl.cc:
  Replace __GNUC__ by EXPLICIT_TEMPLATE_INSTANTIATION.
sql/sql_class.cc:
  Replace __GNUC__ by EXPLICIT_TEMPLATE_INSTANTIATION.
sql/sql_insert.cc:
  Replace __GNUC__ by EXPLICIT_TEMPLATE_INSTANTIATION.
sql/sql_map.cc:
  Replace __GNUC__ by EXPLICIT_TEMPLATE_INSTANTIATION.
sql/sql_select.cc:
  Replace __GNUC__ by EXPLICIT_TEMPLATE_INSTANTIATION.
sql/sql_show.cc:
  Replace __GNUC__ by EXPLICIT_TEMPLATE_INSTANTIATION.
sql/table.cc:
  Replace __GNUC__ by EXPLICIT_TEMPLATE_INSTANTIATION.
2005-06-19 21:46:44 +05:00
unknown
d87c2dd6bf Fix for BUG#11044 - "SELECT DISTINCT on indexed column returns inconsistent results"
The problem was that when there was no MIN or MAX function, after finding the
group prefix based on the DISTINCT or GROUP BY attributes we did not search further
for a key in the group that satisfies the equi-join conditions on attributes that
follow the group attributes. Thus we ended up with the wrong rows, and subsequent
calls to select_cond->val_int() in evaluate_join_record() were filtering those
rows. Hence - the query result set was empty.

The problem occured both for GROUP BY queries without MIN/MAX and for queries
with DISTINCT (which were internally executed as GROUP BY queries).


mysql-test/r/group_min_max.result:
  Added test result for BUG#11044. Notice that the group by query is
  equivalent to the distinct query and both are executed via the same
  algorithm.
mysql-test/t/group_min_max.test:
  Added test for BUG#11044. Notice that the group by query is
  equivalent to the distinct query and both are executed via the
  same algorithm.
sql/opt_range.cc:
  * Use the extended prefix in QUICK_GROUP_MIN_MAX_SELECT::get_next()
    to find keys that satisfy equality conditions in the case when there is
    no MIN or MAX function.
  * Corrected some method comments.
  * Corrected debug printout of cost information.
2005-06-14 12:52:44 +03:00
unknown
bd47a7df59 Merge with 4.1
BitKeeper/etc/logging_ok:
  auto-union
client/sql_string.cc:
  Auto merged
configure.in:
  Auto merged
include/my_global.h:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/create.result:
  Auto merged
mysql-test/r/olap.result:
  Auto merged
mysql-test/r/warnings.result:
  Auto merged
mysql-test/t/create.test:
  Auto merged
mysql-test/t/warnings.test:
  Auto merged
mysys/raid.cc:
  Auto merged
scripts/make_binary_distribution.sh:
  Auto merged
sql/field.cc:
  Auto merged
BitKeeper/deleted/.del-ha_isam.cc~4dce65904db2675e:
  Auto merged
BitKeeper/deleted/.del-ha_isammrg.cc~dc682e4755d77a2e:
  Auto merged
sql/ha_berkeley.cc:
  Auto merged
sql/ha_blackhole.cc:
  Auto merged
sql/ha_heap.cc:
  Auto merged
sql/ha_innodb.cc:
  Auto merged
sql/ha_myisam.cc:
  Auto merged
sql/ha_myisammrg.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_geofunc.cc:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/item_uniq.cc:
  Auto merged
sql/lock.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/opt_range.h:
  Auto merged
sql/procedure.cc:
  Auto merged
sql/protocol.cc:
  Auto merged
sql/protocol_cursor.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_analyse.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_error.cc:
  Auto merged
sql/sql_handler.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_map.cc:
  Auto merged
sql/sql_olap.cc:
  Auto merged
sql/sql_repl.cc:
  Auto merged
sql/sql_string.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_udf.cc:
  Auto merged
sql/examples/ha_archive.cc:
  Auto merged
sql/examples/ha_example.cc:
  Auto merged
sql/examples/ha_tina.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/tztime.cc:
  Auto merged
strings/ctype-win1250ch.c:
  Auto merged
mysql-test/r/func_gconcat.result:
  merge & ensure that 4.1 and 5.0 source have tests in same order
mysql-test/r/innodb.result:
  merge & ensure that 4.1 and 5.0 source have tests in same order
mysql-test/t/func_gconcat.test:
  merge & ensure that 4.1 and 5.0 source have tests in same order
mysql-test/t/innodb.test:
  merge & ensure that 4.1 and 5.0 source have tests in same order
sql/item_func.cc:
  merge
sql/mysqld.cc:
  merge
sql/opt_range.cc:
  merge
sql/sql_parse.cc:
  merge
  Give better name to goto labels
sql/sql_select.cc:
  merge
2005-06-07 00:31:53 +03:00
unknown
062a1b8b4e a compiler must see '#pragma implementation' *before*
'#pragma interface' (that comes with the #include'd header file)
2005-06-05 19:38:52 +02:00
unknown
4eb26350cb merge
client/mysql.cc:
  Auto merged
libmysql/libmysql.c:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_bitmap.h:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
2005-06-05 17:19:50 +03:00
unknown
72dd44b9de Move USE_PRAGMA_IMPLEMENTATION to proper place
Ensure that 'null_value' is not accessed before val() is called in FIELD() functions
Fixed initialization of key maps. This fixes some problems with keys when you have more than 64 keys
Fixed that ROLLUP don't always create a temporary table. This fix ensures that func_gconcat.test results are now predictable


mysql-test/r/func_gconcat.result:
  Move innodb specific test to innodb.test
  Changed table name r2 -> t2
  More test to see how ROLLUP was optimized
mysql-test/r/innodb.result:
  Moved test here form func_gconcat
mysql-test/r/olap.result:
  New test results after optimization
mysql-test/t/func_gconcat.test:
  Move innodb specific test to innodb.test
  Changed table name r2 -> t2
  More test to see how ROLLUP was optimized
mysql-test/t/innodb.test:
  Moved test here form func_gconcat
sql/field.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_berkeley.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_blackhole.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_heap.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_innodb.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_isam.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_isammrg.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_myisam.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_myisammrg.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_ndbcluster.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/handler.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/hash_filo.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item_cmpfunc.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item_func.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
  Ensure that 'null_value' is not accessed before val() is called
sql/item_geofunc.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item_strfunc.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item_subselect.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item_sum.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item_timefunc.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item_uniq.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/log_event.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/mysql_priv.h:
  Change key_map_full to not be const as we are giving it a proper value on startup
sql/mysqld.cc:
  Move key_map variables here and initialize key_map_full properly
sql/opt_range.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/opt_range.h:
  Fix that test_quick_select() works with any ammount of keys
sql/procedure.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/protocol.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/protocol_cursor.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/set_var.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_analyse.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_class.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_crypt.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_insert.cc:
  Fixed that max_rows is ulong
sql/sql_list.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_map.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_olap.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_select.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
  Fixed that ROLLUP don't have to always create a temporary table
  Added new argument to remove_const() to make above possible
  Fixed some errors that creapt up when we don't always do a temporary table for ROLLUP
sql/sql_string.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_table.cc:
  Simple optimizations
  Fixed wrong checking of build_table_path() in undef-ed code
sql/sql_udf.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_yacc.yy:
  removed extra {}
2005-06-03 23:46:03 +03:00
unknown
bda8d58d8e Merge
BitKeeper/deleted/.del-ha_isam.cc~4dce65904db2675e:
  Auto merged
BitKeeper/deleted/.del-ha_isammrg.cc~dc682e4755d77a2e:
  Auto merged
client/sql_string.cc:
  Auto merged
mysys/raid.cc:
  Auto merged
sql/field.cc:
  Auto merged
sql/ha_berkeley.cc:
  Auto merged
sql/ha_blackhole.cc:
  Auto merged
sql/ha_heap.cc:
  Auto merged
sql/ha_innodb.cc:
  Auto merged
sql/ha_myisam.cc:
  Auto merged
sql/ha_myisammrg.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_geofunc.cc:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/item_uniq.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/procedure.cc:
  Auto merged
sql/protocol.cc:
  Auto merged
sql/protocol_cursor.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_analyse.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_map.cc:
  Auto merged
sql/sql_olap.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_string.cc:
  Auto merged
sql/examples/ha_archive.cc:
  Auto merged
sql/sql_udf.cc:
  Auto merged
sql/tztime.cc:
  Auto merged
sql/examples/ha_example.cc:
  Auto merged
sql/examples/ha_tina.cc:
  Auto merged
2005-06-02 04:45:09 +02:00
unknown
cee10f979e tztime.cc:
Set #pragma implementation" earlier
Many files:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION


client/sql_string.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
mysys/raid.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/field.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/ha_berkeley.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/ha_blackhole.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/ha_heap.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/ha_innodb.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/ha_isam.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/ha_isammrg.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/ha_myisam.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/ha_myisammrg.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/ha_ndbcluster.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/handler.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/hash_filo.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/item.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/item_cmpfunc.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/item_func.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/item_geofunc.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/item_strfunc.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/item_subselect.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/item_sum.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/item_timefunc.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/item_uniq.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/log_event.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/opt_range.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/procedure.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/protocol.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/protocol_cursor.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/set_var.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/sql_analyse.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/sql_class.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/sql_crypt.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/sql_list.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/sql_map.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/sql_olap.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/examples/ha_archive.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/sql_select.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/sql_string.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/sql_udf.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/examples/ha_example.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/examples/ha_tina.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/tztime.cc:
  Set #pragma implementation" earlier
2005-06-02 02:43:32 +02:00
unknown
906b210a4a Code cleanups during code reviews
Ensure we get error if INSERT IGNORE ... SELECT fails
Fixed wrong key_part->key_length usage in index_merge


client/mysql.cc:
  Code cleanups & simply optimizations
mysql-test/r/information_schema.result:
  Safety
mysql-test/t/information_schema.test:
  Safety
sql/ha_ndbcluster.cc:
  Code cleanups
sql/item.cc:
  Code cleanups
sql/item_subselect.cc:
  Code cleanups
sql/item_sum.cc:
  Code cleanups
sql/opt_range.cc:
  Made get_index_only_read_time() static (instad of inline) to increase portability (function was not declared before use)
  Simple optimization
  Fixed wrong key_part->key_length usage in index_merge
  Removed not used variable n_used_covered
  Indentation fixes & comment cleanups
sql/parse_file.cc:
  Code cleanups
sql/sql_base.cc:
  Code cleanups
sql/sql_bitmap.h:
  Added missing return
sql/sql_insert.cc:
  Ensure we get error if INSERT IGNORE ... SELECT fails
sql/sql_select.cc:
  Code cleanups
sql/sql_show.cc:
  Safety fix if a LOT of errors are ignored
sql/sql_update.cc:
  Code cleanups
sql/table.cc:
  Code cleanups
sql/table.h:
  Code cleanups
sql/uniques.cc:
  Code cleanups
strings/decimal.c:
  Simple optimization
  Code cleanups
2005-06-01 16:35:09 +03:00
unknown
5013a1d592 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/my/mysql-5.0


sql/item_subselect.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
2005-05-31 12:29:24 +03:00
unknown
e2285c541b Fixed bug in multiple-table-delete where some rows was not deleted
mysql-test/r/delete.result:
  Test case for bug in multiple-table-delete where some rows was not deleted
mysql-test/t/delete.test:
  Test case for bug in multiple-table-delete where some rows was not deleted
sql/item_subselect.cc:
  Code cleanup
sql/opt_range.cc:
  Code cleanup
sql/sql_delete.cc:
  Fixed bug in multiple-table-delete where some rows was not deleted
  This happend when the first table-to-delete-from was not the the table that was scanned.
  Fixed this by only doing 'delete-on-the-fly' for the first table.
  Fixed also some wrong error handling in multi-table-delete
2005-05-30 20:48:40 +03:00
unknown
5cdac99069 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/opt/local/work/mysql-5.0-7306-new


sql/item_subselect.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_olap.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
2005-05-30 20:56:11 +04:00
unknown
78422442df Preparatory (and the most problematic) patch for Bug#7306
"the server side preparedStatement error for LIMIT placeholder",
which moves all uses of LIMIT clause from PREPARE to OPTIMIZE
and later steps.
After-review fixes.


mysql-test/r/group_min_max.result:
  Test results fixed for EXPLAINs when using GROUP_MIN_MAX access plan.
sql/item_subselect.cc:
  Move setting of the internal LIMIT used for IN/ALL/ANY/EXISTS 
  subqueries to one place: Item_exists_subselect::fix_length_and_dec().
  This implies that unit->select_limit_cnt is not set until the item is 
  fixed. This is OK, as now LIMIT values are not used until JOIN::optimize.
sql/mysql_priv.h:
  setup_tables no longer needs a special flag for the case when
  it's called from JOIN::reinit() (we don't need to call setup_tables
  between two executions of a correlated subquery).
sql/opt_range.cc:
  Fix a glitch in GROUP_MIN_MAX access plan: we should use table metadata,
  not field data, to evaluate max_used_key_length, which is then
  used for explain.
sql/sp.cc:
  - setup_tables signature changed.
sql/sql_base.cc:
  - setup_tables no longer needs a special mode for subqueries.
    Unused checks were removed.
sql/sql_delete.cc:
  - setup_tables signature changed
sql/sql_help.cc:
  - setup_tables signature changed
sql/sql_insert.cc:
  - setup_tables signature changed
sql/sql_lex.cc:
  Consolidate setting of internal LIMIT for IN/ALL/ANY/EXISTS subqeries
  in one place, and hence remove it from st_select_lex::test_limit().
sql/sql_lex.h:
  Cleanup signature of st_select_lex_unit::init_prepare_fake_select_lex().
sql/sql_load.cc:
  - setup_tables signature changed
sql/sql_olap.cc:
  - setup_tables signature changed
sql/sql_parse.cc:
  - st_select_lex_unit::set_limit() signature changed
sql/sql_select.cc:
  Move setting of JOIN::select_limit from JOIN::prepare
  to JOIN::optimize. At prepare, limit is unknown yet.
  Remove excessive cleanups from JOIN::reinit which were overwriting
  join->join_tab[i]->table->used_keys. This fixes the bug which was triggered
  by the change in item_subselect.cc.
sql/sql_union.cc:
  Class st_select_lex_unit was changed to avoid calls to 
   st_select_lex_unit::set_limit from places where it may be unknown.
  Now unit->select_limit_cnt is set at ::exec(). 
  st_select_lex_unit::init_prepare_fake_select_lex(): 
   - move out set_limit functionality
   - remove a few lines of dead code.
  st_select_lex_unit::prepare():
    - now we don't call set_limit at the time of prepare, so the value  
      of unit->select_limit_cnt may be unknown here. Use sl->select_limit
      instead.
  st_select_lex_unit::exec():
    - cleanup
    - call set_limit explicitly as it has been moved out of 
     init_prepare_fake_select_lex.
sql/sql_update.cc:
  - setup_tables signature changed
2005-05-30 20:54:37 +04:00
unknown
6e79678dee Merge from 4.1
BitKeeper/deleted/.del-ha_isam.cc~4dce65904db2675e:
  Auto merged
BitKeeper/deleted/.del-ha_isammrg.cc~dc682e4755d77a2e:
  Auto merged
client/sql_string.cc:
  Auto merged
client/sql_string.h:
  Auto merged
include/my_global.h:
  Auto merged
include/my_sys.h:
  Auto merged
mysql-test/mysql-test-run.sh:
  Auto merged
mysys/my_open.c:
  Auto merged
mysys/raid.cc:
  Auto merged
ndb/src/kernel/blocks/dbtux/Dbtux.hpp:
  Auto merged
sql/field.cc:
  Auto merged
sql/ha_berkeley.cc:
  Auto merged
sql/ha_blackhole.cc:
  Auto merged
sql/ha_heap.cc:
  Auto merged
sql/ha_innodb.cc:
  Auto merged
sql/ha_myisam.cc:
  Auto merged
sql/ha_myisammrg.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_geofunc.cc:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/item_uniq.cc:
  Auto merged
sql/item_uniq.h:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/log_event.h:
  Auto merged
sql/procedure.cc:
  Auto merged
sql/protocol.cc:
  Auto merged
sql/protocol_cursor.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_analyse.cc:
  Auto merged
sql/sql_analyse.h:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_map.cc:
  Auto merged
sql/sql_olap.cc:
  Auto merged
sql/sql_string.cc:
  Auto merged
sql/sql_udf.cc:
  Auto merged
sql/tztime.cc:
  Auto merged
sql/opt_range.cc:
  Manual merge
sql/sql_parse.cc:
  Use select_lex pointer instead of lex->select_lex
sql/sql_repl.cc:
  Function moved to log.cc, fix made there instead
sql/sql_class.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
2005-05-26 21:01:55 +02:00
unknown
22944a9563 Add ifdefs to control when "#pragma implementation" should be used
Added some more ifdefs for "#pragma interface"


client/sql_string.cc:
  USE_PRAGMA_IMPLEMENTATION
client/sql_string.h:
  USE_PRAGMA_INTERFACE
include/my_global.h:
  Use pragma implementation for gcc pre version 3
mysys/raid.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/field.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/ha_berkeley.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/ha_blackhole.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/ha_heap.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/ha_innodb.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/ha_isam.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/ha_isammrg.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/ha_myisam.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/ha_myisammrg.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/ha_ndbcluster.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/handler.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/hash_filo.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/item.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/item_cmpfunc.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/item_func.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/item_geofunc.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/item_strfunc.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/item_subselect.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/item_sum.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/item_timefunc.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/item_uniq.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/item_uniq.h:
  USE_PRAGMA_INTERFACE
sql/log_event.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/log_event.h:
  USE_PRAGMA_INTERFACE
sql/opt_range.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/procedure.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/protocol.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/protocol_cursor.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/set_var.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/sql_analyse.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/sql_analyse.h:
  USE_PRAGMA_INTERFACE
sql/sql_class.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/sql_crypt.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/sql_crypt.h:
  USE_PRAGMA_IMPLEMENTATION
sql/sql_list.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/sql_map.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/sql_map.h:
  USE_PRAGMA_INTERFACE
sql/sql_olap.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/sql_select.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/sql_string.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/sql_udf.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/tztime.cc:
  USE_PRAGMA_IMPLEMENTATION
2005-05-26 12:09:14 +02:00
unknown
c6283dbba9 Cleanup's during review
Added ASSERT() to detect wrongly packed fields


sql/field.h:
  Fixed comments to right format
sql/opt_range.cc:
  Merged code
sql/sql_base.cc:
  Fixed indentation
sql/sql_insert.cc:
  Fixed comments to right format
sql/sql_select.cc:
  Simplify code
sql/unireg.cc:
  Simply code for calculating key_buff_length
  Added ASSERT() to detect wrongly packed fields
2005-05-25 18:33:32 +03:00
unknown
d844dab14f opt_range.cc:
Post review corrections for optimization request #10561.


sql/opt_range.cc:
  Post review corrections for optimization request #10561.
2005-05-21 07:02:43 -07:00
unknown
8f7bca3abd range.result, range.test:
Added test cases for optimization request #10561.
opt_range.cc, sql_select.cc:
  Fixed bug #10561: an optimization request to allow
  range analysis for NOT IN and NOT BETWEEN.


sql/sql_select.cc:
  Fixed bug #10561: an optimization request to allow
  range analysis for NOT IN and NOT BETWEEN.
sql/opt_range.cc:
  Fixed bug #10561: an optimization request to allow
  range analysis for NOT IN and NOT BETWEEN.
mysql-test/t/range.test:
  Added test cases for optimization request #10561.
mysql-test/r/range.result:
  Added test cases for optimization request #10561.
2005-05-21 06:11:44 -07:00
unknown
bdf5dbcd9a Cset exclude: matt@mysql.com|ChangeSet|20050519052223|06259
Cset exclude: msvensson@neptunus.(none)|ChangeSet|20050425090838|60886


configure.in:
  Exclude
sql/opt_range.cc:
  Exclude
2005-05-19 23:52:17 +02:00
unknown
217b2c42ed Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into neptunus.(none):/home/msvensson/mysql/bug9626


sql/opt_range.cc:
  Auto merged
2005-05-10 20:35:13 +02:00
unknown
51e862786b Fix for bug #9798: Rollup crash with InnoDB in setup_sum_funcs().
sql/opt_range.cc:
  Fix for bug #9798: Rollup crash with InnoDB in setup_sum_funcs().
  Disable mix/max group by optimization for queries with rollup for now.
  Note: the actual bug was hidden; if this optimization works with rollup
  queries we will have to change some code:
  
  the problem is that we call the join->make_sum_func_list() function against 
  changed thd->mem_root (see SQL_SELECT::test_quick_select()) which creates some
  items for rollup, then we free that mem_root, then we try to reuse (free) those
  items.
2005-05-09 11:43:52 +05:00
unknown
f43c581781 merge
sql/ha_innodb.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/key.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/unireg.cc:
  Auto merged
2005-05-06 13:51:58 +03:00
unknown
ab54e16705 Fixes while reviewing new code
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
2005-05-06 11:39:30 +03:00
unknown
fe40de6f94 Fix for BUG#10244:
Make get_quick_select_for_ref() accept estimated # records as parameter and 
set QUICK_RANGE_SELECT::records, as this value is used to allocate buffers 
in Multi-Range Read. 


sql/opt_range.cc:
  Make get_quick_select_for_ref() accept estimated # records as parameter and 
  set QUICK_RANGE_SELECT::records, as this value is used to allocate buffers 
  in Multi-Range Read.
sql/opt_range.h:
  Added "records" parameter to get_quick_select_for_ref()
sql/sql_select.cc:
  Added "records" parameter to get_quick_select_for_ref()
2005-04-29 01:16:32 +04:00
unknown
09c3e18f24 BUG#10037: A proper fix: Add 0.01 to cost of 'range' scans, don't add 0.01 to cost of the 'index' scan. 2005-04-26 01:56:10 +04:00
unknown
95aaf57ce4 valgrind: initialise variable in QUICK_SELECT_I
sql/opt_range.cc:
  Initialise number of records in QUICK_SELECT_I
2005-04-25 11:08:38 +02:00
unknown
a52359e00c Fix for BUG#10037
* Add 0.01 to cost of 'range'+'using index' scan to avoid optimizer choice races with 
  'index' scan.


mysql-test/r/range.result:
  Update the test result after the changed cost
sql/opt_range.cc:
  Fix for BUG#10037
  * Add 0.01 to cost of 'range'+'using index' scan to avoid optimizer choice races with 
    'index' scan.
  * make QUICK_GROUP_MIN_MAX_SELECT handle the case where the source table is empty.
2005-04-21 01:55:33 +04:00
unknown
b529fed683 BUG#9103 merge to 5.0
sql/sql_select.h:
  Auto merged
2005-04-20 12:09:56 +04:00
unknown
955ec71f78 Fix for BUG#9103:
Don't produce data truncation warnings from within cp_buffer_from_ref(). This function
is only used to make index search tuples and data truncation that occurs here has no
relation with truncated values being saved into tables.


mysql-test/r/update.result:
  Testcase for BUG#9103
mysql-test/t/update.test:
  Testcase for BUG#9103
sql/opt_range.cc:
  cp_buffer_from_ref now has THD* parameter
sql/sql_select.h:
  cp_buffer_from_ref now has THD* parameter
2005-04-18 05:21:44 +04:00
unknown
be9b52bd69 Post-merge fixes
sql/opt_range.cc:
  Auto merged
2005-04-17 02:10:43 +04:00
unknown
6b00231421 Fix for BUG#9348: when computing union of two intervals set lower bound to
minimum of lower bounds of two joined intervals.


mysql-test/r/range.result:
  Testcase for BUG#9348
mysql-test/t/range.test:
  Testcase for BUG#9348
2005-04-17 02:05:09 +04:00
unknown
cd0a50bf34 remove the rest of isam/merge references
fix a race condition in TC_LOG_BINLOG::unlog


include/Makefile.am:
  remove the rest of isam/merge references
include/config-win.h:
  unused and abused macro removed
include/my_pthread.h:
  unused and abused macro removed
include/my_sys.h:
  MY_IGNORE_BADFD flag
include/mysql_embed.h:
  remove the rest of isam/merge references
mysql-test/r/replace.result:
  remove the rest of isam/merge references
mysql-test/t/replace.test:
  remove the rest of isam/merge references
mysql-test/t/xa.test:
  comment
mysys/my_sync.c:
  MY_IGNORE_BADFD flag
sql/handler.cc:
  remove the rest of isam/merge references
sql/log.cc:
  fix a race condition in TC_LOG_BINLOG::unlog
  preparation for binlog group commit
sql/mysql_priv.h:
  remove duplicates
sql/mysqld.cc:
  remove the rest of isam/merge references
sql/opt_range.cc:
  remove the rest of isam/merge references
sql/set_var.cc:
  hide unused variables. simplify sync_binlog code
sql/sql_base.cc:
  remove the rest of isam/merge references
sql/sql_class.h:
  cleanup
2005-04-05 13:17:49 +02:00
unknown
c5b5385c65 removed unnecessary (and incorrect) space trimming/padding in generating ranges
(where e.g. col='aaa  ' was converted to col>='aaa' AND col<='aaa       ')
it was incorrect because ucs2 space is not ' ' (0x20)
it was unnecessary because storage engine pads values with spaces for comparison anyway
2005-03-23 19:31:29 +01:00
unknown
892a6138ff Eliminate warnings noticed by VC7. This includes fixing my_mmap() on
Windows to call CreateFileMapping() with correct arguments, and
propogating the introduction of query_id_t to everywhere query ids are
passed around. (Bug #8826)


libmysql/libmysql.c:
  Make implicit cast explicit
myisam/mi_open.c:
  Make cast of value to smaller data size explicit
myisam/mi_packrec.c:
  Cast file size (my_off_t) to size_t for mmap
mysys/my_mmap.c:
  Fix Windows version of my_mmap() to use the right parameters
  for call to CreateFileMapping()
sql/field.cc:
  Use temporary value of correct type
sql/field.h:
  Use query_id_t for query_id value
sql/ha_berkeley.cc:
  Fix flag check
sql/ha_innodb.h:
  Use query_id_t for query_id value
sql/handler.cc:
  Explain opt_using_transactions calculation, and add cast
sql/handler.h:
  Fix forward declaration of COND
sql/item.cc:
  Fix val_bool() tests of val_int() to avoid implicit cast
sql/item_cmpfunc.cc:
  Fix typo in switch label
sql/item_func.cc:
  Make implicit cast explicit
sql/item_strfunc.cc:
  Now that query_id is a query_id_t, need to cast it to a ulong here
sql/item_subselect.cc:
  Fix test of value
sql/log.cc:
  Cast my_off_t used for file size to size_t for memory allocation
  Also cast my_off_t when using it to calculate the number of pages for TC log
  Cast total_ha_2pc to uchar when saving it
sql/mysql_priv.h:
  Move up query_id definition so it can be used more widely
sql/opt_range.cc:
  Add unused delete operator to prevent compiler warning
sql/set_var.cc:
  Cast value for max_user_connections
sql/sql_cache.cc:
  Remove unused label
sql/sql_class.h:
  Fix query id values to be of type query_id_t
sql/sql_db.cc:
  Move variable only used inside #ifdef within the #ifdef
sql/sql_help.cc:
  Remove unused label
sql/sql_insert.cc:
  Use query_id_t for query id values
sql/sql_lex.h:
  Add unused delete operator to prevent compiler warning
sql/sql_select.cc:
  Remove unused variable
  Make cast of value explicit
sql/sql_select.h:
  Use query_id_t for query id values
sql/sql_table.cc:
  Make comparison to function pointer explicit
sql/sql_update.cc:
  Use query_id_t for query id values
sql/table.h:
  Use query_id_t for query id values
strings/ctype-simple.c:
  Add cast of long value to (char) in expression
strings/ctype-ucs2.c:
  Add cast of long value to (char) in expression
strings/ctype-utf8.c:
  Make cast to smaller size explicit
2005-03-18 16:12:25 -08:00
unknown
284b8b8b63 Cleanup during reviews
Removed some optional arguments
Fixed portability problem in federated tests


client/sql_string.cc:
  update from sql/sql_string.cc
client/sql_string.h:
  update from sql/sql_string.h
mysql-test/r/federated.result:
  Fixed error message
sql/field.cc:
  Cleanup during review
  Remove const in 'const unsigned int'
sql/field.h:
  Remove const in 'const unsigned int'
sql/ha_federated.cc:
  Better error string.  Add missing argument to error (before 'errno' was picked up from stack)
sql/handler.cc:
  Removed compiler warning
sql/item_func.cc:
  Cleanup during review
sql/item_sum.cc:
  Cleanup during review
sql/lock.cc:
  Remove optional arguments
sql/log_event.cc:
  Remove optional arguments
sql/mysql_priv.h:
  Remove optional arguments
  cahnge preapre_create_fields to use pointers instead of references
sql/opt_range.cc:
  Fix arguments so that return value is last
sql/sql_base.cc:
  Remove optional arguments
sql/sql_delete.cc:
  Remove optional arguments
sql/sql_error.cc:
  Remove optional arguments
sql/sql_help.cc:
  Remove optional arguments
sql/sql_parse.cc:
  Remove optional arguments
sql/sql_prepare.cc:
  Remove optional arguments
sql/sql_rename.cc:
  Remove optional arguments
sql/sql_select.cc:
  Remove optional arguments
sql/sql_show.cc:
  Cleanup during review
sql/sql_string.cc:
  Simple optimization
sql/sql_table.cc:
  Remove optional arguments
  Fixed indentation
sql/sql_update.cc:
  Remove optional arguments
sql/sql_yacc.yy:
  Change references to pointers
2005-03-16 16:11:01 +02:00
unknown
7a703d6ace Fix for BUG#8532.
The problem was in that the code that analyses the applicability of the
QUICK_GROUP_MIN_MAX access method for DISTINC queries assumed that there
are no duplicate column references in the DISTINCT clause, and it added
non-exiting key parts for the duplicate column references. 

The solution adds a test to check whether the select list already contained
a field with the same name. If such field was already present, then it was
already decided to use its key part for index access. In this such case we
must skip the duplicate field instead of counting it as a new field.


mysql-test/r/group_min_max.result:
  Added test results for BUG#8532.
mysql-test/t/group_min_max.test:
  Added tests for BUG#8532.
sql/opt_range.cc:
  The problem was in that the code that analyses the applicability of the
  QUICK_GROUP_MIN_MAX access method for DISTINC queries assumed that there
  are no duplicate column references in the DISTINCT clause, and it added
  non-exiting key parts for the duplicate column references. 
  
  The solution adds a test to check whether the select list already contained
  a field with the same name. If such field was already present, then it was
  already decided to use its key part for index access. In this such case we
  must skip the duplicate field instead of counting it as a new field.
2005-02-28 16:20:02 +02:00
unknown
08b3e79e40 Merge with global tree
mysql-test/r/innodb.result:
  Auto merged
mysql-test/t/innodb.test:
  Auto merged
mysql-test/t/rpl_rotate_logs.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/protocol.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_db.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
sql/examples/ha_archive.cc:
  Merge with global tree
  (Use my changes)
sql/sql_parse.cc:
  Remove 'tmp' fix to be able to run tests
2005-02-25 17:12:06 +02:00
unknown
248e449451 Remove compiler warnings and remove not used variables
(Found during build process)


extra/comp_err.c:
  Remove compiler warnings
extra/perror.c:
  Remove compiler warnings
innobase/dict/dict0dict.c:
  Remove compiler warnings
innobase/dict/dict0load.c:
  Remove compiler warnings
innobase/pars/pars0sym.c:
  Remove compiler warnings
innobase/row/row0row.c:
  Remove compiler warnings
innobase/row/row0sel.c:
  Remove compiler warnings
libmysqld/lib_sql.cc:
  Remove not used variables
myisam/mi_key.c:
  Remove compiler warnings
regex/engine.c:
  Added comment
sql/derror.cc:
  Remove not used variables
sql/examples/ha_archive.cc:
  Fixed bug in blob handling
  Removed not used variable
sql/field.cc:
  Remove compiler warnings
  Remove not used variables
sql/filesort.cc:
  Remove compiler warnings
sql/ha_heap.cc:
  Remove not used variable
sql/ha_innodb.cc:
  Remove not used variables
  Remove compiler warnings
sql/handler.cc:
  Remove compiler warnings and remove not used variables
sql/item.cc:
  Remove compiler warnings and remove not used variables
sql/item_subselect.cc:
  Remove compiler warnings
sql/item_sum.cc:
  Remove compiler warnings
sql/item_sum.h:
  Remove compiler warnings and remove not used variables
sql/log.cc:
  Remove compiler warnings and remove not used variables
sql/log_event.cc:
  Remove compiler warnings
sql/mysqld.cc:
  Remove compiler warnings and remove not used variables
sql/opt_range.cc:
  Remove compiler warnings and remove not used variables
sql/slave.cc:
  Remove compiler warnings and remove not used variables
sql/sp_pcontext.cc:
  Remove compiler warnings and remove not used variables
sql/sql_acl.cc:
  Remove compiler warnings and remove not used variables
sql/sql_analyse.cc:
  Remove compiler warnings and remove not used variables
sql/sql_base.cc:
  Remove compiler warnings and remove not used variables
sql/sql_db.cc:
  Remove compiler warnings and remove not used variables
sql/sql_help.cc:
  Remove compiler warnings and remove not used variables
sql/sql_insert.cc:
  Remove compiler warnings and remove not used variables
sql/sql_load.cc:
  Remove compiler warnings and remove not used variables
sql/sql_parse.cc:
  Remove compiler warnings and remove not used variables
sql/sql_prepare.cc:
  Remove compiler warnings and remove not used variables
sql/sql_select.cc:
  Remove compiler warnings and remove not used variables
sql/sql_show.cc:
  Remove compiler warnings and remove not used variables
sql/sql_table.cc:
  Remove compiler warnings
sql/sql_union.cc:
  Remove compiler warnings
sql/sql_update.cc:
  Remove compiler warnings and remove not used variables
sql/sql_yacc.yy:
  Remove compiler warnings and remove not used variables
sql/strfunc.cc:
  Remove compiler warnings and remove not used variables
strings/ctype-ucs2.c:
  Remove compiler warnings
tests/mysql_client_test.c:
  Remove compiler warnings and remove not used variables
tools/mysqlmanager.c:
  Remove compiler warnings and remove not used variables
2005-02-25 16:53:22 +02:00
unknown
7a8a76075a Fix for BUG#8576
This fix addresses a bug of the HPUX C++ compiler, in the way it uses registers.
As result, the last comparison of the variable 'result' failed, and next_prefix()
looped forever.


sql/opt_range.cc:
  - fix for BUG#8576
  - updated function name in DBUG_ENTER
2005-02-23 20:49:47 +02:00