with null values
For queries containing GROUP_CONCAT(DISTINCT fields ORDER BY fields), there
was a limitation that the DISTINCT fields had to be the same as ORDER BY
fields, owing to the fact that one single sorted tree was used for keeping
track of tuples, ordering and uniqueness. Fixed by introducing a second
structure to handle uniqueness so that the original structure has only to
order the result.
mysql-test/r/func_gconcat.result:
Bug#32798:
- Wrong test result turned correct after fix.
- Correct test result
mysql-test/t/func_gconcat.test:
Bug#32798: Test case
sql/item_sum.cc:
Bug#32798: Implementation of fix. Dead code removal.
- removed comment describing this bug
- replaced body of function group_concat_key_cmp_with_distinct
- removed function group_concat_key_cmp_with_distinct_and_order
- Added a Unique object to maintain uniqueness of values.
sql/item_sum.h:
Bug#32798: Declarations and comments.
into mysql.com:/home/gluh/MySQL/Merge/5.0-opt
client/mysql.cc:
Auto merged
client/mysqltest.c:
Auto merged
include/mysql_com.h:
Auto merged
libmysql/CMakeLists.txt:
Auto merged
myisam/mi_check.c:
Auto merged
mysql-test/r/delayed.result:
Auto merged
mysql-test/r/innodb.result:
Auto merged
mysql-test/r/myisam.result:
Auto merged
mysql-test/r/ps.result:
Auto merged
mysql-test/t/merge.test:
Auto merged
mysql-test/t/myisam.test:
Auto merged
mysql-test/t/subselect.test:
Auto merged
mysql-test/t/type_datetime.test:
Auto merged
mysql-test/t/variables.test:
Auto merged
sql/field.cc:
Auto merged
sql/ha_myisam.cc:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/opt_range.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/set_var.h:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
mysql-test/r/func_misc.result:
manual merge
mysql-test/r/innodb_mysql.result:
manual merge
mysql-test/t/func_misc.test:
manual merge
mysql-test/t/innodb_mysql.test:
manual merge
sql/sql_insert.cc:
manual merge
- Make conditions like "date_col $CMP$ 'datetime-const'" range-sargable
mysql-test/r/range.result:
BUG#32198: Comparison of DATE with DATETIME still not using indexes correctly
- Testcase
mysql-test/t/range.test:
BUG#32198: Comparison of DATE with DATETIME still not using indexes correctly
- Testcase
sql/field.cc:
BUG#32198: Comparison of DATE with DATETIME still not using indexes correctly
- Added comments
subselects into account
It is forbidden to use the SELECT INTO construction inside UNION statements
unless on the last SELECT of the union. The parser records whether it
has seen INTO or not when parsing a UNION statement. But if the INTO was
legally used in an outer query, an error is thrown if UNION is seen in a
subquery. Fixed in 5.0 by remembering the nesting level of INTO tokens and
mitigate the error unless it collides with the UNION.
mysql-test/r/union.result:
Bug#32858: Test result
mysql-test/t/union.test:
Bug#32858: Test case
sql/sql_class.cc:
Bug#32858: Initializing new member
sql/sql_class.h:
Bug#32858: Added property nest_level to select_result class.
sql/sql_yacc.yy:
Bug#32858: The fix.
There were two problems when inferring the correct field types resulting from
UNION queries.
- If the type is NULL for all corresponding fields in the UNION, the resulting
type would be NULL, while the type is BINARY(0) if there is just a single
SELECT NULL.
- If one SELECT in the UNION uses a subselect, a temporary table is created
to represent the subselect, and the result type defaults to a STRING type,
hiding the fact that the type was unknown(just a NULL value).
Fixed by remembering whenever a field was created from a NULL value and pass
type NULL to the type coercion if that is the case, and creating a string field
as result of UNION only if the type would otherwise be NULL.
mysql-test/r/union.result:
Bug#32848: Test result
mysql-test/t/union.test:
Bug#32848: Test case
sql/field.cc:
Bug#32848: Initialization of new field
sql/field.h:
Bug#32848: New member to record when a field was created from a NULL value.
sql/item.cc:
Bug#32848:
A field created from a NULL value will submit NULL as type to the
type coercion procedure.
If Item_type_holder has not inferred the correct type after processing all
SELECTs in a UNION, a string field is created.
sql/sql_select.cc:
Bug#32848: Recording when a field is created from a NULL value.
HOUR(), MINUTE(), ... returned spurious results when used on a DATE-cast.
This happened because DATE-cast object did not overload get_time() method
in superclass Item. The default method was inappropriate here and
misinterpreted the data.
Patch adds missing method; get_time() on DATE-casts now returns SQL-NULL
on NULL input, 0 otherwise. This coincides with the way DATE-columns
behave.
Also fixes similar bug in Date-Field now.
mysql-test/r/cast.result:
Show that HOUR(), MINUTE(), ... return sensible values when used
on DATE-cast objects, namely NULL for NULL-dates and 0 otherwise.
Show that this coincides with how DATE-columns behave.
mysql-test/r/type_date.result:
Show that HOUR(), MINUTE(), ... return sensible values when used
on DATE-fields.
mysql-test/t/cast.test:
Show that HOUR(), MINUTE(), ... return sensible values when used
on DATE-cast objects, namely NULL for NULL-dates and 0 otherwise.
Show that this coincides with how DATE-columns behave.
mysql-test/t/type_date.test:
Show that HOUR(), MINUTE(), ... return sensible values when used
on DATE-fields.
sql/field.cc:
Add get_time() method to DATE-field object to overload
the method in Field superclass that would return spurious
results. Return zero-result.
sql/field.h:
Add get_time() declaration to date-field class
sql/item_timefunc.cc:
Add get_time() method to DATE-cast object to overload
the method in Item superclass that would return spurious
results. Return zero-result; flag NULL if input was NULL.
sql/item_timefunc.h:
Add get_time() declaration to DATE-cast object.
mysql-test/r/read_only.result:
Removing non deterministic test results from test.
mysql-test/t/read_only.test:
Removing non deterministic test results from test.
LAST_DAY() says it returns a DATE, not a DATETIME, but didn't zero the time fields.
Adapted from a patch kindly supplied by Claudio Cherubino.
mysql-test/r/func_time.result:
show that LAST_DAY() returns only a DATE, not a DATETIME
mysql-test/t/func_time.test:
show that LAST_DAY() returns only a DATE, not a DATETIME
sql/item_timefunc.cc:
zero time-fields as we return only a DATE
The problem was that when convert_constant_item is called for subqueries,
this happens when we already started executing the top-level query, and
the field argument of convert_constant_item pointed to a valid table row.
In turn convert_constant_item used the field buffer to compute the value
of its item argument. This copied the item's value into the field,
and made equalities with outer references always true.
The fix saves/restores the original field's value when it belongs to an
outer table.
mysql-test/r/type_datetime.result:
Test for BUG#32694.
mysql-test/t/type_datetime.test:
Test for BUG#32694.
sql/item_cmpfunc.cc:
- Changed convert_constant_item() so that it doesn't destroy the contents
of its field argument when the field originates from table in an outer
query.
Both arguments of the function NAME_CONST must be constant expressions.
This constraint is checked in the Item_name_const::fix_fields method.
Yet if the argument of the function was not a constant expression no
error message was reported. As a result the client hanged waiting for a
response.
Now the function Item_name_const::fix_fields reports an error message
when any of the additional context conditions imposed on the function
NAME_CONST is not satisfied.
mysql-test/r/func_misc.result:
Added a test case for bug #26545.
mysql-test/t/func_misc.test:
Added a test case for bug #26545.
The index (key_part_1, key_part-2) was erroneously considered as compatible
with the required ordering in the function test_test_if_order_by_key when
a query with an ORDER BY clause contained a condition of the form
key_part_1=const OR key_part_1 IS NULL
and the order list contained only key_part_2. This happened because the value
of the const_key_parts field in the KEYUSE structure was not formed correctly
for the keys that could be used for ref_or_null access.
This was fixed in the code of the update_ref_and_keys function.
The problem could not manifest itself for MyISAM databases because the
implementation of the keys_to_use_for_scanning() handler function always
returns an empty bitmap for the MyISAM engine.
mysql-test/r/innodb_mysql.result:
Added a test case for bug #32815.
mysql-test/t/innodb_mysql.test:
Added a test case for bug #32815.
sql/sql_select.cc:
Fixed bug #32815.
The index (key_part_1, key_part-2) was erroneously considered as compatible
with the required ordering in the function test_test_if_order_by_key when
a query with an ORDER BY clause contained a condition of the form
key_part_1=const OR key_part_1 IS NULL
and the order list contained only key_part_2. This happened because the value
of the const_key_parts field in the KEYUSE structure was not formed correctly
for the keys that could be used for ref_or_null access.
This was fixed in the code of the update_ref_and_keys function.
When read_only option was enabled, a user without SUPER privilege could
perform CREATE DATABASE and DROP DATABASE operations.
This patch adds a check to make sure this isn't possible. It also attempts to
simplify the logic used to determine if relevant tables are updated,
making it more human readable.
mysql-test/r/read_only.result:
Updated result file
mysql-test/t/read_only.test:
A test case is added which shows that it is not possible to drop or create a
database in read-only mode despite having the GRANT permissions to do so,
SUPER user excepted.
sql/sql_parse.cc:
- Simplified complex predicate by grouping it in a read friendly way.
- Added predicate to fail on database updates while running in read-only
mode.
mysql-test/r/grant.result:
Update test results to .test changes
mysql-test/t/grant.test:
Drop users when done with them, to avoid skewing results of later tests.
For example, running some test which examines the cardinality of the
mysql.user table would fail if run right after this test, due to the
extra users.
into mysql.com:/misc/mysql/31177/50-31177
mysql-test/r/ps_2myisam.result:
Auto merged
mysql-test/r/ps_3innodb.result:
Auto merged
mysql-test/r/ps_4heap.result:
Auto merged
mysql-test/r/ps_5merge.result:
Auto merged
mysql-test/r/ps_6bdb.result:
Auto merged
mysql-test/r/ps_7ndb.result:
Auto merged
mysql-test/t/variables.test:
Auto merged
sql/item_func.cc:
Auto merged
sql/mysqld.cc:
Auto merged
into ramayana.hindu.god:/home/tsmith/m/bk/maint/50
client/mysqldump.c:
Auto merged
include/my_sys.h:
Auto merged
libmysql/CMakeLists.txt:
Auto merged
libmysql/Makefile.shared:
Auto merged
myisam/ft_boolean_search.c:
Auto merged
myisam/sort.c:
Auto merged
mysql-test/t/cast.test:
Auto merged
mysql-test/t/variables.test:
Auto merged
sql/field.cc:
Auto merged
sql/ha_myisam.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_cmpfunc.h:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/opt_range.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/set_var.h:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_table.cc:
Auto merged
mysql-test/mysql-test-run.pl:
Manual merge
mysql-test/r/ctype_ucs.result:
Manual merge
mysql-test/r/func_misc.result:
Manual merge
mysql-test/t/binlog_killed.test:
Manual merge
mysql-test/t/ctype_ucs.test:
Manual merge
mysql-test/t/func_misc.test:
Manual merge
sql/item_strfunc.h:
Manual merge
strings/ctype-simple.c:
Manual merge
Anti-patch. This patch undoes the previously pushed patch. It is
null-merged in versions 5.1 and above since there the original
patch is still desired.
mysql-test/r/delete.result:
Bug#30234: Anti-patch
mysql-test/t/delete.test:
Bug#30234: Anti-patch
sql/sql_yacc.yy:
Bug#30234: Anti-patch
additional fixes for 64-bit
mysql-test/t/variables.test:
replace 32-bit and 64-bit values
mysys/my_getopt.c:
'mod' no longer used.
on 64-bit, limit to (signed) (LONG)LONG_MAX to prevent badness
in classes using longlong.
When executing drop view statement on the master, the statement is written
into bin-log without checking for possible errors, so the statement would
always be bin-logged with error code cleared even if some error might occur,
for example, some of the views being dropped does not exist. This would cause
failure on the slave.
Writing bin-log after check for errors, if at least one view has been dropped
the query is bin-logged possible with an error.
sql/sql_view.cc:
Writing bin-log after check for errors, if at least one view has been dropped
the query is bin-logged possible with an error.
mysql-test/r/rpl_drop_view.result:
Add test result for bug#30998
mysql-test/t/rpl_drop_view.test:
Add test for bug#30998
into polly.(none):/home/kaa/src/maint/mysql-5.0-maint
mysql-test/t/insert.test:
Auto merged
mysql-test/t/variables.test:
Auto merged
sql/field.cc:
Auto merged
mysql-test/t/insert.test:
Windows implements a different rounding rules in printf("%g"), thus we still need to do replace_result
mysql-test/t/variables.test:
We need to do replace_result because variables are printed by another procedure.
sql/field.cc:
Fixed the code to limit the precision to DBL_DIG.
into mysql.com:/misc/mysql/31177/50-31177
client/mysql.cc:
Auto merged
mysql-test/r/subselect.result:
Auto merged
mysql-test/r/type_bit.result:
Auto merged
mysql-test/t/variables.test:
Auto merged
sql/mysqld.cc:
Auto merged
into polly.(none):/home/kaa/src/maint/mysql-5.0-maint
mysql-test/r/insert.result:
Auto merged
mysql-test/t/insert.test:
Auto merged
sql/field.cc:
Auto merged
mysql-test/r/insert.result:
Fixed the test cases.
mysql-test/t/cast.test:
We need to do replace_result because warnings are printed by another procedure.
mysql-test/t/insert.test:
Windows implements a different rounding rules in printf("%g"), thus we still need to do replace_result.
sql/field.cc:
Limit the precision to avoid garbage past the significant digits.
into polly.(none):/home/kaa/src/maint/mysql-5.0-maint
mysql-test/t/type_float.test:
Auto merged
mysql-test/t/variables.test:
Auto merged
sql/field.cc:
Auto merged
mysql-test/r/insert.result:
SCCS merged
mysql-test/t/insert.test:
SCCS merged
numbers into char fields" and bug #12860 "Difference in zero padding of
exponent between Unix and Windows"
Rewrote the code that determines what 'precision' argument should be
passed to sprintf() to fit the string representation of the input number
into the field.
We get finer control over conversion by pre-calculating the exponent, so
we are able to determine which conversion format, 'e' or 'f', will be
used by sprintf().
We also remove the leading zero from the exponent on Windows to make it
compatible with the sprintf() output on other platforms.
mysql-test/r/insert.result:
Added test cases for bug #26788 and bug #31152.
mysql-test/t/cast.test:
Removed --replace_result, since the result is now correct on Windows.
mysql-test/t/insert.test:
Added test cases for bug #26788 and bug #31152.
mysql-test/t/type_float.test:
Removed --replace_result, since the result is now correct on Windows.
mysql-test/t/variables.test:
Removed --replace_result, since the result is now correct on Windows.
sql/field.cc:
Rewrote the code that determines what 'precision' argument should be
passed to sprintf() to fit the string representation of the input number
into the field.
We get finer control over conversion by pre-calculating the exponent, so
we are able to determine which conversion format, 'e' or 'f', will be
used by sprintf().
Bug#31030 rpl000015.test fails if $MYSQL_TCP_PORT != 3306
Note:
This bug does not occur in MySQL 5.0 and up, because
ChangeSet 1.2328.2.1 2006/11/27 for MySQL 5.0 prevents this.
The 5.0 fix uses the environment variable DEFAULT_MASTER_PORT
which is set by mysql-test-run.pl.
mysql-test-run.pl in 4.1 does not set this variable.
There are two alternatives:
1) Backport the 5.0 fix for this test including modifications
to mysql-test-run.pl and mysql-test-run-shell.
This is a not acceptable impact on an old MySQL version.
2) Fix the problem different than in 5.0 like in the current
ChangeSet + do not apply these changes when upmerging to 5.0
mysql-test/r/rpl000015.result:
Updated result
mysql-test/t/disabled.def:
Enable rpl000015
mysql-test/t/rpl000015.test:
Unify the MASTER_PORT number
filesort() uses file->estimate_rows_upper_bound() call to allocate
internal buffers. If this function returns a value smaller than
a number of row that will be returned later in find_all_keys(),
that can cause server crash.
Fixed by implementing ha_federated::estimate_rows_upper_bound() to
return maximum possible number of rows.
Present estimation for FEDERATED always returns 0 if the linked to the VIEW.
mysql-test/r/federated.result:
Bug #32374 crash with filesort when selecting from federated table and view.
test result
mysql-test/t/federated.test:
Bug #32374 crash with filesort when selecting from federated table and view.
test case
sql/ha_federated.cc:
Bug #32374 crash with filesort when selecting from federated table and view.
ha_federated::estimate_rows_upper_bound() implemented
sql/ha_federated.h:
Bug #32374 crash with filesort when selecting from federated table and view.
ha_federated::estimate_rows_upper_bound() interface
Default values of variables were not subject to upper/lower bounds
and step, while setting variables was. Bounds and step are also
applied to defaults now; defaults are corrected quietly, values
given by the user are corrected, and a correction-warning is thrown
as needed. Lastly, very large values could wrap around, starting
from 0 again. They are bounded at the maximum value for the
respective data-type now if no lower maximum is specified in the
variable's definition.
client/mysql.cc:
correct maxima in options array
client/mysqltest.c:
adjust minimum for "sleep" option so default value is no longer
out of bounds.
include/m_string.h:
ullstr() - the unsigned brother of llstr()
include/my_getopt.h:
Flag if we bounded the value (that is, correct anything aside from
making value a multiple of block-size)
mysql-test/r/delayed.result:
We throw a warning now when we adjust out of range parameters.
mysql-test/r/index_merge.result:
We throw a warning now when we adjust out of range parameters.
mysql-test/r/innodb.result:
We throw a warning now when we adjust out of range parameters.
mysql-test/r/innodb_mysql.result:
We throw a warning now when we adjust out of range parameters.
mysql-test/r/key_cache.result:
We throw a warning now when we adjust out of range parameters.
mysql-test/r/packet.result:
We throw a warning now when we adjust out of range parameters.
mysql-test/r/ps.result:
We throw a warning now when we adjust out of range parameters.
mysql-test/r/subselect.result:
We throw a warning now when we adjust out of range parameters.
mysql-test/r/type_bit.result:
We throw a warning now when we adjust out of range parameters.
mysql-test/r/type_bit_innodb.result:
We throw a warning now when we adjust out of range parameters.
mysql-test/r/variables.result:
correct results: bounds and step apply to variables' default values, too
mysql-test/t/variables.test:
correct results: bounds and step apply to variables' default values, too
mysys/my_getopt.c:
- apply bounds/step to default values of variables (based on work by serg)
- print complaints about incorrect values for variables (truncation etc.,
by requestion of consulting)
- if no lower maximum is specified in variable definition, bound unsigned
values at their maximum to prevent wrap-around
- some calls to error_reporter had a \n, some didn't. remove \n from calls,
let reporter-function handle it, so the default reporter behaves like that
in mysqld
sql/mysql_priv.h:
correct RANGE_ALLOC_BLOCK_SIZE (cleared with monty)
sql/mysqld.cc:
correct maxima to correct data-type.
correct minima where higher than default.
correct range-alloc-block-size.
correct inno variables so GET_* corresponds to actual variable's type.
sql/set_var.cc:
When the new value for a variable is out of bounds, we'll send the
client a warning (but not if the value was simply not a multiple of
'blocksize'). sys_var_thd_ulong had this, sys_var_long_ptr_global
didn't; broken out and streamlined to avoid duplication of code.
strings/llstr.c:
ullstr() - the unsigned brother of llstr()
into mysql.com:/home/ram/work/b32676/b32676.5.0
mysql-test/r/delayed.result:
Auto merged
mysql-test/t/delayed.test:
Auto merged
sql/sql_insert.cc:
Auto merged
Kill of a CREATE TABLE source_table LIKE statement waiting for a
name-lock on the source table causes a bad lock interaction.
The mysql_create_like_table() has a bug that if the connection is
killed while waiting for the name-lock on the source table, it will
jump to the wrong error path and try to unlock the source table and
LOCK_open, but both weren't locked.
The solution is to simple return when the name lock request is killed,
it's safe to do so because no lock was acquired and no cleanup is needed.
Original bug report also contains description of other problems
related to this scenario but they either already fixed in 5.1 or
will be addressed separately (see bug report for details).
mysql-test/r/lock_multi.result:
Add test case result for Bug#31479
mysql-test/t/lock_multi.test:
Add test case for Bug#31479
sql/sql_table.cc:
Rerturn TRUE when the lock gets killed.
- fix for #31070 (missed during merging) applied for cp932 charset.
- tests/results adjusted.
mysql-test/include/ctype_common.inc:
Fix for bug #32726: crash with cast in order by clause and cp932 charset
- tests/results adjusted.
mysql-test/r/ctype_big5.result:
Fix for bug #32726: crash with cast in order by clause and cp932 charset
- tests/results adjusted.
mysql-test/r/ctype_cp932.result:
Fix for bug #32726: crash with cast in order by clause and cp932 charset
- tests/results adjusted.
mysql-test/r/ctype_euckr.result:
Fix for bug #32726: crash with cast in order by clause and cp932 charset
- tests/results adjusted.
mysql-test/r/ctype_gb2312.result:
Fix for bug #32726: crash with cast in order by clause and cp932 charset
- tests/results adjusted.
mysql-test/r/ctype_gbk.result:
Fix for bug #32726: crash with cast in order by clause and cp932 charset
- tests/results adjusted.
mysql-test/r/ctype_uca.result:
Fix for bug #32726: crash with cast in order by clause and cp932 charset
- tests/results adjusted.
mysql-test/t/ctype_cp932.test:
Fix for bug #32726: crash with cast in order by clause and cp932 charset
- tests/results adjusted.
strings/ctype-cp932.c:
Fix for bug #32726: crash with cast in order by clause and cp932 charset
- fix for #31070 (missed during merging) applied for cp932.
into lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.0-rt-merge
sql/mysqld.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
There's currently no way of knowing the determinicity of an UDF.
And the optimizer and the sequence() UDFs were making wrong
assumptions about what the is_const member means.
Plus there was no implementation of update_system_tables()
causing the optimizer to overwrite the information returned by
the <udf>_init function.
Fixed by equating the assumptions about the semantics of
is_const and providing a implementation of update_used_tables().
Added a TODO item for the UDF API change needed to make a better
implementation.
include/mysql_com.h:
Bug #30355: comment added
mysql-test/r/udf.result:
Bug #30355: test case
mysql-test/t/udf.test:
Bug #30355: test case
sql/item_func.cc:
Bug #30355: keep const_item_cache and used_tables_cache in sync
sql/item_func.h:
Bug #30355:
- a better implementation of update_used_tables()
- keep const_item_cache and used_tables_cache in sync
sql/udf_example.c:
Bug #30355: Wrong value for const_item fixed.
Problem: passing a non-constant name to the NAME_CONST function results in a crash.
Fix: check the NAME_CONST name argument; return fake item type if we got
non-constant argument(s).
mysql-test/r/func_misc.result:
Fix for bug #32559: connection hangs on query with name_const
- test result.
mysql-test/t/func_misc.test:
Fix for bug #32559: connection hangs on query with name_const
- test case.
sql/item.cc:
Fix for bug #32559: connection hangs on query with name_const
- Item_name_const::type() now returns NULL_ITEM if non-constant arguments
were used to create the item to avoid wrong type casting.
sql/item.h:
Fix for bug #32559: connection hangs on query with name_const
- NAME_CONST name argument checked for invariability.
self-join
When doing DELETE with self-join on a MyISAM or MERGE table, it could
happen that a record being retrieved in join_read_next_same() has
already been deleted by previous iterations. That caused the engine's
index_next_same() method to fail with HA_ERR_RECORD_DELETED error and
the whole DELETE query to be aborted with an error.
Fixed by suppressing the HA_ERR_RECORD_DELETED error in
hy_myisam::index_next_same() and ha_myisammrg::index_next_same(). Since
HA_ERR_RECORD_DELETED can only be returned by MyISAM, there is no point
in filtering this error in the SQL layer.
mysql-test/r/merge.result:
Added a test case for bug #28837.
mysql-test/r/myisam.result:
Added a test case for bug #28837.
mysql-test/t/merge.test:
Added a test case for bug #28837.
mysql-test/t/myisam.test:
Added a test case for bug #28837.
sql/ha_myisam.cc:
Skip HA_ERR_RECORD_DELETED silently when calling mi_rnext_same().
sql/ha_myisammrg.cc:
Skip HA_ERR_RECORD_DELETED silently when calling mi_rnext_same().
into magare.gmz:/home/kgeorge/mysql/autopush/B32036-5.0-opt
mysql-test/r/subselect.result:
merge of fix for bug 32036 to 5.0-opt
mysql-test/t/subselect.test:
merge of fix for bug 32036 to 5.0-opt
crashes MySQL 5.122
There was a difference in how UNIONs are handled
on top level and when in sub-query.
Because the rules for sub-queries were syntactically
allowing cases that are not currently supported by
the server we had crashes (this bug) or wrong results
(bug 32051).
Fixed by making the syntax rules for UNIONs match the
ones at top level.
These rules however do not support nesting UNIONs, e.g.
(SELECT a FROM t1 UNION ALL SELECT b FROM t2)
UNION
(SELECT c FROM t3 UNION ALL SELECT d FROM t4)
Supports for statements with nested UNIONs will be
added in a future version.
mysql-test/r/subselect.result:
Bug #32036: test case
mysql-test/t/subselect.test:
Bug #32036: test case
sql/sql_yacc.yy:
Bug #32036: Make the syntax rules for UNIONs in subqueries the same
as for top level UNIONs.
Problem: using wrong local lock type value in the mysql_insert() results in a crash.
Fix: use a proper value.
mysql-test/r/delayed.result:
Fix for bug #32676: insert delayed crash with wrong column and function specified
- test result.
mysql-test/t/delayed.test:
Fix for bug #32676: insert delayed crash with wrong column and function specified
- test case.
sql/sql_insert.cc:
Fix for bug #32676: insert delayed crash with wrong column and function specified
- the local lock_type var assigment displaced just after the line
where the table_list->lock_type is filnally defined in the mysql_insert()
to avoid using its old value.
Problem: INTERVAL function implementation doesn't handle NULL range values.
Fix: skip NULL ranges looking for a proper one.
mysql-test/r/func_set.result:
Fix for bug #32560: crash with interval function and count(*)
- test result.
mysql-test/t/func_set.test:
Fix for bug #32560: crash with interval function and count(*)
- test case.
sql/item_cmpfunc.cc:
Fix for bug #32560: crash with interval function and count(*)
- skip NULL ranges calculating INTERVAL(...).
Fix for the bug#31048 for 64bit platforms.
subselect.test, subselect.result:
Corrected text case for the bug#31048.
mysql-test/t/subselect.test:
Corrected text case for the bug#31048.
mysql-test/r/subselect.result:
Corrected text case for the bug#31048.
sql/opt_range.cc:
Fix for the bug#31048 for 64bit platforms.
FLUSH TABLES WITH READ LOCK fails to properly detect write locked
tables when running under low priority updates.
The problem is that when trying to aspire a global read lock, the
reload_acl_and_cache() function fails to properly check if the thread
has a low priority write lock, which later my cause a server crash or
deadlock.
The solution is to simple check if the thread has any type of the
possible exclusive write locks.
mysql-test/r/flush.result:
Add test case result for Bug#32528
mysql-test/t/flush.test:
Add test case for Bug#32528
sql/sql_parse.cc:
Although it should not matter under LOCK TABLES, use TL_WRITE_ALLOW_WRITE
to emphasize that it should fail in case of any write lock.
into dl145h.mysql.com:/data0/mkindahl/mysql-5.0-rpl-merge
client/mysql.cc:
Auto merged
mysql-test/r/ctype_ucs.result:
Auto merged
mysql-test/t/ctype_uca.test:
Auto merged
mysql-test/t/ctype_ucs.test:
Auto merged
mysql-test/t/subselect.test:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/mysqld.cc:
Auto merged
sql/sql_class.h:
Auto merged
is_last_prefix <= 0, file .\opt_range.cc.
SELECT ... GROUP BY bit field failed with an assertion if the
bit length of that field was not divisible by 8.
sql/key.cc:
Fixed bug #32556.
Copying of "uneven" bits of a bit field was duplicated in the
key_copy() and in the Field_bit::get_key_image().
So, instead of copying of the rest of a bit field,
Field_bit::get_key_image() copied "uneven" bits to key image again,
and the lowest field byte was not copied to key at all.
Duplicated code has been removed from the key_copy function.
mysql-test/t/type_bit.test:
Added test case for bug #32556.
mysql-test/r/type_bit.result:
Added test case for bug #32556.
Problem: setting Item_func_rollup_const::null_value property to argument's null_value
before (without) the argument evaluation may result in a crash due to wrong null_value.
Fix: use is_null() to set Item_func_rollup_const::null_value instead as it evaluates
the argument if necessary and returns a proper value.
mysql-test/r/olap.result:
Fix for bug #32558: group by null-returning expression with rollup causes crash
- test result.
mysql-test/t/olap.test:
Fix for bug #32558: group by null-returning expression with rollup causes crash
- test case.
sql/item_func.h:
Fix for bug #32558: group by null-returning expression with rollup causes crash
- use args[0]->is_null() to obtain Item_func_rollup_const::null_value
instead of args[0]->null_value as it's not set in advance in case of
constant functions.
into magare.gmz:/home/kgeorge/mysql/autopush/B30788-5.0-opt
sql/item.h:
Auto merged
sql/sql_select.cc:
Auto merged
mysql-test/r/subselect.result:
merge of 5.0-opt
mysql-test/t/subselect.test:
merge of 5.0-opt
Index lookup does not always guarantee that we can
simply remove the relevant conditions from the WHERE
clause. Reasons can be e.g. conversion errors,
partial indexes etc.
The optimizer was removing these parts of the WHERE
condition without any further checking.
This leads to "false positives" when using indexes.
Fixed by checking the index reference conditions
(using WHERE) when using indexes with sub-queries.
mysql-test/r/subselect.result:
Bug #30788:
- using where
- test case
mysql-test/r/subselect3.result:
Bug #30788: using where
mysql-test/t/subselect.test:
Bug #30788: test case
sql/item.h:
Bug #30788:
- Declare eq() method of Item_cache descendants : this is used in
test_if_ref()
- preserve the field that is being cached for type comparisions
sql/sql_select.cc:
Bug #30788: Don't remove the WHERE when using index lookup
with subqueries.
only on some occasions
Referencing an element from the SELECT list in a WHERE
clause is not permitted. The namespace of the WHERE
clause is the table columns only. This was not enforced
correctly when resolving outer references in sub-queries.
Fixed by not allowing references to aliases in a
sub-query in WHERE.
mysql-test/include/ps_query.inc:
Bug #32400: fixed old test queries
mysql-test/r/ps_2myisam.result:
Bug #32400: fixed old test queries
mysql-test/r/ps_3innodb.result:
Bug #32400: fixed old test queries
mysql-test/r/ps_4heap.result:
Bug #32400: fixed old test queries
mysql-test/r/ps_5merge.result:
Bug #32400: fixed old test queries
mysql-test/r/ps_6bdb.result:
Bug #32400: fixed old test queries
mysql-test/r/ps_7ndb.result:
Bug #32400: fixed old test queries
mysql-test/r/subselect.result:
Bug #32400: test case
mysql-test/t/subselect.test:
Bug #32400: test case
sql/item.cc:
Bug #32400: don't allow references to aliases in WHERE
tests/mysql_client_test.c:
Bug #32400: fixed old test queries
8bit escape characters, termination and enclosed characters
were silently ignored by SELECT INTO query, but LOAD DATA INFILE
algorithm is 8bit-clean, so data was corrupted during
encoding.
sql/sql_class.cc:
Fixed bug #32533.
SELECT INTO OUTFILE encoding was not 8bit clear, it
has been fixed for a symmetry with the LOAD DATA INFILE
decoding algorithm.
mysql-test/t/outfile_loaddata.test:
Added test case for bug #32533.
mysql-test/r/outfile_loaddata.result:
Added test case for bug #32533.
Loose index scan does the grouping so the temp table does
not need to do it, even when sorting.
Fixed by checking if the grouping is already done before
doing sorting and grouping in a temp table and do only
sorting.
mysql-test/r/group_min_max.result:
Bug #32268: test case
mysql-test/t/group_min_max.test:
Bug #32268: test case
sql/sql_select.cc:
Bug #32268: don't group in the temp table if already done
This bug is actually two. The first one manifests itself on an EXPLAIN
SELECT query with nested subqueries that employs the filesort algorithm.
The whole SELECT under explain is marked as UNCACHEABLE_EXPLAIN to preserve
some temporary structures for explain. As a side-effect of this values of
nested subqueries weren't cached and subqueries were re-evaluated many
times. Each time buffer for filesort was allocated but wasn't freed because
freeing occurs at the end of topmost SELECT. Thus all available memory was
eaten up step by step and OOM event occur.
The second bug manifests itself on SELECT queries with conditions where
a subquery result is compared with a key field and the subquery itself also
has such condition. When a long chain of such nested subqueries is present
the stack overrun occur. This happens because at some point the range optimizer
temporary puts the PARAM structure on the stack. Its size if about 8K and
the stack is exhausted very fast.
Now the subselect_single_select_engine::exec function allows subquery result
caching when the UNCACHEABLE_EXPLAIN flag is set.
Now the SQL_SELECT::test_quick_select function calls the check_stack_overrun
function for stack checking purposes to prevent server crash.
mysql-test/t/subselect.test:
Added a test case for the bug#31048: Many nested subqueries may cause server crash.
mysql-test/r/subselect.result:
Added a test case for the bug#31048: Many nested subqueries may cause server crash.
sql/opt_range.cc:
Bug#31048: Many nested subqueries may cause server crash.
Now the SQL_SELECT::test_quick_select function calls the check_stack_overrun
function for stack checking purposes to preven server crash.
sql/item_subselect.cc:
Bug31048: Many nested subqueries may cause server crash.
Now the subselect_single_select_engine::exec function allows subquery result
caching when the UNCACHEABLE_EXPLAIN flag is set.
bytes length.
The server has been modified to report warnings on truncation to
65536 bytes as usual.
sql/sql_string.cc:
Fixed bug #32282.
The well_formed_copy_nchars function returned an incorrect value
of copied bytes of the truncated input string: extra length of
the first truncated character added to the *from_end_pos pointer.
That has been fixed.
mysql-test/r/type_blob.result:
Added test case for bug #32282.
mysql-test/t/type_blob.test:
Added test case for bug #32282.
SPATIAL key is fine actually, but the chk_key() function
mistakenly returns error. It tries to compare checksums
of btree and SPATIAL keys while the checksum for the SPATIAL isn't
calculated (always 0). Same thing with FULLTEXT keys is handled
using full_text_keys counter, so fixed by counting both
SPATIAL and FULLTEXT keys in that counter.
myisam/mi_check.c:
Bug #30284 spatial key corruption
full_text_keys counts both FULL_TEXT and SPATIAL keys
mysql-test/r/gis.result:
Bug #30284 spatial key corruption
test result
mysql-test/t/gis.test:
Bug #30284 spatial key corruption.
test case
Comparison of a BIGINT NOT NULL column with a constant arithmetic
expression that evaluates to NULL caused error 1048: "Column '...'
cannot be null".
Made convert_constant_item() check if the constant expression is NULL
before attempting to store it in a field. Attempts to store NULL in a
NOT NULL field caused query errors.
sql/item_cmpfunc.cc:
Fixed bug #32335.
1. Made convert_constant_item() check if the constant expression is NULL
before attempting to store it in a field. Attempts to store NULL in
a NOT NULL field caused query errors.
2. Also minor bug has been fixed: the thd->count_cuted_fields value
was not restored in case of successful conversion.
mysql-test/t/select.test:
Added test case for bug #32335.
mysql-test/r/select.result:
Added test case for bug #32335.
Server failed in assert() when we tried to create a DECIMAL() temp field
with a scale of more than the allowed 30. Now we limit the scale to the
allowed maximum. A truncation warning is thrown as necessary.
mysql-test/r/type_newdecimal.result:
Show that out of range DECIMAL temp fields will no longer
stop the server with an assert.
mysql-test/t/type_newdecimal.test:
Show that out of range DECIMAL temp fields will no longer
stop the server with an assert.
sql/sql_select.cc:
When creating DECIMAL() temp field, ascertain we stay within allowed
limits. If not, truncate and warn.
into mysql.com:/home/hf/work/31158/my50-31158
mysql-test/t/gis.test:
Auto merged
sql/field.h:
Auto merged
sql/item_geofunc.cc:
Auto merged
mysql-test/r/gis.result:
merging
sql/field.cc:
merging
This is a regression from 2007-05-18 when code to zero out the returned struct was
added to number_to_datetime(); zero for time_type corresponds to MYSQL_TIMESTAMP_DATE.
We now explicitly set the type we return (MYSQL_TIMESTAMP_DATETIME).
mysql-test/r/func_time.result:
show that DATE_ADD() behaves the same for YYYYMMDDhhmmss given
as string and as integer.
mysql-test/t/func_time.test:
show that DATE_ADD() behaves the same for YYYYMMDDhhmmss given
as string and as integer.
sql-common/my_time.c:
explictly set return type in number_to_datetime()
checked for each record'
The problem was in incorrectly calculated length of the buffer used to
store a hexadecimal representation of an index map in
select_describe(). This could result in buffer overrun and stack
corruption under some circumstances.
Fixed by correcting the calculation.
mysql-test/r/explain.result:
Added a test case for bug #32241.
mysql-test/t/explain.test:
Added a test case for bug #32241.
sql/sql_select.cc:
Corrected the buffer length calculation. Count one hex digit as 4 bits,
not 8.
into mysql.com:/home/gluh/MySQL/Merge/5.0-opt
mysql-test/t/subselect.test:
Auto merged
mysql-test/t/variables.test:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_timefunc.cc:
Auto merged
mysql-test/r/select.result:
manual merge
mysql-test/t/select.test:
manual merge
Post-pushbuild fix
Added a purecov comment and a test for coverage of parallel
enable keys.
myisam/mi_check.c:
Bug#4692 - DISABLE/ENABLE KEYS waste a space
Added purecov comment.
mysql-test/r/myisam.result:
Bug#4692 - DISABLE/ENABLE KEYS waste a space
Added test result.
mysql-test/t/myisam.test:
Bug#4692 - DISABLE/ENABLE KEYS waste a space
Added test for coverage of parallel enable keys.
into mysql.com:/home/svoj/devel/mysql/BUG31277/mysql-5.0-engines
myisam/mi_check.c:
Auto merged
myisam/mi_open.c:
Auto merged
myisam/mi_packrec.c:
Auto merged
myisam/myisamchk.c:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
sql/mysql_priv.h:
Auto merged
include/mysql_com.h:
Use local.
sql-common/client.c:
Use local.
The columns in HAVING can reference the GROUP BY and
SELECT columns. There can be "table" prefixes when
referencing these columns. And these "table" prefixes
in HAVING use the table alias if available.
This means that table aliases are subject to the same
storage rules as table names and are dependent on
lower_case_table_names in the same way as the table
names are.
Fixed by :
1. Treating table aliases as table names
and make them lowercase when printing out the SQL
statement for view persistence.
2. Using case insensitive comparison for table
aliases when requested by lower_case_table_names
mysql-test/r/lowercase_view.result:
Bug #31562: test case
mysql-test/t/lowercase_view.test:
Bug #31562: test case
sql/item.cc:
Bug #31562: lower_case_table_name contious comparison
when searching in GROUP BY
sql/sql_base.cc:
Bug #31562: lower_case_table_name contious comparison
when searching in SELECT
sql/sql_select.cc:
Bug #31562: treat table aliases as table names
and make them lowercase when printing
max_length parameter for BLOB-returning functions must be big enough
for any possible content. Otherwise the field created for a table
will be too small.
mysql-test/r/gis.result:
Bug #31158 Spatial, Union, LONGBLOB vs BLOB bug (crops data)
test result
mysql-test/t/gis.test:
Bug #31158 Spatial, Union, LONGBLOB vs BLOB bug (crops data)
test case
sql/field.cc:
Bug #31158 Spatial, Union, LONGBLOB vs BLOB bug (crops data)
max_field_size used instead of numeric value
sql/field.h:
Bug #31158 Spatial, Union, LONGBLOB vs BLOB bug (crops data)
max_field_size constant defined
sql/item_geofunc.cc:
Bug #31158 Spatial, Union, LONGBLOB vs BLOB bug (crops data)
max_length parameter fixed
into mysql.com:/home/kent/bk/bug30069/mysql-5.0-build
mysql-test/t/bigint.test:
Auto merged
strings/ctype-simple.c:
Auto merged
mysql-test/r/bigint.result:
SCCS merged
into mysql.com:/home/svoj/devel/mysql/BUG32111/mysql-5.0-engines
mysql-test/r/symlink.result:
Auto merged
mysql-test/t/symlink.test:
Auto merged
mysys/my_symlink2.c:
Auto merged
When we insert a record into MYISAM table which is almost 'full',
we first write record data in the free space inside a file, and then
check if we have enough space after the end of the file.
So if we don't have the space, table will left corrupted.
Similar error also happens when we updata MYISAM tables.
Fixed by modifying write_dynamic_record and update_dynamic_record functions
to check for free space before writing parts of a record
BitKeeper/etc/ignore:
Added libmysql_r/client_settings.h libmysqld/ha_blackhole.cc to the ignore list
myisam/mi_dynrec.c:
Bug #31305 myisam tables crash when they are near capacity.
now we check space left in table in write_dynamic_record
and update_dynamic_record functions.
If we don't have enough room for the new (updated) record, return with the
error.
mysql-test/r/almost_full.result:
New BitKeeper file ``mysql-test/r/almost_full.result''
mysql-test/t/almost_full.test:
New BitKeeper file ``mysql-test/t/almost_full.test''
After adding an index the <VARBINARY> IN (SELECT <BINARY> ...)
clause returned a wrong result: the VARBINARY value was illegally padded
with zero bytes to the length of the BINARY column for the index search.
(<VARBINARY>, ...) IN (SELECT <BINARY>, ... ) clauses are affected too.
sql/item.cc:
Fixed bug #28076.
The Item_cache_str::save_in_field method has been overloaded
to check cached values for an illegal padding before the saving
into a field.
sql/item.h:
Fixed bug #28076.
The Item_cache_str::is_varbinary flag has been added and the
Item_cache_str::save_in_field method has been overloaded to prevent
cached values from an illegal padding when saving in fields.
The signature of the Item_cache::get_cache method has been
changed to accept pointers to Item instead of Item_result
values.
sql/item_cmpfunc.cc:
Fixed bug #28076.
The Item_in_optimizer::fix_left method has been modified to
to call Item_cache::get_cache in a new manner.
sql/item_subselect.cc:
Fixed bug #28076.
The subselect_indexsubquery_engine::exec method has been
modified to take into account field conversion errors
(copy&paste from subselect_uniquesubquery_engine::exec).
sql/sp_rcontext.cc:
Fixed bug #28076.
The sp_rcontext::create_case_expr_holder method has been
modified to call Item_cache::get_cache in a new manner.
sql/sp_rcontext.h:
Fixed bug #28076.
The sp_rcontext::create_case_expr_holder method signature
has been modified to pass Item pointers to the
Item_cache::get_cache method.
sql/sql_class.cc:
Fixed bug #28076.
The select_max_min_finder_subselect::send_data method has been
modified to call Item_cache::get_cache in a new manner.
mysql-test/t/subselect.test:
Added test case for bug #28076.
mysql-test/r/subselect.result:
Added test case for bug #28076.
BETWEEN was more lenient with regard to what it accepted as a DATE/DATETIME
in comparisons than greater-than and less-than were. ChangeSet makes < >
comparisons similarly robust with regard to trailing garbage (" GMT-1")
and "missing" leading zeros. Now all three comparators behave similarly
in that they throw a warning for "junk" at the end of the data, but then
proceed anyway if possible. Before < > fell back on a string- (rather than
date-) comparison when a warning-condition was raised in the string-to-date
conversion. Now the fallback only happens on actual errors, while warning-
conditions still result in a warning being to delivered to the client.
mysql-test/r/select.result:
Show that we compare DATE/DATETIME-like strings as date(time)s
now, rather than as bin-strings.
Adjust older result as "2005-09-3a" is now correctly seen as
"2005-09-3" + trailing garbage, rather than as "2005-09-30".
mysql-test/t/select.test:
Show that we compare DATE/DATETIME-like strings as date(time)s
now, rather than as bin-strings.
sql-common/my_time.c:
correct/clarify date-related comments, particulary for check_date().
doxygenize comment while at it.
sql/item_cmpfunc.cc:
get_date_from_str() no longer signals an error when all we had
was a warning-condition -- and one we already gave the user a
warning for at that. Preamble doxygenized.
The bug is a regression introduced by the fix for bug30596. The problem
was that in cases when groups in GROUP BY correspond to only one row,
and there is ORDER BY, the GROUP BY was removed and the ORDER BY
rewritten to ORDER BY <group_by_columns> without checking if the
columns in GROUP BY and ORDER BY are compatible. This led to
incorrect ordering of the result set as it was sorted using the
GROUP BY columns. Additionaly, the code discarded ASC/DESC modifiers
from ORDER BY even if its columns were compatible with the GROUP BY
ones.
This patch fixes the regression by checking if ORDER BY columns form a
prefix of the GROUP BY ones, and rewriting ORDER BY only in that case,
preserving the ASC/DESC modifiers. That check is sufficient, since the
GROUP BY columns contain a unique index.
mysql-test/r/group_by.result:
Added a test case for bug #32202.
mysql-test/t/group_by.test:
Added a test case for bug #32202.
sql/sql_select.cc:
In cases when groups in GROUP BY correspond to only one row and there
is ORDER BY, rewrite the query to ORDER BY <group_by_columns> only if
the columns in ORDER BY and GROUP BY are compatible, i.e. either one
forms a prefix for another.
When running mysqlbinlog on a 64-bit machine with a corrupt relay log,
it causes mysqlbinlog to crash. In this case, the crash is caused
because a request for 18446744073709534806U bytes is issued, which
apparantly can be served on a 64-bit machine (speculatively, I assume)
but this causes the memcpy() issued later to copy the data to segfault.
The request for the number of bytes is caused by a computation
of data_len - server_vars_len where server_vars_len is corrupt in such
a sense that it is > data_len. This causes a wrap-around, with the
the data_len given above.
This patch adds a check that if server_vars_len is greater than
data_len before the substraction, and aborts reading the event in
that case marking the event as invalid. It also adds checks to see
that reading the server variables does not go outside the bounds
of the available space, giving a limited amount of integrity check.
mysql-test/r/mysqlbinlog.result:
Result change.
mysql-test/t/mysqlbinlog.test:
Adding test that it fails gracefully for a corrupt relay log.
sql/log_event.cc:
Adding check that status var length does not cause wrap-around
when performing subtraction. Extending get_str_len_and_pointer() to
check that the string can actually be read without reading outside
bounds. Adding checks when reading server variables from the Query-
log_event so that the variable can really be read. Abort reading
and mark the event as invalid otherwise.
mysql-test/std_data/corrupt-relay-bin.000624:
BitKeeper file /home/mats/devel/b31793-mysql-5.0-rpl/mysql-test/std_data/corrupt-relay-bin.000624
causes out of memory errors
The code in mysql_create_function() and mysql_drop_function() assumed
that the only reason for UDFs being uninitialized at that point is an
out-of-memory error during initialization. However, another possible
reason for that is the --skip-grant-tables option in which case UDF
initialization is skipped and UDFs are unavailable.
The solution is to check whether mysqld is running with
--skip-grant-tables and issue a proper error in such a case.
mysql-test/r/skip_grants.result:
Added a test case for bug #32020.
mysql-test/t/skip_grants.test:
Added a test case for bug #32020.
sql/sql_udf.cc:
Issue a proper error when a user tries to CREATE/DROP a UDF
on a server running with the --skip-grant-tables option.
HOUR(), MINUTE(), ... returned spurious results when used on a DATE-cast.
This happened because DATE-cast object did not overload get_time() method
in superclass Item. The default method was inappropriate here and
misinterpreted the data.
Patch adds missing method; get_time() on DATE-casts now returns SQL-NULL
on NULL input, 0 otherwise. This coincides with the way DATE-columns
behave.
mysql-test/r/cast.result:
Show that HOUR(), MINUTE(), ... return sensible values when used
on DATE-cast objects, namely NULL for NULL-dates and 0 otherwise.
Show that this coincides with how DATE-columns behave.
mysql-test/t/cast.test:
Show that HOUR(), MINUTE(), ... return sensible values when used
on DATE-cast objects, namely NULL for NULL-dates and 0 otherwise.
Show that this coincides with how DATE-columns behave.
sql/item_timefunc.cc:
Add get_time() method to DATE-cast object to overload
the method in Item superclass that would return spurious
results. Return zero-result; flag NULL if input was NULL.
sql/item_timefunc.h:
Add get_time() declaration to DATE-cast object.
When constructing a key image stricter date checking (from sql_mode)
should not be enabled, because it will reject invalid dates that the
server would otherwise accept for searching when there's no index.
Fixed by disabling strict date checking when constructing a key image.
mysql-test/r/type_date.result:
Bug #31928: test case
mysql-test/t/type_date.test:
Bug #31928: test case
sql/sql_select.h:
Bug #31928: Disable strict date checking when consructing
a key image
variable in where clause.
Problem: the new_item() method of Item_uint used an incorrect
constructor. "new Item_uint(name, max_length)" calls
Item_uint::Item_uint(const char *str_arg, uint length) which assumes the
first argument to be the string representation of the value, not the
item's name. This could result in either a server crash or incorrect
results depending on usage scenarios.
Fixed by using the correct constructor in new_item():
Item_uint::Item_uint(const char *str_arg, longlong i, uint length).
mysql-test/r/select.result:
Added a test case for bug #32103.
mysql-test/t/select.test:
Added a test case for bug #32103.
sql/item.h:
Use the correct constructor for Item_uint in Item_uint::new_item().
tables or more
The problem was that the optimizer used the join buffer in cases when
the result set is ordered by filesort. This resulted in the ORDER BY
clause being ignored, and the records being returned in the order
determined by the order of matching records in the last table in join.
Fixed by relaxing the condition in make_join_readinfo() to take
filesort-ordered result sets into account, not only index-ordered ones.
mysql-test/r/select.result:
Added a test case for bug #30666.
mysql-test/t/select.test:
Added a test case for bug #30666.
sql/sql_select.cc:
Relaxed the condition to determine when the join buffer usage must be
disabled. The condition is now true for cases when the result set is
ordered by filesort, that is when 'join->order &&
!join->skip_sort_order' is true.
With certain data sets (when compressed record length gets bigger than
uncompressed) myisamchk --unpack may corrupt data file.
Fixed that record length was wrongly restored from compressed table.
myisam/mi_check.c:
With compressed tables compressed record length may be bigger than
pack_reclength, thus we may allocate insufficient memory for record
buffer.
Let single function allocate record buffer, performing needed record
length calculations.
Still, it is not doable with parallel repair, as it allocates needed
record buffers at once. For parellel repair added better record length
calculation.
myisam/mi_open.c:
When calculating record buffer size, take into account that compressed
record length may be bigger than uncompressed.
myisam/mi_packrec.c:
With certain data set share->max_pack_length (compressed record length)
may be bigger than share->base.pack_reclength (packed record length).
set_if_bigger(pack_reclength, max_pack_length) in this case causes
myisamchk --unpack to write extra garbage, whereas pack_reclength
remains the same in new index file. As a result we get unreadable
table.
myisam/myisamchk.c:
With compressed tables compressed record length may be bigger than
pack_reclength, thus we may allocate insufficient memory for record
buffer.
Let single function allocate record buffer, performing needed record
length calculations.
mysql-test/mysql-test-run.pl:
Environment variables to execute myisamchk and myisampack.
mysql-test/r/myisampack.result:
New BitKeeper file ``mysql-test/r/myisampack.result''
mysql-test/t/myisampack.test:
New BitKeeper file ``mysql-test/t/myisampack.test''
Problem: calling non-constant argument's val_xxx() methods
in the ::fix_length_and_dec() is inadmissible.
Fix: call the method only for constant arguments.
mysql-test/r/ps.result:
Fix for bug #32137: prepared statement crash with str_to_date in update clause
- test result.
mysql-test/t/ps.test:
Fix for bug #32137: prepared statement crash with str_to_date in update clause
- test case.
sql/item_timefunc.cc:
Fix for bug #32137: prepared statement crash with str_to_date in update clause
- call argument's val_str() only for constant items in the
Item_func_str_to_date::fix_length_and_dec().
refining non-deterministic tests.
The new Bug@32148 is in the way. Adjuting the tests to be somehow useful.
mysql-test/r/binlog_killed.result:
results changed
mysql-test/t/binlog_killed.test:
refining the tests as killing is inherently non-deterministic;
leaving todos.
RENAME TABLE against a table with DATA/INDEX DIRECTORY overwrites
the file to which the symlink points.
This is security issue, because it is possible to create a table with
some name in some non-system database and set DATA/INDEX DIRECTORY
to mysql system database. Renaming this table to one of mysql system
tables (e.g. user, host) would overwrite the system table.
Return an error when the file to which the symlink points exist.
mysql-test/r/symlink.result:
A test case for BUG#32111.
mysql-test/t/symlink.test:
A test case for BUG#32111.
mysys/my_symlink2.c:
Return an error when the file to which the symlink points exist.
removing extra tests (on 5.1 that's been already done)
BitKeeper/deleted/.del-binlog_killed_bug27571-master.opt:
Delete: mysql-test/t/binlog_killed_bug27571-master.opt
BitKeeper/deleted/.del-binlog_killed_bug27571.test:
Delete: mysql-test/t/binlog_killed_bug27571.test
Disabling and enabling indexes on a non-empty table grows the
index file.
Disabling indexes just sets a flag per non-unique index and does not
free the index blocks of the affected indexes. Re-enabling indexes
creates new indexes with new blocks. The old blocks remain unused
in the index file.
Fixed by dropping and re-creating all indexes if non-empty disabled
indexes exist when enabling indexes. Dropping all indexes resets
the internal end-of-file marker to the end of the index file header.
It also clears the root block pointers of every index and clears the
deleted blocks chains. This way all blocks are declared as free.
myisam/mi_check.c:
Bug#4692 - DISABLE/ENABLE KEYS waste a space
Added function mi_drop_all_indexes() to support drop of all indexes
in case we want to re-enable non-empty disabled indexes.
Changed mi_repair(), mi_repair_by_sort(), and mi_repair_parallel()
to use the new function instead of duplicate drop index code.
mysql-test/r/myisam.result:
Bug#4692 - DISABLE/ENABLE KEYS waste a space
Added test result.
mysql-test/t/myisam.test:
Bug#4692 - DISABLE/ENABLE KEYS waste a space
Added test.
commit is specific for 5.0 to eliminated non-deterministic tests.
Those tests run only in 5.1 env where there is a necessary devices such
as processlist table of info_schema.
mysql-test/r/binlog_killed.result:
results changed
mysql-test/t/binlog_killed.test:
removing non-deterministic part of the test
mysql-test/t/binlog_killed_simulate.test:
adding the guard same as for 5.1 version
Bug #31956 auto increment bugs in MySQL Cluster: Added utility method and constant for internal prefetch default
ndb_auto_increment.result:
BitKeeper file /home/marty/MySQL/mysql-5.0-ndb/mysql-test/r/ndb_auto_increment.result
mysqld.cc:
Bug #25176 Trying to set ndb_autoincrement_prefetch_sz always fails: Changed pointer to max value
Bug #31956 auto increment bugs in MySQL Cluster: Changed meaning of ndb_autoincrement_prefetch_sz to specify prefetch between statements, changed default to 1 (with internal prefetch to at least 32 inside a statement)
ndb_insert.test, ndb_insert.result:
Moved auto_increment tests to ndb_auto_increment.test
ndb_auto_increment.test:
BitKeeper file /home/marty/MySQL/mysql-5.0-ndb/mysql-test/t/ndb_auto_increment.test
ha_ndbcluster.cc:
Bug #31956 auto increment bugs in MySQL Cluster: Changed meaning of ndb_autoincrement_prefetch_sz to specify prefetch between statements, changed default to 1 (with internal prefetch to at least 32 inside a statement), added handling of updates of pk/unique key with auto_increment
Bug #32055 Cluster does not handle auto inc correctly with insert ignore statement
sql/mysqld.cc:
Bug #25176 Trying to set ndb_autoincrement_prefetch_sz always fails: Changed pointer to max value
Bug #31956 auto increment bugs in MySQL Cluster: Changed meaning of ndb_autoincrement_prefetch_sz to specify prefetch between statements, changed default to 1 (with internal prefetch to at least 32 inside a statement)
sql/ha_ndbcluster.h:
Bug #31956 auto increment bugs in MySQL Cluster: Added utility method and constant for internal prefetch default
sql/ha_ndbcluster.cc:
Bug #31956 auto increment bugs in MySQL Cluster: Changed meaning of ndb_autoincrement_prefetch_sz to specify prefetch between statements, changed default to 1 (with internal prefetch to at least 32 inside a statement), added handling of updates of pk/unique key with auto_increment
Bug #32055 Cluster does not handle auto inc correctly with insert ignore statement
mysql-test/r/ndb_auto_increment.result:
BitKeeper file /home/marty/MySQL/mysql-5.0-ndb/mysql-test/r/ndb_auto_increment.result
mysql-test/t/ndb_auto_increment.test:
BitKeeper file /home/marty/MySQL/mysql-5.0-ndb/mysql-test/t/ndb_auto_increment.test
mysql-test/t/ndb_insert.test:
Moved auto_increment tests to ndb_auto_increment.test
mysql-test/r/ndb_insert.result:
Moved auto_increment tests to ndb_auto_increment.test
Since bug@20166, which replaced the binlog file name generating to base
on pidfile_name instead of the previous glob_hostname, the binlog file
name suddenly started to be stored solely in the absolute path format,
including a case when --log-bin option meant a relative path.
What's more serious, the path for binlog file can lead unrequestedly
to pid-file directory so that after any proper fix for this bug
there might be similar to the bug report consequences for one who
upgrades from post-fix-bug@20166-pre-fix-bug@28597 to post-fix-bug@28597.
Fixed with preserving`pidfile_name' (intr.by bug@20166) but stripping
off its directory part. This restores the original logics of storing
the names in compatible with --log-bin option format and with the
requirement for --log-bin ralative path to corresond to the data directory.
Side effects for this fix:
effective fixing bug@27070, refining its test;
ensuring no overrun for buff can happen anymore (Bug#31836
insufficient space reserved for the suffix of relay log file name);
bug#31837 --remove_file $MYSQLTEST_VARDIR/tmp/bug14157.sql missed
in rpl_temporary.test;
fixes Bug@28603 Invalid log-bin default location;
mysql-test/t/rpl_dual_pos_advance.test:
After correcting the logics of log file name composing workaround for
Bug #27070 server logs are created unrequested and in wrong directory
is removed.
mysql-test/t/rpl_temporary.test:
remaining temp file of the test removed
sql/log.cc:
stripping off the directory part of `pidfile_name' for binlog name
generating (which fixes two more bugs on wrong binlog file location);
ensuring no overrun for buff can happen anymore (Bug #31836
insufficient space reserved for the suffix of relay log file name);
into mysql.com:/home/hf/work/31758/my50-31758
mysql-test/t/func_str.test:
Auto merged
mysql-test/r/func_str.result:
merging
sql/item_strfunc.h:
merging
Comment sign of -- at line begin in test files lead to warnings
from mysqltest.
Changed -- to #.
mysql-test/t/subselect.test:
Bug#32108 - subselect.test produces warnings files
Changed -- to # at comment begin to avoid warnings files.
Comment sign of -- at line begin in test files lead to warnings
from mysqltest.
Changed -- to #.
mysql-test/t/ctype_uca.test:
Bug#32107 - ctype_uca.test produces warnings files
Changed -- to # at comment begin to avoid warnings files.