can lead to a wrong result.
All date/time functions has the STRING result type thus their results are
compared as strings. The string date representation allows a user to skip
some of leading zeros. This can lead to wrong comparison result if a date/time
function result is compared to such a string constant.
The idea behind this bug fix is to compare results of date/time functions
and data/time constants as ints, because that date/time representation is
more exact. To achieve this the agg_cmp_type() is changed to take in the
account that a date/time field or an date/time item should be compared
as ints.
This bug fix is partially back ported from 5.0.
The agg_cmp_type() function now accepts THD as one of parameters.
In addition, it now checks if a date/time field/function is present in the
list. If so, it tries to coerce all constants to INT to make date/time
comparison return correct result. The field for the constant coercion is
taken from the Item_field or constructed from the Item_func. In latter case
the constructed field will be freed after conversion of all constant items.
Otherwise the result is same as before - aggregated with help of the
item_cmp_type() function.
From the Item_func_between::fix_length_and_dec() function removed the part
which was converting date/time constants to int if possible. Now this is
done by the agg_cmp_type() function.
The new function result_as_longlong() is added to the Item class.
It indicates that the item is a date/time item and result of it can be
compared as int. Such items are date/time fields/functions.
Correct val_int() methods are implemented for classes Item_date_typecast,
Item_func_makedate, Item_time_typecast, Item_datetime_typecast. All these
classes are derived from Item_str_func and Item_str_func::val_int() converts
its string value to int without regard to the date/time type of these items.
Arg_comparator::set_compare_func() and Arg_comparator::set_cmp_func()
functions are changed to substitute result type of an item with the INT_RESULT
if the item is a date/time item and another item is a constant. This is done
to get a correct result of comparisons like date_time_function() = string_constant.
mysql-test/r/cast.result:
Fixed wrong test case result after bug fix#16377.
sql/item_timefunc.h:
Fixed bug#16377: result of DATE/TIME functions were compared as strings which
can lead to a wrong result.
The result_as_longlong() function is set to return TRUE for these classes:
Item_date, Item_date_func, Item_func_curtime, Item_func_sec_to_time,
Item_date_typecast, Item_time_typecast, Item_datetime_typecast,
Item_func_makedate.
sql/item_timefunc.cc:
Fixed bug#16377: result of DATE/TIME functions were compared as strings which
can lead to a wrong result.Correct val_int() methods are implemented for classes Item_date_typecast,
Item_func_makedate, Item_time_typecast, Item_datetime_typecast.
sql/item_cmpfunc.h:
Fixed bug#16377: result of DATE/TIME functions were compared as strings which
can lead to a wrong result.
Arg_comparator::set_compare_func() and Arg_comparator::set_cmp_func()
functions are changed to substitute result type of an item with the INT_RESULT
if the item is a date/time item and another item is a constant.
sql/field.cc:
Fixed bug#16377: result of DATE/TIME functions were compared as strings which
can lead to a wrong result.
Field::set_warning(), Field::set_datetime_warning() now use current_thd to get thd if table isn't set.
sql/item_cmpfunc.cc:
Fixed bug#16377: result of DATE/TIME functions were compared as strings which
can lead to a wrong result.
The agg_cmp_type() function now accepts THD as one of parameters.
In addition, it now checks if a date/time field/function is present in the
list. If so, it tries to coerce all constants to INT to make date/time
comparison return correct result. The field for the constant coercion is
taken from the Item_field or constructed from the Item_func. In latter case
the constructed field will be freed after conversion of all constant items.
Otherwise the result is same as before - aggregated with help of the
item_cmp_type() function.
sql/item.h:
The new function result_as_longlong() is added to the Item class.
It indicates that the item is a date/time item and result of it can be
compared as int. Such items are date/time fields/functions.
mysql-test/t/func_time.test:
Added test case fot bug#16377: result of DATE/TIME functions were compared as strings which
can lead to a wrong result.
mysql-test/r/func_time.result:
Added test case fot bug#16377: result of DATE/TIME functions were compared as strings which
can lead to a wrong result.
return incorrect result set for a select SQL request"
mysql-test/r/ps.result:
Test results fixed (Bug#12734)
mysql-test/t/ps.test:
A test case for Bug#12734
sql/item_cmpfunc.cc:
Reset canDoTurboBM in Item_func_like::cleanup()
sql/item_cmpfunc.h:
Add Item_func_like::cleanup()
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
my_regex.h:
Rename: regex/regex.h -> regex/my_regex.h
client/mysqltest.c:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
os2/MySQL-Source.icc:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
regex/Makefile.am:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
regex/debug.c:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
regex/debug.ih:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
regex/engine.c:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
regex/engine.ih:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
regex/main.c:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
regex/main.ih:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
regex/regcomp.c:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
regex/regerror.c:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
regex/regerror.ih:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
regex/my_regex.h:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
regex/regexec.c:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
regex/regfree.c:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
regex/reginit.c:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
sql/item_cmpfunc.cc:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
sql/item_cmpfunc.h:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
sql/mysqld.cc:
Prefix regex functions/types with "my_" as our
library is not compatible with normal regex lib.
Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
for some expressions.
The classes Item_func_between, Item_func_if, Item_func_in are modified.
Item_func_between/in objects can represent now [NOT]BETWEEN/IN expressions.
The class Item_func_opt_neg is added to factor out the functionality
common for the modified classes Item_func_between and Item_func_in.
item_cmpfunc.cc:
Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
for some expressions.
Added Item_func_between::fix_fields(), Item_func_if::fix_fields(),
Item_func_in::fix_fields(). They correct generic calculation of
the not_null_tables attribute when it is needed.
Modified Item_func_between::val_int(), Item_func_in::val_int().
opt_range.cc:
Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
for some expressions.
The function get_mm_tree() is modified. There cannot be NOT before
BETWEEN/IN anymore. Rather Item_func_between/in objects can represent
now [NOT]BETWEEN/IN expressions.
sql_yacc.yy:
Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
for some expressions.
Item_func_between/in objects can represent now [NOT]BETWEEN/IN expresions.
join_outer.result:
Fixed some testcases results (bugs #12101, #12102)
join_outer.test:
Added testcases for bugs #12101, #12102
mysql-test/t/join_outer.test:
Added testcases for bugs #12101, #12102
mysql-test/r/join_outer.result:
Fixed some testcases results (bugs #12101, #12102)
sql/sql_yacc.yy:
Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
for some expressions.
Item_func_between/in objects can represent now [NOT]BETWEEN/IN expresions.
sql/opt_range.cc:
Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
for some expressions.
The function get_mm_tree() is modified. There cannot be NOT before
BETWEEN/IN anymore. Rather Item_func_between/in objects can represent
now [NOT]BETWEEN/IN expressions.
sql/item_cmpfunc.cc:
Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
for some expressions.
Added Item_func_between::fix_fields(), Item_func_if::fix_fields(),
Item_func_in::fix_fields(). They correct generic calculation of
the not_null_tables attribute when it is needed.
Modified Item_func_between::val_int(), Item_func_in::val_int().
sql/item_cmpfunc.h:
Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
for some expressions.
The classes Item_func_between, Item_func_if, Item_func_in are modified.
Item_func_between/in objects can represent now [NOT]BETWEEN/IN expressions.
The class Item_func_opt_neg is added to factor out the functionality
common for the modified classes Item_func_between and Item_func_in.
Bug 12611 : ESCAPE + LIKE do not work when the escape char is a multibyte one
Forgot to commit this file in the previous changeset,
together with other files.
sql/item_cmpfunc.h:
Bug 12611 : ESCAPE + LIKE do not work when the escape char is a multibyte one
Forgot to commit this file in the previous changeset,
together with other files.
mysql-test/r/subselect.result:
testst of IN subqueries with row
mysql-test/t/subselect.test:
tests of ion subqueries with row
sql/item.h:
add method to prevent of removing Item_ref_null_helper from HAVING
sql/item_cmpfunc.h:
Prevented removing of Item_test_isnotnull from HAVING
sql/item_subselect.cc:
fixed converting row IN subqueries
sql/sql_select.cc:
fixed debug print
(IN() remove NULL rows only for tables from first argument (value which we looking for in IN() list) but not for tables from IN() list)
Also it will be better change Item::not_null_tables() to prohibit this optimisation by default for new created items in 5.0 or 5.1.
mysql-test/r/select.result:
IN with outer join condition
mysql-test/t/select.test:
IN with outer join condition
sql/item_cmpfunc.h:
correct not_null_tables() for IN
- Introduce ifdefs so we can control when to use #pragma interface on cygwin
include/my_global.h:
Turn on use of #pragma implementation and #pragma interface if compiled with GCC and platform != Cygwin
include/raid.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/examples/ha_archive.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/examples/ha_example.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/field.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/ha_berkeley.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/ha_blackhole.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/ha_heap.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/ha_innodb.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/ha_isam.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/ha_isammrg.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/ha_myisam.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/ha_myisammrg.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/ha_ndbcluster.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/handler.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/item.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/item_cmpfunc.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/item_func.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/item_geofunc.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/item_strfunc.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/item_subselect.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/item_sum.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/item_timefunc.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/opt_range.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/procedure.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/protocol.h:
replace __GNUC__ with USE_PRAGMA_IMPLEMENTATION
sql/set_var.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/sql_class.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/sql_list.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/sql_select.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/sql_string.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/sql_udf.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
sql/tztime.h:
replace __GNUC__ with USE_PRAGMA_INTERFACE
Added a test case for bug #9017.
item_cmpfunc.h:
A wrong not_null_tables method for Item_cond_xor
caused a conversion of a left join into an inner join
that was not valid.
sql/item_cmpfunc.h:
A wrong not_null_tables method for Item_cond_xor
caused a conversion of a left join into an inner join
that was not valid.
mysql-test/t/join_outer.test:
Added a test case for bug #9017.
mysql-test/r/join_outer.result:
Added a test case for bug #9017.
Item_func_equal::not_null_tables() always return 0.
mysql-test/r/join_outer.result:
Testcase for BUG#8711
mysql-test/t/join_outer.test:
Testcase for BUG#8711
sql/item_cmpfunc.h:
Fix for BUG#8711: "<=>" may have true value for NULL arguments, i.e. it can accept NULL-complemented
table rows. This differs from assumptions made in Item_func::not_null_tables(), so add
Item_func_equal::not_null_tables().
Item_func_equal::not_null_tables_cache value doesn't make sense now, but we still let it be
calculated (and ignore it)
fixed cols() method call (it have to be called only after fix_fields())
mysql-test/r/subselect.result:
Comparison subquery with * and row
mysql-test/t/subselect.test:
Comparison subquery with * and row
sql/item_cmpfunc.h:
initialization allowed_arg_cols for autodetection
sql/item_func.cc:
support of allowed_arg_cols autodetection by first argument
sql/item_func.h:
commant
sql/item_subselect.cc:
correct column number fetching for subqueries
sql/sql_lex.h:
method to check that UNION is prepared
(Cleanups and better bug fixes)
mysql-test/r/select.result:
Fixed test after wrong merge
mysql-test/t/select.test:
Fixed test after wrong merge
scripts/mysql_fix_privilege_tables.sh:
Don't read defaults files
sql/item_cmpfunc.cc:
Fix wrong value for not_null_tables_cache
sql/item_cmpfunc.h:
Remove wrong patch (flags are set in fix_length_and_dec())
sql/item_func.h:
Fix wrong value for not_null_tables_cache
sql/slave.cc:
Fixed indentation
BitKeeper/etc/logging_ok:
auto-union
sql/item_cmpfunc.h:
Auto merged
mysql-test/r/select.result:
Merge for BUG#3759
mysql-test/t/select.test:
Merge for BUG#3759
fixed null processing in NOT operation used in ALL subquery (Bug #6247)
mysql-test/r/subselect.result:
new tests of ALL/ANY wiews
mysql-test/t/subselect.test:
new tests of ALL/ANY wiews
sql/item_cmpfunc.cc:
fixed special NOT ALL processing
fixed processing max/min optimized subqueries with empty results (added methods to detect empty results) and special NOP operation to process them for SOME/ANY sobqueries
sql/item_cmpfunc.h:
fixed processing max/min optimized subqueries with empty results (added methods to detect empty results) and special NOP operation to process them for SOME/ANY sobqueries
sql/item_subselect.cc:
reporting empty result added for max/min subqueries
sql/item_subselect.h:
reporting empty result added for max/min subqueries
sql/item_sum.cc:
reporting empty result added fox max/min aggregate functions
sql/item_sum.h:
reporting empty result added fox max/min aggregate functions
sql/sql_class.cc:
reporting empty result added for max/min subqueries
sql/sql_parse.cc:
reporting empty result added for max/min subqueries
sql/sql_union.cc:
reporting empty result added for max/min subqueries
into mishka.local:/home/my/mysql-4.1
sql/item_cmpfunc.h:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
crashes server (prepared statements)": the bug was that all boolean
items always recovered its original arguments at statement cleanup
stage.
This collided with Item_subselect::select_transformer, which tries to
permanently change the item tree to use a transformed subselect instead of
original one.
So we had this call sequence for prepare:
mysql_stmt_prepare -> JOIN::prepare ->
Item_subselect::fix_fields -> the item tree gets transformed ->
Item_bool_rowready_func2::cleanup, item tree is recovered to original
state, while it shouldn't have been;
mysql_stmt_execute -> attempts to execute a broken tree -> crash.
Now instead of bluntly recovering all arguments of bool functions in
Item_bool_rowready_func2::cleanup, we recover only those
which were changed, and do it in one place.
There still would exist a possibility for a collision with subselect
tranformation, if permanent and temporary changes were performed at the
same stage.
But fortunately subselect transformation is always done first, so it
doesn't conflict with the optimization done by propogate_cond_constants.
Now we have:
mysql_stmt_prepare -> JOIN::prepare -> subselect transformation
permanently changes the tree -> cleanup doesn't recover anything,
because nothing was registered for recovery.
mysql_stmt_execute -> JOIN::prepare (the tree is already transformed,
so it doesn't change), JOIN::optimize ->
propogate_cond_constants -> temporary changes the item tree
with constants -> JOIN::execute -> cleanup ->
the changes done by propogate_cond_constants are recovered, as
they were registered for recovery.
mysql-test/r/ps.result:
Bug#5987: test results fixed.
mysql-test/t/ps.test:
A test for bug#5987 "subselect in bool function crashes server
(prepared statements)"
sql/item.cc:
resolve_const_item is now responsible to register all changes of the
item tree for recovery
sql/item.h:
resolve_const_item signagture changed
sql/item_cmpfunc.h:
Arguments of boolean functions are now recovered using the
centralized registry of THD.
sql/sql_class.cc:
It's crucial to add new items to the beginning of the recovery list,
so that the recovery is performed in LIFO mode: otherwise if we
change one node of a tree twice, it will be recovered to some intermediate
state.
sql/sql_select.cc:
change_cond_ref_to_const and propogate_cond_constants are now responsible
to register all changes of the item tree for recovery.
The recovery is done using the centralized THD registry of
changed tree items.
doesn't need to have it's own recovery mechanism.
sql/item.cc:
Deployment of centralized Item change registry, step 2: Item_ref
doesn't need to have it's own recovery mechanism, so it was simplified.
sql/item.h:
Deployment of centralized Item change registry, step 2: Item_ref
doesn't need to have it's own recovery mechanism, so it was simplified.
sql/item_cmpfunc.cc:
- Item::split_sum_func now requires THD
- use THD::register_item_tree_change
sql/item_cmpfunc.h:
- Item::split_sum_func now requires THD
sql/item_func.cc:
- Item::split_sum_func now requires THD
- use THD::register_item_tree_change
sql/item_func.h:
- Item::split_sum_func now requires THD
sql/item_row.cc:
- Item::split_sum_func now requires THD
- use THD::register_item_tree_change
sql/item_row.h:
- Item::split_sum_func now requires THD
sql/item_strfunc.cc:
- Item::split_sum_func now requires THD
- use THD::register_item_tree_change to register changes in the item
tree
sql/item_strfunc.h:
- Item::split_sum_func now requires THD
sql/item_subselect.cc:
- use updated Item_ref constructor
sql/sql_base.cc:
- Item::split_sum_func now requires THD
sql/sql_select.cc:
- Item::split_sum_func now requires THD
sql/sql_yacc.yy:
- use updated Item_ref constructor
Noteworthy:
- New HANDLER code
- New multi-update-grant-check code
- Table lock code in ha_innodb.cc was not applied
BitKeeper/etc/logging_ok:
auto-union
BitKeeper/deleted/.del-ctype-latin1_de.c~c5d8f9208bceb98e:
Auto merged
Build-tools/mysql-copyright-2:
Auto merged
acinclude.m4:
Auto merged
client/mysqladmin.c:
Auto merged
client/mysqldump.c:
Auto merged
include/config-win.h:
Auto merged
include/my_global.h:
Auto merged
include/myisam.h:
Auto merged
innobase/btr/btr0btr.c:
Auto merged
innobase/buf/buf0buf.c:
Auto merged
ltmain.sh:
Auto merged
innobase/dict/dict0dict.c:
Auto merged
innobase/fsp/fsp0fsp.c:
Auto merged
innobase/include/dict0dict.h:
Auto merged
innobase/include/row0mysql.h:
Auto merged
innobase/log/log0log.c:
Auto merged
innobase/log/log0recv.c:
Auto merged
innobase/pars/pars0opt.c:
Auto merged
innobase/row/row0row.c:
Auto merged
innobase/sync/sync0arr.c:
Auto merged
innobase/ut/ut0dbg.c:
Auto merged
myisam/mi_check.c:
Auto merged
myisam/mi_close.c:
Auto merged
myisam/mi_create.c:
Auto merged
myisam/mi_locking.c:
Auto merged
myisam/myisampack.c:
Auto merged
mysql-test/r/delete.result:
Auto merged
mysql-test/r/func_if.result:
Auto merged
Build-tools/mysql-copyright:
Merge with 4.0 (too most of the code from 4.0)
Makefile.am:
merge
client/mysql.cc:
Used 4.1 code
configure.in:
merge
innobase/os/os0file.c:
merge
innobase/row/row0mysql.c:
merge
mysql-test/r/ctype_latin1_de.result:
merge
mysql-test/r/flush_table.result:
merge
mysql-test/r/func_str.result:
merge
mysql-test/r/handler.result:
merge
mysql-test/r/multi_update.result:
merge
mysql-test/r/type_timestamp.result:
Removed testing of 'new' mode, as this is only relevant for 4.0
mysql-test/r/update.result:
merge
mysql-test/t/delete.test:
merge
mysql-test/t/flush_table.test:
merge
mysql-test/t/func_str.test:
merge
mysql-test/t/handler.test:
merge
mysql-test/t/multi_update.test:
merge
mysql-test/t/type_timestamp.test:
Removed testing of 'new' mode, as this is only relevant for 4.0
mysql-test/t/update.test:
merge
mysys/errors.c:
merge
mysys/my_fstream.c:
merge
mysys/my_pread.c:
merge
mysys/my_write.c:
merge
mysys/mysys_priv.h:
merge
scripts/mysqlhotcopy.sh:
merge
sql/field.cc:
Keep code from 4.1
sql/field.h:
Keep code from 4.1
sql/ha_innodb.cc:
Don't merge lock code from 4.0; Heikki will look at this
sql/ha_myisam.cc:
merge
sql/handler.cc:
merge
sql/item_cmpfunc.cc:
merge
sql/item_cmpfunc.h:
merge
sql/item_strfunc.cc:
merge
sql/mysql_priv.h:
merge
sql/mysqld.cc:
merge
sql/protocol.cc:
merge
sql/records.cc:
merge
sql/repl_failsafe.cc:
merge
mysql-test/r/lock_multi.result:
merge
mysql-test/t/ctype_latin1_de.test:
merge
mysql-test/t/func_if.test:
merge
mysql-test/t/lock_multi.test:
merge
sql/repl_failsafe.h:
merge
Remove unnessessary header protection
sql/slave.h:
merge
sql/sql_acl.cc:
merge
sql/sql_base.cc:
merge
sql/sql_cache.cc:
auto merge
sql/sql_class.cc:
merge
sql/sql_class.h:
merge
sql/sql_delete.cc:
merge
sql/sql_handler.cc:
Get new HANDLER code into 4.1
sql/sql_parse.cc:
Keep old file
sql/sql_repl.cc:
merge
sql/sql_repl.h:
merge
sql/sql_show.cc:
merge
sql/sql_table.cc:
merge
sql/sql_union.cc:
Applied the examine_rows bug fix from 4.0 by hand
sql/sql_update.cc:
New multi-update-grant-check code from 4.0
sql/sql_yacc.yy:
New multi-update-grant-check code from 4.0
sql/stacktrace.c:
merge
sql/table.h:
merge
mysql-test/r/negation_elimination.result:
new tests of negation elimination
mysql-test/t/negation_elimination.test:
new tests of negation elimination
sql/item.h:
test of boolean functions added
sql/item_cmpfunc.cc:
NOT subtree is already checked, so wee need to return just argument
sql/item_cmpfunc.h:
test of boolean functions added
sql/mysql_priv.h:
'place' to detect WHERE clause
sql/sql_parse.cc:
function for creation negated expression
sql/sql_select.cc:
removed unused function
sql/sql_select.h:
removed unused function
sql/sql_yacc.yy:
'place' to detect WHERE clause
The cause of the bug is that Item_func_in::fix_fields did not fully update its
used_table_cache. This was the cause for not_null_tables in setup_conds() to be
still 0 after the call
not_null_tables= (*conds)->not_null_tables();
As a result the condition in setup_conds()
if ( ... (table->table->map & not_null_tables) ...)
failed, which was the cause for the ON expression not to be added to conds, and later
the optimizer couldn't detect that it could apply the OUTER JOIN ==> JOIN optimization.
sql/item_cmpfunc.h:
Fix for Bug#3759
BitKeeper/etc/logging_ok:
Logging to logging@openlogging.org accepted
sql/item_cmpfunc.cc:
NOT elimination moved in parsing (we do not need fix fields in it and PS processing)
sql/item_cmpfunc.h:
NOT elimination moved in parsing (we do not need fix fields in it and PS processing)
sql/sql_select.cc:
NOT elimination moved in parsing (we do not need fix fields in it and PS processing)
sql/sql_yacc.yy:
NOT elimination moved in parsing
Added test case for bug #4256.
join_outer.result:
Fixed bug #4256.
item_cmpfunc.h:
Fixed inconsistency of values of used_tables_cache and
const_item_cache for Item_func_isnull objects.
This inconsistency caused bug #4256.
sql/item_cmpfunc.h:
Fixed inconsistency of values of used_tables_cache and
const_item_cache for Item_func_isnull objects.
This inconsistency caused bug #4256.
mysql-test/r/join_outer.result:
Fixed bug #4256.
mysql-test/r/null.result:
Added test case for bug #4256.
mysql-test/t/null.test:
Added test case for bug #4256.
into brandersnatch.localdomain:/home/dlenev/src/mysql-4.1-bg4200
sql/item_cmpfunc.cc:
Auto merged
sql/item_cmpfunc.h:
Auto merged
sql/sql_yacc.yy:
Auto merged
Now ESCAPE in LIKE will accept not only string literal but constant
delimited expression.
mysql-test/r/func_like.result:
Added test for bug# 4200 "Parse error on LIKE ESCAPE with parameter binding"
mysql-test/t/func_like.test:
Added test for bug# 4200 "Parse error on LIKE ESCAPE with parameter binding"
sql/item_cmpfunc.cc:
Added support for accepting of constant delimited expression as ESCAPE argument to
Item_func_like.
sql/item_cmpfunc.h:
Now ESCAPE clause in LIKE will accept not only string literal but constant delimited
expression. Thus added member to Item_func_like for storing Item corresponding to this
expression and changed third argument of cons to be Item* instead of char*.
sql/sql_help.cc:
Item_func_like now accepts Item* as third argument.
sql/sql_yacc.yy:
Now ESCAPE clause of LIKE accepts not only string literal but constant delimited expression
(the most important case is prepared statement parameter of course).
mysql-test/r/func_regexp.result:
test of cleaning regex in PS
mysql-test/t/func_regexp.test:
test of cleaning regex in PS
sql/item_cmpfunc.cc:
cleanup for Item_func_regex
sql/item_cmpfunc.h:
cleanup for Item_func_regex
mysql-test/t/type_date.test:
Auto merged
sql/field.cc:
Auto merged
sql/field.h:
Auto merged
sql/item_cmpfunc.h:
Auto merged
sql/sql_acl.cc:
Auto merged
mysql-test/r/type_date.result:
merge with 3.23
sql/handler.h:
Fixed (portability) bug. No qualified method names in the class definition.
sql/item_cmpfunc.h:
Attempt to silence cast warnings on some platforms.
sql/item_subselect.h:
Attempt to silence cast warnings on some platforms.
sql/set_var.cc:
Silence warning (missing cast).
sql/spatial.h:
Attempt to silence cast warnings on some platforms.
sql/sql_cache.cc:
Silence warning (wrong cast).
sql/sql_lex.h:
Attempt to silence cast warnings on some platforms.
fixed aggregate functions in PS (BUG#3360)
mysql-test/r/union.result:
4.1 more correct error
sql/item_cmpfunc.h:
and_conds do not make fix fields
sql/item_sum.cc:
storing/restoring argument of aggregate function for prepared statements
restoring order list of group_concat for safety
sql/item_sum.h:
storing/restoring argument of aggregate function for prepared statements
layout fix
sql/mysql_priv.h:
just declaration
sql/sql_base.cc:
fix_fields() have to be called with temporary memory pool active
sql/sql_parse.cc:
removed hack with item pointer storing
sql/sql_prepare.cc:
debug output added
removed hack with item pointer storing
sql/sql_select.cc:
fix_fields now should be called separately
sql/sql_union.cc:
removed wrong merged check from 4.0 (4.1 have its own protection)
sql/table.h:
removed hack with item pointer storing
tests/client_test.c:
new test fo PS
include/mysql.h:
cleanup of load data infile patch
libmysql/libmysql.c:
cleanup of load data infile patch
myisam/mi_search.c:
Added missing assert.h
mysql-test/r/func_time.result:
Make test more secure
mysql-test/t/func_time.test:
Make test more secure
sql/item.cc:
restore to use str_value in item::save_in_field
sql/item.h:
Simple cleanup
sql/item_cmpfunc.cc:
Safety fix
sql/item_cmpfunc.h:
Simple optimization
sql/item_func.cc:
Updated comment
sql/sql_base.cc:
Simple optimization
sql/sql_select.cc:
Simple optimization
sql/sql_union.cc:
safey fixes
sql/item.cc:
layout fixed
fixed bug in prepared statements with subqueries and outer references
sql/item.h:
neg_transformer get thd argument to call fix_fields
sql/item_cmpfunc.cc:
DBUG_ASSERT(fixed == 0) added to fix_fields()
fixed Item_in_optimizer fixed flag
neg_arguments(), neg_transformer() call fix_field() on created items to avoid bouble fix field or non-called fixfields()
sql/item_cmpfunc.h:
neg_transformer get thd argument to call fix_fields
fixed forgoten cleanup() call of parent class
sql/item_func.cc:
DBUG_ASSERT(fixed == 0) and fixed flag check added to fix_fields()
sql/item_func.h:
DBUG_ASSERT(fixed == 0) added to fix_fields()
fixed forgoten cleanup() call of parent class
sql/item_row.cc:
DBUG_ASSERT(fixed == 0) added to fix_fields()
added forgoten 'fixed' flag set
sql/item_subselect.cc:
DBUG_ASSERT(fixed == 0) added to fix_fields()
fixed subquery transformation
sql/sql_base.cc:
check of fixed flag added
sql/sql_derived.cc:
fixed cleunup union in derived table during EXPLAIN command processing
sql/sql_select.cc:
thd argument add to function to allow call fix_fields() of new created items
fixed EXPLAIN double preparation
check of fixed flag added
eliminate_not_funcs fixed for corrcet fix_fields call of new created items
sql/sql_select.h:
thd argument add to function to allow call fix_fields() of new created items
sql/sql_union.cc:
union processing fixed
tests/client_test.c:
layout fixed
new test of outer references fron subqueries
mysql-test/r/derived.result:
Auto merged
mysql-test/t/derived.test:
Auto merged
sql/item.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_cmpfunc.h:
Auto merged
sql/item_sum.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_union.cc:
Auto merged
sql/sql_update.cc:
Auto merged
Added more DBUG statements
Ensure that we are comparing end space with BINARY strings
Use 'any_db' instead of '' to mean any database. (For HANDLER command)
Only strip ' ' when comparing CHAR, not other space-like characters (like \t)
BitKeeper/deleted/.del-ctype_tis620.result-old~3578ceb0b8284685:
Delete: mysql-test/r/ctype_tis620.result-old
BitKeeper/deleted/.del-ctype_tis620.test-old~ffb1bbd2935d1aba:
Delete: mysql-test/t/ctype_tis620.test-old
client/mysqlbinlog.cc:
Added DBUG statements
Added call of my_end() to free all used memory on exit
heap/hp_info.c:
After merge fixes
heap/hp_open.c:
After merge fixes
include/heap.h:
After merge fixes
include/m_ctype.h:
Use pchar instead of 'int' for character parameters.
Added 'my_binary_compare()'
include/m_string.h:
Fixed wrong define
innobase/ibuf/ibuf0ibuf.c:
After merge fixes
innobase/srv/srv0start.c:
After merge fixes
mysql-test/r/alter_table.result:
Fixed results after merge
mysql-test/r/auto_increment.result:
Fixed results after merge
mysql-test/r/bdb.result:
Fixed results after merge
mysql-test/r/binary.result:
Fixed results after merge
mysql-test/r/create.result:
Fixed results after merge
mysql-test/r/ctype_mb.result:
Fixed results after merge
mysql-test/r/ctype_tis620.result:
Fixed results after merge
mysql-test/r/ctype_utf8.result:
Fixed results after merge
mysql-test/r/delete.result:
Fixed results after merge
mysql-test/r/func_compress.result:
Fixed results after merge
mysql-test/r/func_gconcat.result:
Fixed results after merge
mysql-test/r/func_group.result:
Fixed results after merge
mysql-test/r/func_str.result:
Fixed results after merge
mysql-test/r/innodb.result:
Fixed results after merge
mysql-test/r/insert.result:
Fixed results after merge
mysql-test/r/insert_select.result:
Fixed results after merge
mysql-test/r/key.result:
Fixed results after merge
mysql-test/r/loaddata.result:
Fixed results after merge
mysql-test/r/lock.result:
Fixed results after merge
mysql-test/r/myisam.result:
Fixed results after merge
mysql-test/r/null.result:
Fixed results after merge
mysql-test/r/null_key.result:
Fixed results after merge
mysql-test/r/order_by.result:
Fixed results after merge
mysql-test/r/query_cache.result:
Fixed results after merge
mysql-test/r/range.result:
Fixed results after merge
mysql-test/r/rpl_multi_delete.result:
Fixed results after merge
mysql-test/r/rpl_until.result:
Fixed results after merge
mysql-test/r/subselect.result:
Fixed results after merge
mysql-test/r/subselect_innodb.result:
Fixed results after merge
mysql-test/r/type_blob.result:
Fixed results after merge
mysql-test/r/type_datetime.result:
Fixed results after merge
mysql-test/r/type_decimal.result:
Fixed results after merge
mysql-test/r/type_enum.result:
Fixed results after merge
mysql-test/r/type_float.result:
Fixed results after merge
mysql-test/r/type_ranges.result:
Fixed results after merge
mysql-test/r/type_time.result:
Fixed results after merge
mysql-test/r/type_timestamp.result:
Fixed results after merge
mysql-test/r/type_uint.result:
Fixed results after merge
mysql-test/r/type_year.result:
Fixed results after merge
mysql-test/r/variables.result:
Fixed results after merge
mysql-test/r/warnings.result:
Fixed results after merge
mysql-test/t/case.test:
Fixed shifted error messages
mysql-test/t/create.test:
Fixed shifted error messages
mysql-test/t/ctype_collate.test:
Fixed shifted error messages
mysql-test/t/ctype_tis620.test:
Merge with 4.0 ctype_tis620 test
mysql-test/t/delete.test:
Fixed shifted error messages
mysql-test/t/derived.test:
Fixed shifted error messages
mysql-test/t/fulltext.test:
Fixed shifted error messages
mysql-test/t/func_in.test:
Fixed shifted error messages
mysql-test/t/func_str.test:
Fixed shifted error messages
mysql-test/t/func_test.test:
Fixed shifted error messages
mysql-test/t/grant.test:
Fixed shifted error messages
mysql-test/t/innodb.test:
Change to 4.1 syntax
mysql-test/t/key_cache.test:
Fixed shifted error messages
mysql-test/t/myisam.test:
New test of blob and end space
mysql-test/t/row.test:
Fixed shifted error messages
mysql-test/t/rpl_until.test:
Fixed shifted error messages
mysql-test/t/subselect.test:
Fixed shifted error messages
mysql-test/t/subselect_innodb.test:
Fix test to take into account foreign key constraints
mysql-test/t/union.test:
Fixed shifted error messages
mysql-test/t/user_var.test:
Fixed shifted error messages
mysql-test/t/variables.test:
Fixed shifted error messages
mysys/my_handler.c:
Merge with 4.0 code
sql/ha_heap.cc:
After merge fixes
sql/handler.cc:
After merge fixes
sql/item.cc:
After merge fixes
sql/item_cmpfunc.cc:
Ensure that we are comparing end space with BINARY strings
sql/item_cmpfunc.h:
Ensure that we are comparing end space with BINARY strings
sql/log_event.cc:
More DBUG statements
Ensure that we use all options to LOAD DATA in replication
sql/opt_range.cc:
After merge fixes
sql/sql_db.cc:
After merge fixes
sql/sql_handler.cc:
After merge fixes
Use 'any_db' instead of '' to mean 'no database comparison'
sql/sql_parse.cc:
After merge fixes
sql/sql_select.cc:
After merge fixes
Added function comment for setup_group()
sql/sql_string.cc:
Added stringcmp() for binary comparison.
Added function comments for sortcmp() and stringcmp()
sql/sql_string.h:
Added stringcmp()
sql/sql_table.cc:
After merge fixes
sql/sql_update.cc:
After merge fixes
sql/sql_yacc.yy:
Use 'any_db' instead of '' to mean any database. Using "" causes a 'wrong db name' error.
strings/ctype-big5.c:
Strip only end space, not other space characters.
strings/ctype-bin.c:
Removed some not needed functions.
Added function comments
Don't remove end space in comparisons
Change my_wildcmp_bin() to be 'identical' with other similar code
strings/ctype-czech.c:
Strip only end space, not other space characters.
strings/ctype-gbk.c:
Strip only end space, not other space characters.
strings/ctype-latin1.c:
Strip only end space, not other space characters.
strings/ctype-mb.c:
Strip only end space, not other space characters.
strings/ctype-simple.c:
Strip only end space, not other space characters.
strings/ctype-sjis.c:
Strip only end space, not other space characters.
strings/ctype-tis620.c:
Added usage of my_instr_simple. This needs to be cleaned up!
strings/ctype-utf8.c:
Strip only end space, not other space characters.
strings/ctype-win1250ch.c:
Strip only end space, not other space characters.
Fixed indentation
strings/strto.c:
Code cleanup
sql/item.h:
mechanism to keep reference in cache array for row IN
sql/item_cmpfunc.cc:
mechanism to keep reference in cache array for row IN
layout fixed
sql/item_cmpfunc.h:
mechanism to keep reference in cache array for row IN
sql/item_subselect.cc:
fixed memory pools swapping
prevented deleting Item_in_optimizer cache in case of row IN subquery
sql/mysql_priv.h:
declarations of function moved to be useful in sql_class.h
sql/sql_base.cc:
keep fields expanded from '*' in statement memory pool
sql/sql_class.cc:
fixed restoring/backup of memory pool and list of items
sql/sql_class.h:
memory allocation methods moved to Statement
memory pool substituting for preparing
sql/sql_lex.cc:
ref_pointer_array kept in statement memory
sql/sql_lex.h:
reinitialization of UNIT
sql/sql_prepare.cc:
memory allocation/swapping fixed
tests/client_test.c:
layout fixed
BitKeeper/etc/ignore:
auto-union
BitKeeper/etc/logging_ok:
auto-union
mysql-test/r/ctype_tis620.result-old:
Merge rename: mysql-test/r/ctype_tis620.result -> mysql-test/r/ctype_tis620.result-old
BUILD/compile-pentium-max:
Auto merged
BitKeeper/etc/config:
Auto merged
Build-tools/Bootstrap:
Auto merged
Build-tools/Do-compile:
Auto merged
configure.in:
Auto merged
mysql-test/t/ctype_tis620.test-old:
Merge rename: mysql-test/t/ctype_tis620.test -> mysql-test/t/ctype_tis620.test-old
Docs/Makefile.am:
Auto merged
client/mysqldump.c:
Auto merged
client/mysqltest.c:
Auto merged
include/my_global.h:
Auto merged
include/my_pthread.h:
Auto merged
include/my_sys.h:
Auto merged
include/myisam.h:
Auto merged
innobase/btr/btr0cur.c:
Auto merged
innobase/ibuf/ibuf0ibuf.c:
Auto merged
innobase/include/dict0dict.h:
Auto merged
innobase/include/srv0srv.h:
Auto merged
innobase/include/ut0mem.h:
Auto merged
innobase/log/log0log.c:
Auto merged
innobase/row/row0ins.c:
Auto merged
innobase/row/row0sel.c:
Auto merged
innobase/srv/srv0start.c:
Auto merged
innobase/ut/ut0mem.c:
Auto merged
myisam/mi_check.c:
Auto merged
myisam/mi_dynrec.c:
Auto merged
myisam/mi_key.c:
Auto merged
myisam/myisam_ftdump.c:
Auto merged
myisam/myisamdef.h:
Auto merged
mysql-test/mysql-test-run.sh:
Auto merged
mysql-test/r/alter_table.result:
Auto merged
mysql-test/r/bdb.result:
Auto merged
mysql-test/r/bigint.result:
Auto merged
mysql-test/r/fulltext.result:
Auto merged