If the ::single_value_transformer() find an existing HAVING condition it used
to do the transformation:
1) HAVING cond -> (HAVING Cond) AND (cond_guard (Item_ref_null_helper(...))
As the AND condition in 1) is Mc'Carty evaluated, the
right side of the AND cond should be executed only if the
original 'HAVING evaluated' to true.
However, as we failed to set 'top_level' for the tranformed HAVING condition,
'abort_on_null' was FALSE after transformation. An
UNKNOWN having condition will then not terminate evaluation of the
transformed having condition, and we incorrectly continued
into the Item_ref_null_helper() part.
When the optimizer creates items out of other items it does
not have to call the fix_fields method. Usually in these
cases it calls quick_fix_field() that just marks the
created item as fixed. If the created item is an Item_func
object then calling quick_fix_field() works fine if the
arguments of the created functional item are already fixed.
Otherwise some unfixed nodes remain in the item tree and
it triggers an assertion failure whenever the item is
evaluated.
Fixed the problem by making the method quick_fix_field
virtual and providing an implementation for the class
Item_func objects that recursively calls the method
for unfixed arguments of any functional item.
- Fixed problem with oqgraph and 'make dist'
Note that after this merge we have a problem show in join_outer where we examine too many rows in one specific case (related to BUG#57024).
This will be fixed when mwl#128 is merged into 5.3.
Registration of pointer change if we assign it to other pointer which should be identical after statement execution (PS/SP).
mysql-test/r/subselect.result:
Test suite.
mysql-test/t/subselect.test:
Test suite.
sql/sql_class.cc:
The procedure of the pointer registration.
sql/sql_class.h:
The procedure of the pointer registration.
sql/sql_lex.cc:
Registration of pointer change if we assign it to other pointer which should be identical after statement execution (PS/SP).
This bug was introduced in this revision:
kostja@sun.com-20100727102553-b4n2ojcyfj79l2x7
("A pre-requisite patch for the fix for Bug#52044.")
It happens because close_thread_tables() is now called in
open_and_lock_tables upon failure. Hence, table is no longer
open when optimizer tries to do cleanup.
Fix: Make sure to do cleanup in st_select_lex_unit::prepare()
upon failure. This way, cleanup() is called before tables are
released.
mysql-test/r/subselect.result:
Added test case for Bug#57704.
mysql-test/t/subselect.test:
Added test case for Bug#57704.
sql/sql_union.cc:
st_select_lex_unit::prepare(): On failure, make sure cleanup()
is called.
This bug was introduced in this revision:
kostja@sun.com-20100727102553-b4n2ojcyfj79l2x7
("A pre-requisite patch for the fix for Bug#52044.")
It happens because close_thread_tables() is now called in
open_and_lock_tables upon failure. Hence, table is no longer
open when optimizer tries to do cleanup.
Fix: Make sure to do cleanup in st_select_lex_unit::prepare()
upon failure. This way, cleanup() is called before tables are
released.
union...order by (select... where...)
The problem is mysql is trying to materialize and
cache the scalar sub-queries at JOIN::optimize
even for EXPLAIN where the number of columns is
totally different from what's expected.
Fixed by not executing the scalar subqueries
for EXPLAIN.
union...order by (select... where...)
The problem is mysql is trying to materialize and
cache the scalar sub-queries at JOIN::optimize
even for EXPLAIN where the number of columns is
totally different from what's expected.
Fixed by not executing the scalar subqueries
for EXPLAIN.
on index
'my_decimal' class has two members which can be used to access the
value. The member variable buf (inherited from parent class decimal_t)
is set to member variable buffer so that both are pointing to same value.
Item_copy_decimal::copy() uses memcpy to clone 'my_decimal'. The member
buffer is declared as an array and memcpy results in copying the values
of the array, but the inherited member buf, which should be pointing at
the begining of the array 'buffer' starts pointing to the begining of
buffer in original object (which is being cloned). Further updates on
'my_decimal' updates only the inherited member 'buf' but leaves
buffer unchanged.
Later when the new object (which now holds a inconsistent value) is cloned
again using proper cloning function 'my_decimal2decimal' the buf pointer
is fixed resulting in loss of the current value.
Using my_decimal2decimal instead of memcpy in Item_copy_decimal::copy()
fixed this problem.
mysql-test/r/subselect.result:
Updated result file after addding test case for bug#47904.
mysql-test/t/subselect.test:
Added test case for bug#47904.
sql/item.cc:
Memcopy shouldn't be used to clone my_decimal. Use my_decimal2decimal
instead.
on index
'my_decimal' class has two members which can be used to access the
value. The member variable buf (inherited from parent class decimal_t)
is set to member variable buffer so that both are pointing to same value.
Item_copy_decimal::copy() uses memcpy to clone 'my_decimal'. The member
buffer is declared as an array and memcpy results in copying the values
of the array, but the inherited member buf, which should be pointing at
the begining of the array 'buffer' starts pointing to the begining of
buffer in original object (which is being cloned). Further updates on
'my_decimal' updates only the inherited member 'buf' but leaves
buffer unchanged.
Later when the new object (which now holds a inconsistent value) is cloned
again using proper cloning function 'my_decimal2decimal' the buf pointer
is fixed resulting in loss of the current value.
Using my_decimal2decimal instead of memcpy in Item_copy_decimal::copy()
fixed this problem.
This patch does three things:
- It adds the possibility to force the execution of top-level [NOT] IN
subquery predicates via the IN=>EXISTS transformation. This is done by
setting both optimizer switches partial_match_rowid_merge and
partial_match_table_scan to "off".
- It adjusts all test cases where the complete optimizer_switch is
selected because now we have two more switches.
- For those test cases where the plan changes because of the new available
strategies, we switch off both partial match strategies in order to
force the "old" IN=>EXISTS strategy. This is done because most of these
test cases specifically test bugs in this strategy.
sql/opt_subselect.cc:
Adds the possibility to force the execution of top-level [NOT] IN
subquery predicates via the IN=>EXISTS transformation. This is done by
setting both optimizer switches partial_match_rowid_merge and
partial_match_table_scan to "off".
subselect_single_select_engine::exec()
When a subquery doesn't need to be evaluated because
it returns only aggregate functions and these aggregates
can be calculated from the metadata about the table it
was not updating all the relevant members of the JOIN
structure to reflect that this is a constant query.
This caused problems to the enclosing subquery
('<> SOME' in the test case above) trying to read some
data about the tables.
Fixed by setting const_tables to the number of tables
when the SELECT is optimized away.
error in the query.
Fixes a leak after materializing a GROUP BY subquery to a
temp table when the subquery has a blob column in the SELECT
list.
Fixed by correctly destructing temporary buffers after doing
the conversion.
subselect_single_select_engine::exec()
When a subquery doesn't need to be evaluated because
it returns only aggregate functions and these aggregates
can be calculated from the metadata about the table it
was not updating all the relevant members of the JOIN
structure to reflect that this is a constant query.
This caused problems to the enclosing subquery
('<> SOME' in the test case above) trying to read some
data about the tables.
Fixed by setting const_tables to the number of tables
when the SELECT is optimized away.
error in the query.
Fixes a leak after materializing a GROUP BY subquery to a
temp table when the subquery has a blob column in the SELECT
list.
Fixed by correctly destructing temporary buffers after doing
the conversion.
error in the query.
Fixes a leak after materializing a GROUP BY subquery to a
temp table when the subquery has a blob column in the SELECT
list.
Fixed by correctly destructing temporary buffers for re-usable
queries
error in the query.
Fixes a leak after materializing a GROUP BY subquery to a
temp table when the subquery has a blob column in the SELECT
list.
Fixed by correctly destructing temporary buffers for re-usable
queries
int join_read_key(JOIN_TAB*)
The eq_ref access method TABLE_REF (accessed through
JOIN_TAB) to save state and to track if this is the
first row it finds or not.
This state was not reset on subquery re-execution
causing an assert.
Fixed by resetting the state before the subquery
re-execution.
int join_read_key(JOIN_TAB*)
The eq_ref access method TABLE_REF (accessed through
JOIN_TAB) to save state and to track if this is the
first row it finds or not.
This state was not reset on subquery re-execution
causing an assert.
Fixed by resetting the state before the subquery
re-execution.
int join_read_key(JOIN_TAB*)
The eq_ref access method TABLE_REF (accessed through
JOIN_TAB) to save state and to track if this is the
first row it finds or not.
This state was not reset on subquery re-execution
causing an assert.
Fixed by resetting the state before the subquery
re-execution.
int join_read_key(JOIN_TAB*)
The eq_ref access method TABLE_REF (accessed through
JOIN_TAB) to save state and to track if this is the
first row it finds or not.
This state was not reset on subquery re-execution
causing an assert.
Fixed by resetting the state before the subquery
re-execution.
- Moved some code from innodb_plugin to xtradb, to ensure that all tests runs
- Did changes in pbxt and maria storage engines becasue of changes in thd->query
- Reverted wrong code in sql_table.cc for how ROW_FORMAT is used.
This is a re-commit of Monty's merge to eliminate an extra commit from
MySQL-5.1.42 that was accidentally included in the merge.
This is a merge of the MySQL 5.1.41 clone-off (clone-5.1.41-build). In
case there are any extra changes done before final MySQL 5.1.41
release, these will need to be merged later before MariaDB 5.1.41
release.
mysql-next-mr-bugfixing.
Bug no 32858 was fixed in two different ways in what was
then called mysql 5.1 and 6.0. The fix in 6.0 was very
different since bugfix no 33204 was present. Furthermore,
the two fixes were not compatible. Hence in order to
backport Bug#33204 to the 5.1-based mysql-next-mr-bugfixing,
it was necessary to remove the 5.1 fix of 32858 and apply
the 6.0 version of the fix.
mysql-test/r/subselect.result:
Bug#33204-backport: Test result
mysql-test/r/union.result:
Bug#33204-backport:
- Reversal of test result: bugfix no 32858 for 5.1
- Application of test result: bugfix no 32858 for 6.0
mysql-test/t/subselect.test:
Bug#33204-backport:
- Changed tests
- Test case
mysql-test/t/union.test:
Bug#33204-backport:
- Reversal of test: bugfix no 32858 for 5.1
- Application of test: bugfix no 32858 for 6.0
sql/sql_class.cc:
Bug#33204-backport: Reversal of bugfix no 32858 for 5.1
sql/sql_class.h:
Bug#33204-backport: Reversal of bugfix no 32858 for 5.1
sql/sql_yacc.yy:
Bug#33204-backport:
- Reversal of bugfix no 32858 for 5.1
- Application of bugfix no 32858 for 6.0
- Application of bugfix no 33204
mysql-next-mr-bugfixing.
Bug no 32858 was fixed in two different ways in what was
then called mysql 5.1 and 6.0. The fix in 6.0 was very
different since bugfix no 33204 was present. Furthermore,
the two fixes were not compatible. Hence in order to
backport Bug#33204 to the 5.1-based mysql-next-mr-bugfixing,
it was necessary to remove the 5.1 fix of 32858 and apply
the 6.0 version of the fix.
having clause...
The fix for bug 46184 was not very complete. It was not covering
views using temporary tables and multiple tables in a FROM clause.
Fixed by reverting the fix for 46184 and making a more general
check that is checking at the right execution stage and for all
of the non-supported cases.
Now PROCEDURE ANALYZE on non-top level SELECT is also forbidden.
Updated the analyse.test and subselect.test accordingly.
having clause...
The fix for bug 46184 was not very complete. It was not covering
views using temporary tables and multiple tables in a FROM clause.
Fixed by reverting the fix for 46184 and making a more general
check that is checking at the right execution stage and for all
of the non-supported cases.
Now PROCEDURE ANALYZE on non-top level SELECT is also forbidden.
Updated the analyse.test and subselect.test accordingly.
* Finished Monty and Jani's merge
* Some InnoDB tests still fail (because it's old xtradb code run against
newer testsuite). They are expected to go after mergning with the latest
xtradb.
field references
This error requires a combination of factors :
1. An "impossible where" in the outermost SELECT
2. An aggregate in the outermost SELECT
3. A correlated subquery with a WHERE clause that includes an outer
field reference as a top level WHERE sargable predicate
When JOIN::optimize detects an "impossible WHERE" it will bail out
without doing the rest of the work and initializations. It will not
call make_join_statistics() as well. And make_join_statistics fills
in various structures for each table referenced.
When processing the result of the "impossible WHERE" the query must
send a single row of data if there are aggregate functions in it.
In this case the server marks all the aggregates as having received
no rows and calls the relevant Item::val_xxx() method on the SELECT
list. However if this SELECT list happens to contain a correlated
subquery this subquery is evaluated in a normal evaluation mode.
And if this correlated subquery has a reference to a field from the
outermost "impossible where" SELECT the add_key_fields will mistakenly
consider the outer field reference as a "local" field reference when
looking for sargable predicates.
But since the SELECT where the outer field reference refers to is not
completely initialized due to the "impossible WHERE" in this level
we'll get a NULL pointer reference.
Fixed by making a better condition for discovering if a field is "local"
to the SELECT level being processed.
It's not enough to look for OUTER_REF_TABLE_BIT in this case since
for outer references to constant tables the Item_field::used_tables()
will return 0 regardless of whether the field reference is from the
local SELECT or not.
field references
This error requires a combination of factors :
1. An "impossible where" in the outermost SELECT
2. An aggregate in the outermost SELECT
3. A correlated subquery with a WHERE clause that includes an outer
field reference as a top level WHERE sargable predicate
When JOIN::optimize detects an "impossible WHERE" it will bail out
without doing the rest of the work and initializations. It will not
call make_join_statistics() as well. And make_join_statistics fills
in various structures for each table referenced.
When processing the result of the "impossible WHERE" the query must
send a single row of data if there are aggregate functions in it.
In this case the server marks all the aggregates as having received
no rows and calls the relevant Item::val_xxx() method on the SELECT
list. However if this SELECT list happens to contain a correlated
subquery this subquery is evaluated in a normal evaluation mode.
And if this correlated subquery has a reference to a field from the
outermost "impossible where" SELECT the add_key_fields will mistakenly
consider the outer field reference as a "local" field reference when
looking for sargable predicates.
But since the SELECT where the outer field reference refers to is not
completely initialized due to the "impossible WHERE" in this level
we'll get a NULL pointer reference.
Fixed by making a better condition for discovering if a field is "local"
to the SELECT level being processed.
It's not enough to look for OUTER_REF_TABLE_BIT in this case since
for outer references to constant tables the Item_field::used_tables()
will return 0 regardless of whether the field reference is from the
local SELECT or not.
The crash happens because select_union object is used as result set
for queries which have derived tables.
select_union use temporary table as data storage and if
fields count exceeds 10(count of values for procedure ANALYSE())
then we get a crash on fill_record() function.
mysql-test/r/analyse.result:
test result
mysql-test/r/subselect.result:
result fix
mysql-test/t/analyse.test:
test case
mysql-test/t/subselect.test:
test fix
sql/sql_yacc.yy:
The crash happens because select_union object is used as result set
for queries which have derived tables.
select_union use temporary table as data storage and if
fields count exceeds 10(count of values for procedure ANALYSE())
then we get a crash on fill_record() function.
The crash happens because select_union object is used as result set
for queries which have derived tables.
select_union use temporary table as data storage and if
fields count exceeds 10(count of values for procedure ANALYSE())
then we get a crash on fill_record() function.
When during the optimization an item is moved to the upper select
the item's context left unchanged. This caused wrong result in the
PS/SP mode.
The Item_ident::remove_dependence_processor now sets the context
of the select to which the item is moved to.
mysql-test/r/subselect.result:
The test case for the bug#46051 is adjusted.
mysql-test/t/subselect.test:
The test case for the bug#46051 is adjusted.
sql/item.cc:
Bug#46051: Incorrectly market field caused wrong result.
The Item_ident::remove_dependence_processor now sets the context
of the select to which the item is moved to.
When during the optimization an item is moved to the upper select
the item's context left unchanged. This caused wrong result in the
PS/SP mode.
The Item_ident::remove_dependence_processor now sets the context
of the select to which the item is moved to.
In a subselect all fields from outer selects are marked as dependent on
selects they are belong to. In some cases optimizer substitutes it for an
equivalent expression. For example "a_field IN (SELECT outer_field)" is
substituted with "a_field = outer_field". As we moved the outer_field to the
upper select it's not really outer anymore. But it was left marked as outer.
If exists an index over a_field optimizer choose wrong execution plan and thus
return wrong result.
Now the Item_in_subselect::single_value_transformer function removes dependent
marking from fields when a subselect is optimized away.
mysql-test/r/subselect.result:
Added a test case for the bug#46051.
mysql-test/t/subselect.test:
Added a test case for the bug#46051.
sql/item_subselect.cc:
Bug#46051: Incorrectly market field caused wrong result.
Now the Item_in_subselect::single_value_transformer function removes dependent
marking from fields when a subselect is optimized away.
In a subselect all fields from outer selects are marked as dependent on
selects they are belong to. In some cases optimizer substitutes it for an
equivalent expression. For example "a_field IN (SELECT outer_field)" is
substituted with "a_field = outer_field". As we moved the outer_field to the
upper select it's not really outer anymore. But it was left marked as outer.
If exists an index over a_field optimizer choose wrong execution plan and thus
return wrong result.
Now the Item_in_subselect::single_value_transformer function removes dependent
marking from fields when a subselect is optimized away.
There were so many changes into mtr (this is the new mtr coming) that I rather
copied mtr from 6.0-main here (at least this one knows how to run Maria tests).
I also fixed suite/maria tests to be accepted by the new mtr.
mysys/thr_mutex.c:
adding DBUG_PRINT here, so that we can locate where the warning is issued.
Bug#42003 tests missing the disconnect of connections <> default
second slice
Content:
1. wait_until_count_sessions.inc
- One PB run of a test using this routine failed because
5 seconds timeout were exceeded. Although I have some doubts
if the assigned timeout was really too small, I increase the
value to 10. We waste the additional 5 seconds only if the
tests fails anyway.
- Print the content of the PROCESSLIST if the poll routine fails
2. minor improvements of formatting
3. query_cache_notembedded:
Activate the wait_until_count_sessions.inc routine which was
unfortunately forgotten in the changeset before.
Bug#42003 tests missing the disconnect of connections <> default
second slice
Content:
1. wait_until_count_sessions.inc
- One PB run of a test using this routine failed because
5 seconds timeout were exceeded. Although I have some doubts
if the assigned timeout was really too small, I increase the
value to 10. We waste the additional 5 seconds only if the
tests fails anyway.
- Print the content of the PROCESSLIST if the poll routine fails
2. minor improvements of formatting
3. query_cache_notembedded:
Activate the wait_until_count_sessions.inc routine which was
unfortunately forgotten in the changeset before.
- If missing: add "disconnect <session>"
- If physical disconnect of non "default" sessions is not finished
at test end: add routine which waits till this happened
+ additional improvements
- remove superfluous files created by the test
- replace error numbers by error names
- remove trailing spaces, replace tabs by spaces
- unify writing of bugs within comments
- correct comments
- minor changes of formatting
Fixed tests:
backup
check
compress
grant
information_schema
multi_update
overflow
packet
query_cache_not_embedded
sp-threads
subselect
synchronization
timezone_grant
- If missing: add "disconnect <session>"
- If physical disconnect of non "default" sessions is not finished
at test end: add routine which waits till this happened
+ additional improvements
- remove superfluous files created by the test
- replace error numbers by error names
- remove trailing spaces, replace tabs by spaces
- unify writing of bugs within comments
- correct comments
- minor changes of formatting
Fixed tests:
backup
check
compress
grant
information_schema
multi_update
overflow
packet
query_cache_not_embedded
sp-threads
subselect
synchronization
timezone_grant
Item_in_optimizer::is_null() evaluated "NULL IN (SELECT ...)" to NULL regardless of
whether subquery produced any records, this was a documented limitation.
The limitation has been removed (see bugs 8804, 24085, 24127) now
Item_in_optimizer::val_int() correctly handles all cases with NULLs. Make
Item_in_optimizer::is_null() invoke val_int() to return correct values for
"NULL IN (SELECT ...)".
mysql-test/r/subselect.result:
BUG#37822: Correlated subquery with IN and IS UNKNOWN provides wrong result
- Testcase
mysql-test/t/subselect.test:
BUG#37822: Correlated subquery with IN and IS UNKNOWN provides wrong result
- Testcase
Item_in_optimizer::is_null() evaluated "NULL IN (SELECT ...)" to NULL regardless of
whether subquery produced any records, this was a documented limitation.
The limitation has been removed (see bugs 8804, 24085, 24127) now
Item_in_optimizer::val_int() correctly handles all cases with NULLs. Make
Item_in_optimizer::is_null() invoke val_int() to return correct values for
"NULL IN (SELECT ...)".
Added code to detect and give error when doing an insert into a view where we accessed fields in a not yet read table
Disabled test in subselect.test as the CHECK_OPTION for views doesn't work for insert.
This needs to be fixed properly later.
The problem with views are described in Bug #41760 Inserting into multiple-table views is not working
mysql-test/r/insert.result:
Fixed wrong usage of insert into view.
mysql-test/r/subselect.result:
Disabled wrong test (temporary)
mysql-test/suite/maria/r/maria.result:
Added test of size of table
mysql-test/suite/maria/t/maria.test:
Added test of size of table
mysql-test/t/insert.test:
Fixed wrong usage of insert into view
The bug is that during insert/update we currently don't read any of the referenced tables of the view.
This means that we can't get a value from another table to use as part of the update.
mysql-test/t/subselect.test:
Disabled not working test until someone has time to fix insert into view properly
Here we where refering to last used value in t2, which is wrong.
sql/sql_insert.cc:
Detect if we are trying to update one table in a view based on value in another, not yet read, table.
This fixes the problem discovered in insert.test
storage/maria/ma_blockrec.c:
Don't ignore not critical changes to the last page in the table.
We need to write the last page as otherwise we can during aborting of a row with a duplicate key get
state.data_file_length and the real length of file out of sync
storage/maria/ma_check.c:
Flush the page cache even if we got an error during zerofill.
(This fixes a call to assert() in case of a too short data file)
storage/maria/ma_pagecache.c:
Mark page as read when we do a write of a full page.
This fixes a bug when we got an error during read and then used direct write to page to update it
storage/maria/ma_state.c:
Restore info->lock.type after call to maria_versioning.
Fixed crash in maria_recover.test
storage/maria/maria_read_log.c:
Don't write thread id in debug log. (Not needed as maria_read_log is a single treaded program)
enable uncacheable flag if we update a view with check option
and check option has a subselect, otherwise, the check option
can be evaluated after the subselect was freed as independent
(See full_local in JOIN::join_free())
mysql-test/r/subselect.result:
test result
mysql-test/t/subselect.test:
test case
sql/mysql_priv.h:
added UNCACHEABLE_CHECKOPTION flag
sql/sql_update.cc:
enable uncacheable flag if we update a view with check option
and check option has a subselect, otherwise, the check option
can be evaluated after the subselect was freed as independent
(See full_local in JOIN::join_free())
enable uncacheable flag if we update a view with check option
and check option has a subselect, otherwise, the check option
can be evaluated after the subselect was freed as independent
(See full_local in JOIN::join_free())
the problem is the same as reported in bug#20835,
so the fix is backport of bug#20835 patch.
mysql-test/r/subselect.result:
test result
mysql-test/t/subselect.test:
test case
When switching to indexed ORDER BY we must be sure to reset the index read
flag if we are switching from a covering index to non-covering.
mysql-test/r/subselect.result:
Bug#37548: test case
mysql-test/t/subselect.test:
Bug#37548: test case
sql/sql_select.cc:
Bug#37548: update the index read flag if the index for indexed ORDER BY is not
covering.
manually resolved conflicts:
Text conflict in client/mysqltest.c
Contents conflict in mysql-test/include/have_bug25714.inc
Text conflict in mysql-test/include/have_ndbapi_examples.inc
Text conflict in mysql-test/mysql-test-run.pl
Text conflict in mysql-test/suite/parts/inc/partition_check_drop.inc
Text conflict in mysql-test/suite/parts/inc/partition_layout.inc
Text conflict in mysql-test/suite/parts/inc/partition_layout_check1.inc
Text conflict in mysql-test/suite/parts/inc/partition_layout_check2.inc
Text conflict in mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_alter1_1_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_alter1_2_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_alter2_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_alter3_innodb.result
Text conflict in mysql-test/suite/parts/r/partition_alter3_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_basic_innodb.result
Text conflict in mysql-test/suite/parts/r/partition_basic_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_basic_symlink_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_engine_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_syntax_myisam.result
Text conflict in mysql-test/suite/rpl_ndb/t/disabled.def
Text conflict in mysql-test/t/disabled.def
manually resolved conflicts:
Text conflict in client/mysqltest.c
Contents conflict in mysql-test/include/have_bug25714.inc
Text conflict in mysql-test/include/have_ndbapi_examples.inc
Text conflict in mysql-test/mysql-test-run.pl
Text conflict in mysql-test/suite/parts/inc/partition_check_drop.inc
Text conflict in mysql-test/suite/parts/inc/partition_layout.inc
Text conflict in mysql-test/suite/parts/inc/partition_layout_check1.inc
Text conflict in mysql-test/suite/parts/inc/partition_layout_check2.inc
Text conflict in mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_alter1_1_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_alter1_2_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_alter2_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_alter3_innodb.result
Text conflict in mysql-test/suite/parts/r/partition_alter3_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_basic_innodb.result
Text conflict in mysql-test/suite/parts/r/partition_basic_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_basic_symlink_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_engine_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_syntax_myisam.result
Text conflict in mysql-test/suite/rpl_ndb/t/disabled.def
Text conflict in mysql-test/t/disabled.def
Calling List<Cached_item>::delete_elements for the same list twice
caused a crash of the server in the function JOIN::cleaunup.
Ensured that delete_elements() in JOIN::cleanup would be called only once.
mysql-test/r/subselect.result:
Added a test case for bug #38191.
mysql-test/t/subselect.test:
Added a test case for bug #38191.
sql/sql_select.cc:
Fixed bug #38191.
Ensured that delete_elements() in JOIN::cleanup would be called only once.
Calling List<Cached_item>::delete_elements for the same list twice
caused a crash of the server in the function JOIN::cleaunup.
Ensured that delete_elements() in JOIN::cleanup would be called only once.
The file tree in mtr's vardir has changed so an old
hard-coded path in mysql-test/t/subselect.test didn't
work.
Fix: update the paths in the test.
mysql-test/r/subselect.result:
Updated result file.
mysql-test/t/subselect.test:
Problem: The file tree in mtr's vardir has changed
so an old hard-coded path didn't work.
Fix: update the paths in the test.
- moved the test into a separate file to check for presence of the test variable
mysql-test/r/subselect.result:
Bug#37627: moved the test to a separate file
mysql-test/r/subselect_debug.result:
Bug#37627: moved the test to a separate file
mysql-test/t/subselect.test:
Bug#37627: moved the test to a separate file
mysql-test/t/subselect_debug.test:
Bug#37627: moved the test to a separate file
When there is an error executing EXISTS predicates they return NULL as their string
or decimal value but don't set the NULL value flag.
Fixed by returning 0 (as a decimal or a string) on error exectuting the subquery.
Note that we can't return NULL as EXISTS is not supposed to return NULL.
mysql-test/r/subselect.result:
Bug#37627: test case
mysql-test/t/subselect.test:
Bug#37627: test case
sql/item_subselect.cc:
Bug#37627: return decimal (or string) 0 isntead of a NULL pointer on
error calculating an EXISTS predicate.
When there is an error executing EXISTS predicates they return NULL as their string
or decimal value but don't set the NULL value flag.
Fixed by returning 0 (as a decimal or a string) on error exectuting the subquery.
Note that we can't return NULL as EXISTS is not supposed to return NULL.
The value of JOIN::tables must be set to 0 when there
is no matching min/max row.
mysql-test/r/subselect.result:
Added a test case for bug #37004.
mysql-test/t/subselect.test:
Added a test case for bug #37004.
into magare.gmz:/home/kgeorge/mysql/work/B36011-5.1-bugteam
sql/sql_select.cc:
Auto merged
mysql-test/r/subselect.result:
merge of bug 36011 to 5.1-bugteam
mysql-test/t/subselect.test:
merge of bug 36011 to 5.1-bugteam
with dependent subqueries
An IN subquery is executed on EXPLAIN when it's not correlated.
If the subquery required a temporary table for its execution
not all the internal structures were restored from pointing to
the items of the temporary table to point back to the items of
the subquery.
Fixed by restoring the ref array when a temp tables were used in
executing the IN subquery during EXPLAIN EXTENDED.
mysql-test/r/subselect.result:
Bug #36011: test case
mysql-test/t/subselect.test:
Bug #36011: test case
sql/sql_select.cc:
Bug #36011: restore the ref array after execution
when there were temp tables.
with dependent subqueries
An IN subquery is executed on EXPLAIN when it's not correlated.
If the subquery required a temporary table for its execution
not all the internal structures were restored from pointing to
the items of the temporary table to point back to the items of
the subquery.
Fixed by restoring the ref array when a temp tables were used in
executing the IN subquery during EXPLAIN EXTENDED.
into host.loc:/home/uchum/work/5.1-bugteam
mysql-test/r/subselect.result:
Merge with 5.0-bugteam (bug#36139).
mysql-test/t/subselect.test:
Merge with 5.0-bugteam (bug#36139).
Post-commit minor cleanup of testcase (bug#36139).
mysql-test/r/subselect.result:
Post-commit minor cleanup of testcase (bug#36139).
mysql-test/t/subselect.test:
Post-commit minor cleanup of testcase (bug#36139).
- Make convert_zerofill_number_to_string() take into account that the
constant it is converting may evaluate to NULL.
mysql-test/r/subselect.result:
BUG#36139 "float, zerofill, crash with subquery"
- Testcase
mysql-test/t/subselect.test:
BUG#36139 "float, zerofill, crash with subquery"
- Testcase
The test case for the bug#31048 checks that there is no crash on stack
overrun. But due to different stack sizes on different platforms it failed
on some of them.
The new test case check that a query with at least 4 level subquery nesting
works without the stack overrun nesting and other levels of nesting doesn't
cause a crash.
mysql-test/t/subselect.test:
Corrected test case for the bug#31048.
mysql-test/r/subselect.result:
Corrected test case for the bug#31048.
The test case for the bug#31048 checks that there is no crash on stack
overrun. But due to different stack sizes on different platforms it failed
on some of them.
The new test case check that a query with at least 4 level subquery nesting
works without the stack overrun nesting and other levels of nesting doesn't
cause a crash.
into janus.mylan:/usr/home/serg/Abk/mysql-maria
include/my_sys.h:
Auto merged
mysql-test/lib/mtr_cases.pl:
Auto merged
mysql-test/lib/mtr_misc.pl:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/ps_2myisam.result:
Auto merged
mysql-test/r/ps_3innodb.result:
Auto merged
mysql-test/r/ps_4heap.result:
Auto merged
mysql-test/r/ps_5merge.result:
Auto merged
mysql-test/r/query_cache.result:
Auto merged
mysql-test/r/subselect.result:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/suite/binlog/r/binlog_unsafe.result:
Auto merged
mysql-test/suite/binlog/t/binlog_unsafe.test:
Auto merged
mysql-test/suite/ndb/r/ps_7ndb.result:
Auto merged
mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result:
Auto merged
mysql-test/suite/rpl/t/rpl_insert.test:
Auto merged
mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test:
Auto merged
mysql-test/t/disabled.def:
Auto merged
mysql-test/t/query_cache.test:
Auto merged
mysql-test/t/subselect.test:
Auto merged
mysql-test/t/view.test:
Auto merged
sql/field.h:
Auto merged
sql/filesort.cc:
Auto merged
sql/ha_partition.cc:
Auto merged
sql/handler.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_strfunc.h:
Auto merged
sql/log.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/opt_range.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/set_var.h:
Auto merged
sql/slave.cc:
Auto merged
sql/slave.h:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_union.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/unireg.cc:
Auto merged
sql/share/errmsg.txt:
Auto merged
storage/myisam/ft_boolean_search.c:
Auto merged
storage/myisam/ha_myisam.cc:
Auto merged
storage/myisam/sort.c:
Auto merged
sql/log_event_old.h:
SCCS merged
BitKeeper/triggers/post-commit:
merged
client/mysqldump.c:
merged
configure.in:
merged
client/mysqltest.c:
merged
include/Makefile.am:
merged
include/atomic/nolock.h:
merged
mysql-test/lib/mtr_report.pl:
merged
sql/handler.h:
merged
sql/mysqld.cc:
merged
sql/sql_select.cc:
merged
into kaamos.(none):/data/src/opt/mysql-5.1-opt
mysql-test/r/group_by.result:
Auto merged
mysql-test/r/type_decimal.result:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/t/type_decimal.test:
Auto merged
sql/item.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_select.cc:
Auto merged
mysql-test/r/subselect.result:
Manual merge.
mysql-test/t/group_by.test:
Manual merge.
mysql-test/t/subselect.test:
Manual merge.
mysql-test/t/view.test:
Manual merge.
The problem occurred when one had a subquery that had an equality X=Y where
Y referred to a named select list expression from the parent select. MySQL
crashed when trying to use the X=Y equality for ref-based access.
Fixed by allowing non-Item_field items in the described case.
mysql-test/r/subselect.result:
BUG#33794 "MySQL crashes executing specific query"
- Testcase
mysql-test/t/subselect.test:
BUG#33794 "MySQL crashes executing specific query"
- Testcase
sql/sql_select.cc:
BUG#33794 "MySQL crashes executing specific query"
get_store_key() assumed that if it got a reference
t.key=Item_outer_ref(Item_direct_ref(x))
then x was an Item_field object, which is not the case when one refers to a
named select list expression out ot subquery.
The problem occurred when one had a subquery that had an equality X=Y where
Y referred to a named select list expression from the parent select. MySQL
crashed when trying to use the X=Y equality for ref-based access.
Fixed by allowing non-Item_field items in the described case.
into kaamos.(none):/data/src/opt/mysql-5.1-opt
sql/field.h:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/item_timefunc.h:
Auto merged
sql/set_var.cc:
Auto merged
sql/sql_base.cc:
Auto merged
mysql-test/r/subselect.result:
Manual merge.
mysql-test/t/subselect.test:
Manual merge.
sql/filesort.cc:
Manual merge.
server crash.
The filesort implementation has an optimization for subquery execution which
consists of reusing previously allocated buffers. In particular the call to
the read_buffpek_from_file function might be skipped when a big enough buffer
for buffer descriptors (buffpeks) is already allocated. Beside allocating
memory for buffpeks this function fills allocated buffer with data read from
disk. Skipping it might led to using an arbitrary memory as fields' data and
finally to a crash.
Now the read_buffpek_from_file function is always called. It allocates
new buffer only when necessary, but always fill it with correct data.
sql/filesort.cc:
Bug#33675: Usage of an uninitialized memory by filesort in a subquery caused
server crash.Now the read_buffpek_from_file function is always called. It allocates
new buffer only when necessary, but always fill it with correct data.
mysql-test/r/subselect.result:
Added a test case for the bug#33675: Usage of an uninitialized memory by
filesort in a subquery caused server crash.
mysql-test/t/subselect.test:
Added a test case for the bug#33675: Usage of an uninitialized memory by
filesort in a subquery caused server crash.
server crash.
The filesort implementation has an optimization for subquery execution which
consists of reusing previously allocated buffers. In particular the call to
the read_buffpek_from_file function might be skipped when a big enough buffer
for buffer descriptors (buffpeks) is already allocated. Beside allocating
memory for buffpeks this function fills allocated buffer with data read from
disk. Skipping it might led to using an arbitrary memory as fields' data and
finally to a crash.
Now the read_buffpek_from_file function is always called. It allocates
new buffer only when necessary, but always fill it with correct data.
into a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-maria.new
BitKeeper/etc/ignore:
auto-union
BUILD/compile-dist:
Auto merged
client/mysqladmin.cc:
Auto merged
client/mysqldump.c:
Auto merged
config/ac-macros/plugins.m4:
Auto merged
configure.in:
Auto merged
dbug/dbug.c:
Auto merged
include/keycache.h:
Auto merged
include/m_string.h:
Auto merged
include/my_global.h:
Auto merged
include/my_pthread.h:
Auto merged
include/my_sys.h:
Auto merged
include/mysql_com.h:
Auto merged
libmysql/CMakeLists.txt:
Auto merged
libmysql/Makefile.shared:
Auto merged
mysql-test/lib/mtr_cases.pl:
Auto merged
mysql-test/lib/mtr_report.pl:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/innodb.result:
Auto merged
mysql-test/r/merge.result:
Auto merged
mysql-test/r/myisam.result:
Auto merged
mysql-test/r/mysqldump.result:
Auto merged
mysql-test/r/ps_2myisam.result:
Auto merged
mysql-test/r/ps_3innodb.result:
Auto merged
mysql-test/r/ps_4heap.result:
Auto merged
mysql-test/r/ps_5merge.result:
Auto merged
mysql-test/r/query_cache.result:
Auto merged
mysql-test/r/subselect.result:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/suite/ndb/r/ps_7ndb.result:
Auto merged
mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result:
Auto merged
mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test:
Auto merged
mysql-test/t/delayed.test:
Auto merged
mysql-test/t/disabled.def:
Auto merged
mysql-test/t/myisam.test:
Auto merged
mysql-test/t/mysqldump.test:
Auto merged
mysql-test/t/query_cache.test:
Auto merged
mysql-test/t/query_cache_notembedded.test:
Auto merged
mysql-test/t/subselect.test:
Auto merged
mysql-test/t/variables.test:
Auto merged
mysql-test/t/view.test:
Auto merged
mysys/CMakeLists.txt:
Auto merged
mysys/Makefile.am:
Auto merged
mysys/mf_keycache.c:
Auto merged
mysys/my_delete.c:
Auto merged
mysys/my_init.c:
Auto merged
mysys/my_symlink2.c:
Auto merged
mysys/safemalloc.c:
Auto merged
mysys/thr_lock.c:
Auto merged
sql/field.h:
Auto merged
sql/filesort.cc:
Auto merged
sql/ha_ndbcluster.cc:
Auto merged
sql/ha_partition.cc:
Auto merged
sql/handler.cc:
Auto merged
sql/handler.h:
Auto merged
sql/item.h:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_xmlfunc.cc:
Auto merged
sql/lock.cc:
Auto merged
sql/log.cc:
Auto merged
sql/log_event_old.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/net_serv.cc:
Auto merged
sql/opt_range.cc:
Auto merged
sql/set_var.h:
Auto merged
sql/slave.cc:
Auto merged
sql/slave.h:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_plugin.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/share/errmsg.txt:
Auto merged
sql/table.cc:
Auto merged
sql/table.h:
Auto merged
sql/udf_example.c:
Auto merged
storage/csv/ha_tina.cc:
Auto merged
storage/myisam/ft_boolean_search.c:
Auto merged
storage/myisam/ft_nlq_search.c:
Auto merged
storage/myisam/ft_parser.c:
Auto merged
storage/myisam/ha_myisam.cc:
Auto merged
storage/myisam/ha_myisam.h:
Auto merged
storage/myisam/mi_check.c:
Auto merged
storage/myisam/mi_dynrec.c:
Auto merged
storage/myisam/mi_open.c:
Auto merged
storage/myisam/mi_packrec.c:
Auto merged
storage/myisam/mi_write.c:
Auto merged
storage/myisam/myisamchk.c:
Auto merged
storage/myisam/myisampack.c:
Auto merged
storage/myisam/rt_index.c:
Auto merged
storage/myisam/sort.c:
Auto merged
storage/myisammrg/ha_myisammrg.cc:
Auto merged
storage/myisammrg/ha_myisammrg.h:
Auto merged
strings/llstr.c:
Auto merged
support-files/compiler_warnings.supp:
Auto merged
Makefile.am:
Manual merge from 5.1 to maria.
client/mysqltest.c:
Manual merge from 5.1 to maria.
include/my_base.h:
Manual merge from 5.1 to maria.
mysql-test/t/merge.test:
Manual merge from 5.1 to maria.
mysys/my_getopt.c:
Manual merge from 5.1 to maria.
mysys/thr_mutex.c:
Manual merge from 5.1 to maria.
sql/mysqld.cc:
Manual merge from 5.1 to maria.
sql/set_var.cc:
Manual merge from 5.1 to maria.
sql/sql_table.cc:
Manual merge from 5.1 to maria.
sql/sql_yacc.yy:
Manual merge from 5.1 to maria.
sql/unireg.cc:
Manual merge from 5.1 to maria.
Test case for the bug#31048 is moved to the subselect_notembedded tests as the embedded server isn't affected by this bug.
mysql-test/r/subselect.result:
Test case for the bug#31048 is moved to the subselect_notembedded tests as the embedded server isn't affected by this bug.
mysql-test/r/subselect_notembedded.result:
Test case for the bug#31048 is moved to the subselect_notembedded tests as the embedded server isn't affected by this bug.
mysql-test/t/subselect.test:
Test case for the bug#31048 is moved to the subselect_notembedded tests as the embedded server isn't affected by this bug.
mysql-test/t/subselect_notembedded.test:
Test case for the bug#31048 is moved to the subselect_notembedded tests as the embedded server isn't affected by this bug.
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
into magare.gmz:/home/kgeorge/mysql/work/B32036-5.1-opt
mysql-test/r/subselect.result:
merged fix for bug 32036 to 5.1-opt
mysql-test/t/subselect.test:
merged fix for bug 32036 to 5.1-opt
sql/sql_yacc.yy:
merged fix for bug 32036 to 5.1-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.
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.
into magare.gmz:/home/kgeorge/mysql/work/B32400-5.1-opt
BitKeeper/deleted/.del-ps_6bdb.result:
Auto merged
mysql-test/r/ps_2myisam.result:
Auto merged
mysql-test/r/ps_3innodb.result:
Auto merged
mysql-test/r/ps_4heap.result:
Auto merged
mysql-test/r/ps_5merge.result:
Auto merged
mysql-test/suite/ndb/r/ps_7ndb.result:
Auto merged
sql/item.cc:
Auto merged
tests/mysql_client_test.c:
Auto merged
mysql-test/t/subselect.test:
merge of bug 32400 to 5.1-opt
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.
into magare.gmz:/home/kgeorge/mysql/work/B30788-5.1-opt
mysql-test/r/subselect3.result:
Auto merged
sql/item.h:
Auto merged
sql/sql_select.cc:
Auto merged
mysql-test/r/subselect.result:
merge of bug 30788 to 5.1-opt
mysql-test/t/subselect.test:
merge of bug 30788 to 5.1-opt
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.
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.
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
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.
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.
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.
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
into gleb.loc:/home/uchum/5.1-opt
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_subselect.cc:
Auto merged
sql/sp_rcontext.cc:
Auto merged
sql/sql_class.cc:
Auto merged
mysql-test/r/subselect.result:
Merge with 5.0-opt.
mysql-test/t/subselect.test:
Merge with 5.0-opt.
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.
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.
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.
into magare.gmz:/home/kgeorge/mysql/work/B31884-5.1-opt
sql/item_subselect.h:
Auto merged
mysql-test/r/subselect.result:
merged the fix for bug 31884 to 5.1-opt
mysql-test/t/subselect.test:
merged the fix for bug 31884 to 5.1-opt
Item_in_subselect's only externally callable method is val_bool().
However the nullability in the wrapper class (Item_in_optimizer) is
established by calling the "forbidden" method val_int().
Fixed to use the correct method (val_bool() ) to establish nullability
of Item_in_subselect in Item_in_optimizer.
mysql-test/r/subselect.result:
Bug #31884: test case
mysql-test/t/subselect.test:
Bug #31884: test case
sql/item_subselect.h:
Bug #31884: Use the correct method to establish nullability
Item_in_subselect's only externally callable method is val_bool().
However the nullability in the wrapper class (Item_in_optimizer) is
established by calling the "forbidden" method val_int().
Fixed to use the correct method (val_bool() ) to establish nullability
of Item_in_subselect in Item_in_optimizer.
into hynda.mysql.fi:/home/my/mysql-maria
BitKeeper/etc/ignore:
auto-union
BUILD/SETUP.sh:
Auto merged
BitKeeper/deleted/.del-CMakeLists.txt~99a50df6:
Auto merged
Makefile.am:
Auto merged
client/mysqldump.c:
Auto merged
configure.in:
Auto merged
include/Makefile.am:
Auto merged
include/keycache.h:
Auto merged
include/m_string.h:
Auto merged
include/my_sys.h:
Auto merged
libmysqld/Makefile.am:
Auto merged
mysql-test/extra/rpl_tests/rpl_insert_delayed.test:
Auto merged
mysql-test/lib/mtr_cases.pl:
Auto merged
mysql-test/lib/mtr_misc.pl:
Auto merged
mysql-test/lib/mtr_process.pl:
Auto merged
mysql-test/lib/mtr_report.pl:
Auto merged
mysql-test/lib/mtr_timer.pl:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/alter_table.result:
Auto merged
mysql-test/r/merge.result:
Auto merged
mysql-test/r/mysqldump.result:
Auto merged
mysql-test/r/query_cache.result:
Auto merged
mysql-test/r/subselect.result:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/suite/ndb/r/ps_7ndb.result:
Auto merged
mysql-test/suite/rpl/r/rpl_events.result:
Auto merged
mysql-test/suite/rpl/r/rpl_insert.result:
Auto merged
mysql-test/suite/rpl/r/rpl_row_insert_delayed.result:
Auto merged
mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result:
Auto merged
mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result:
Auto merged
mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result:
Auto merged
mysql-test/suite/rpl/t/rpl_insert.test:
Auto merged
mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test:
Auto merged
mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test:
Auto merged
mysql-test/t/alter_table.test:
Auto merged
mysql-test/t/myisam.test:
Auto merged
mysql-test/t/mysqldump.test:
Auto merged
mysql-test/t/query_cache.test:
Auto merged
mysql-test/t/subselect.test:
Auto merged
mysql-test/t/view.test:
Auto merged
mysys/array.c:
Auto merged
mysys/mf_keycache.c:
Auto merged
mysys/my_init.c:
Auto merged
mysys/my_symlink2.c:
Auto merged
mysys/safemalloc.c:
Auto merged
mysys/thr_lock.c:
Auto merged
sql/Makefile.am:
Auto merged
sql/filesort.cc:
Auto merged
sql/ha_ndbcluster.cc:
Auto merged
sql/ha_partition.cc:
Auto merged
sql/ha_partition.h:
Auto merged
sql/handler.h:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/item_xmlfunc.cc:
Auto merged
sql/lock.cc:
Auto merged
sql/log.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/net_serv.cc:
Auto merged
sql/opt_range.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/slave.cc:
Auto merged
sql/slave.h:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/share/errmsg.txt:
Auto merged
sql/sql_test.cc:
Auto merged
sql/table.h:
Auto merged
sql/udf_example.c:
Auto merged
sql/uniques.cc:
Auto merged
sql/unireg.cc:
Auto merged
storage/csv/ha_tina.h:
Auto merged
storage/myisam/ft_boolean_search.c:
Auto merged
storage/myisam/ft_nlq_search.c:
Auto merged
storage/myisam/ft_parser.c:
Auto merged
storage/myisam/ft_stopwords.c:
Auto merged
storage/myisam/ha_myisam.cc:
Auto merged
storage/myisam/ha_myisam.h:
Auto merged
storage/myisam/mi_check.c:
Auto merged
storage/myisam/mi_create.c:
Auto merged
storage/myisam/mi_delete.c:
Auto merged
storage/myisam/mi_dynrec.c:
Auto merged
storage/myisam/mi_extra.c:
Auto merged
storage/myisam/mi_key.c:
Auto merged
storage/myisam/mi_locking.c:
Auto merged
storage/myisam/mi_log.c:
Auto merged
storage/myisam/mi_packrec.c:
Auto merged
storage/myisam/mi_rkey.c:
Auto merged
storage/myisam/mi_search.c:
Auto merged
storage/myisam/mi_test1.c:
Auto merged
storage/myisam/mi_test2.c:
Auto merged
storage/myisam/mi_update.c:
Auto merged
storage/myisam/mi_write.c:
Auto merged
storage/myisam/myisamchk.c:
Auto merged
storage/myisam/myisamlog.c:
Auto merged
storage/myisam/myisampack.c:
Auto merged
storage/myisam/sort.c:
Auto merged
storage/myisam/sp_test.c:
Auto merged
storage/myisammrg/ha_myisammrg.cc:
Auto merged
storage/myisammrg/ha_myisammrg.h:
Auto merged
storage/ndb/src/mgmapi/mgmapi.cpp:
Auto merged
support-files/compiler_warnings.supp:
Auto merged
client/mysqltest.c:
Manual merge between mysql-5.1 and mysql-maria
include/my_base.h:
Manual merge between mysql-5.1 and mysql-maria
include/my_global.h:
Manual merge between mysql-5.1 and mysql-maria
include/myisam.h:
Manual merge between mysql-5.1 and mysql-maria
libmysql/Makefile.shared:
Manual merge between mysql-5.1 and mysql-maria
mysql-test/r/events_logs_tests.result:
Manual merge between mysql-5.1 and mysql-maria
mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result:
Manual merge between mysql-5.1 and mysql-maria
mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test:
Manual merge between mysql-5.1 and mysql-maria
mysql-test/t/disabled.def:
Manual merge between mysql-5.1 and mysql-maria
mysql-test/t/events_logs_tests.test:
Manual merge between mysql-5.1 and mysql-maria
mysys/my_compress.c:
Manual merge between mysql-5.1 and mysql-maria
mysys/my_getsystime.c:
Manual merge between mysql-5.1 and mysql-maria
mysys/my_open.c:
Manual merge between mysql-5.1 and mysql-maria
sql/handler.cc:
Manual merge between mysql-5.1 and mysql-maria
sql/set_var.h:
Manual merge between mysql-5.1 and mysql-maria
sql/sql_class.h:
Manual merge between mysql-5.1 and mysql-maria
sql/sql_show.cc:
Manual merge between mysql-5.1 and mysql-maria
sql/sql_sort.h:
Manual merge between mysql-5.1 and mysql-maria
sql/sql_yacc.yy:
Manual merge between mysql-5.1 and mysql-maria
sql/table.cc:
Manual merge between mysql-5.1 and mysql-maria
storage/csv/ha_tina.cc:
Manual merge between mysql-5.1 and mysql-maria
storage/myisam/mi_open.c:
Manual merge between mysql-5.1 and mysql-maria
storage/myisam/myisamdef.h:
Manual merge between mysql-5.1 and mysql-maria
unittest/mysys/my_atomic-t.c:
Manual merge between mysql-5.1 and mysql-maria
specify that they want a MyISAM table, otherwise they fail
when run with --default-storage-engine=maria.
mysql-test/extra/rpl_tests/rpl_flsh_tbls.test:
uses INSERT DELAYED so has to specify MyISAM
mysql-test/extra/rpl_tests/rpl_insert_delayed.test:
uses INSERT DELAYED so has to specify MyISAM
mysql-test/r/query_cache.result:
result update
mysql-test/r/rpl_insert.result:
result update
mysql-test/r/rpl_stm_flsh_tbls.result:
result update
mysql-test/r/rpl_stm_insert_delayed.result:
result update
mysql-test/r/rpl_switch_stm_row_mixed.result:
result update
mysql-test/r/subselect.result:
result update
mysql-test/t/query_cache.test:
uses MERGE so has to specify MyISAM
mysql-test/t/query_cache_merge.test:
uses MERGE so has to specify MyISAM
mysql-test/t/rpl_insert.test:
uses INSERT DELAYED so has to specify MyISAM
mysql-test/t/rpl_stm_flsh_tbls.test:
specifying the engine lengthens the query in binlog so shifts
positions
mysql-test/t/rpl_switch_stm_row_mixed.test:
uses INSERT DELAYED so has to specify MyISAM
mysql-test/t/subselect.test:
uses INSERT DELAYED so has to specify MyISAM