Before this fix, the ha_read_last_count status variable was defined and
updated internally, for never exposed as a system variable.
This fix exposes the system variable as "Handler_read_last",
for completness of the Handler_read_* system variables interface.
Adjusted tests results accordingly.
Conflicts:
Text conflict in configure.in
Text conflict in dbug/dbug.c
Text conflict in mysql-test/r/ps.result
Text conflict in mysql-test/t/ps.test
Text conflict in sql/CMakeLists.txt
Text conflict in sql/ha_ndbcluster.cc
Text conflict in sql/mysqld.cc
Text conflict in sql/sql_plugin.cc
Text conflict in sql/sql_table.cc
The problem was in an incorrect debug assertion. The expression
used in the failing assertion states that when finding
references matching ORDER BY expressions, there can be only one
reference to a single table. But that does not make any sense,
all test cases for this bug are valid examples with multiple
identical WHERE expressions referencing the same table which
are also present in the ORDER BY list.
Fixed by removing the failing assertion. We also have to take
care of the 'found' counter so that we count multiple
references only once. We rely on this fact later in
eq_ref_table().
mysql-test/r/join.result:
Added a test case for bug #50335.
mysql-test/t/join.test:
Added a test case for bug #50335.
sql/sql_select.cc:
Removing the assertion in eq_ref_table() as it does not make
any sense. We also have to take care of the 'found' counter so
that we count multiple references only once. We rely on this
fact later in eq_ref_table().
Conflicts:
Text conflict in mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
Text conflict in sql/log.cc
Text conflict in sql/set_var.cc
Text conflict in sql/sql_class.cc
The crash is the result of an attempt made by JOIN::optimize to evaluate
the WHERE condition when no records have been actually read.
The fix is to remove erroneous 'outer_join' variable check.
mysql-test/r/join.result:
test result
mysql-test/t/join.test:
test case
sql/sql_select.cc:
removed erroneous 'outer_join' variable check.
The crash happens because greedy_serach
can not determine best plan due to
wrong inner table dependences. These
dependences affects join table sorting
which performs before greedy_search starting.
In our case table which has real 'no dependences'
should be put on top of the list but it does not
happen as inner tables have no dependences as well.
The fix is to exclude RAND_TABLE_BIT mask from
condition which checks if table dependences
should be updated.
mysql-test/r/join.result:
test result
mysql-test/t/join.test:
test case
sql/sql_select.cc:
RAND_TABLE_BIT mask should not be counted as it
prevents update of inner table dependences.
For example it might happen if RAND() function
is used in JOIN ON clause.
The problem was in an incorrect debug assertion. The expression
used in the failing assertion states that when finding
references matching ORDER BY expressions, there can be only one
reference to a single table. But that does not make any sense,
all test cases for this bug are valid examples with multiple
identical WHERE expressions referencing the same table which
are also present in the ORDER BY list.
Fixed by removing the failing assertion. We also have to take
care of the 'found' counter so that we count multiple
references only once. We rely on this fact later in
eq_ref_table().
mysql-test/r/join.result:
Added a test case for bug #50335.
mysql-test/t/join.test:
Added a test case for bug #50335.
sql/sql_select.cc:
Removing the assertion in eq_ref_table() as it does not make
any sense. We also have to take care of the 'found' counter so
that we count multiple references only once. We rely on this
fact later in eq_ref_table().
The problem becomes apparent only if HAVE_purify is undefined.
It related to the part of code placed in open_table_from_share() fuction
where we initialize record buffer only if HAVE_purify is enabled.
So in case of HAVE_purify=OFF record buffer is not initialized
on open table stage.
Next we read key, find NULL value and update appropriate null bit
but do not update record buffer. After that the record is stored
in the join cache(store_record_in_cache). For CHAR fields we
strip trailing spaces and in our case this procedure uses
uninitialized record buffer.
The fix is to skip stripping space procedure in case of null values
for CHAR fields(partially based on 6.0 JOIN_CACHE implementation).
mysql-test/r/join.result:
test case
mysql-test/t/join.test:
test case
sql/field.cc:
code updated according to new CACHE_FIELD struct
sql/sql_select.cc:
code updated according to new CACHE_FIELD struct
sql/sql_select.h:
CACHE_FIELD struct:
added new fields: Field *field, uint type;
removed fields: Field_blob *blob_field, bool strip;
Queries with nested outer joins may lead to crashes or
bad results because an internal data structure is not handled
correctly.
The optimizer uses bitmaps of nested JOINs to determine
if certain table can be placed at a certain place in the
JOIN order.
It does maintain a bitmap describing in which JOINs
last placed table is nested.
When it puts a table it makes sure the bit of every JOIN that
contains the table in question is set (because JOINs can be nested).
It does that by recursively setting the bit for the next enclosing
JOIN when this is the first table in the JOIN and recursively
resetting the bit if it's the last table in the JOIN.
When it removes a table from the join order it should do the
opposite : recursively unset the bit if it's the only remaining
table in this join and and recursively set the bit if it's removing
the last table of a JOIN.
There was an error in how the bits was set for the upper levels :
when removing a table it was setting the bit for all the enclosing
nested JOINs even if there were more tables left in the current JOIN
(which practically means that the upper nested JOINs were not affected).
Fixed by stopping the recursion at the relevant level.
mysql-test/r/join.result:
Bug #42116: test case
mysql-test/t/join.test:
Bug #42116: test case
sql/sql_select.cc:
Bug #41116: don't go up and set the bits if more tables in
at the current JOIN level
The bug is not related to MERGE table or TRIGGER. More correct description
would be 'assertion on multi-table UPDATE + NATURAL JOIN + MERGEABLE VIEW'.
On PREPARE stage(see test case) we call mark_common_columns() func which
creates ON condition for NATURAL JOIN and sets appropriate
table read_set bitmaps for fields which are used in ON condition.
On EXECUTE stage mark_common_columns() is not called, we set
necessary read_set bitmaps in setup_conds(). But 'B.f1' field
is already processed and related item alredy fixed before
setup_conds() as updated field and setup_conds can not set
read_set bitmap because of that.
The fix is to set read_set bitmap for appropriate table field even
if Item_direct_view_ref item which represents a refernce to this field
is fixed.
mysql-test/r/join.result:
test result
mysql-test/t/join.test:
test case
sql/item.cc:
The bug is not related to MERGE table or TRIGGER. More correct description
would be 'assertion on multi-table UPDATE + NATURAL JOIN + MERGEABLE VIEW'.
On PREPARE stage(see test case) we call mark_common_columns() func which
creates ON condition for NATURAL JOIN and sets appropriate
table read_set bitmaps for fields which are used in ON condition.
On EXECUTE stage mark_common_columns() is not called, we set
necessary read_set bitmaps in setup_conds(). But 'B.f1' field
is already processed and related item alredy fixed before
setup_conds() as updated field and setup_conds can not set
read_set bitmap because of that.
The fix is to set read_set bitmap for appropriate table field even
if Item_direct_view_ref item which represents a refernce to this field
is fixed.
Machines with hostname set to "localhost" cause uniqueness errors in
the SQL bootstrap data.
Now, insert zero lines for cases where the (lowercased) hostname is
the same as an already-inserted 'localhost' name. Also, fix a few tests
that expect certain local accounts to have a certain host name.
A rule was introduced by the 5.1 part of the fix for bug 27531 to
prefer filesort over indexed ORDER BY when accessing all of the rows of a
table (because it's faster). This new rule was not accounting for the
presence of a LIMIT clause.
Fixed the condition for this rule so it will prefer filesort over
indexed ORDER BY only if no LIMIT.
mysql-test/r/compress.result:
Bug #31094: LIMIT is not considered a full index scan
mysql-test/r/join.result:
Bug #31094: test case
mysql-test/r/select.result:
Bug #31094: LIMIT is not considered a full index scan
mysql-test/r/ssl.result:
Bug #31094: LIMIT is not considered a full index scan
mysql-test/r/ssl_compress.result:
Bug #31094: LIMIT is not considered a full index scan
mysql-test/t/join.test:
Bug #31094: test case
sql/sql_select.cc:
Bug #31094: prefer filesort over indexed ORDER BY only if no LIMIT
- Renamed "Using join cache" to "Using join buffer".
- "Using join buffer" is now printed on the last
table that "reads" from the join buffer cache.
mysql-test/r/archive_gis.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
mysql-test/r/compress.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
mysql-test/r/ctype_utf8.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
mysql-test/r/derived.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
mysql-test/r/distinct.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
mysql-test/r/func_group.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
mysql-test/r/func_group_innodb.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
mysql-test/r/gis.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
mysql-test/r/greedy_optimizer.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
mysql-test/r/group_by.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
mysql-test/r/group_min_max.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
mysql-test/r/index_merge_myisam.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
mysql-test/r/information_schema.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
mysql-test/r/innodb_gis.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
mysql-test/r/innodb_mysql.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
mysql-test/r/join.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
mysql-test/r/join_nested.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
mysql-test/r/key_diff.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
mysql-test/r/myisam.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
mysql-test/r/ndb_condition_pushdown.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
mysql-test/r/ndb_gis.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
mysql-test/r/range.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
mysql-test/r/row.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
mysql-test/r/select.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
mysql-test/r/ssl.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
mysql-test/r/ssl_compress.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
mysql-test/r/subselect.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
mysql-test/r/subselect3.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
mysql-test/r/union.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
mysql-test/r/view.result:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
sql/sql_select.cc:
Bug #27531: renamed "Using join cache" to "Using join buffer"
and moved to the last table in the batch.
- added join cache indication in EXPLAIN (Extra column).
- prefer filesort over full scan over
index for ORDER BY (because it's faster).
- when switching from REF to RANGE because
RANGE uses longer key turn off sort on
the head table only as the resulting
RANGE access is a candidate for join cache
and we don't want to disable it by sorting
on the first table only.
mysql-test/r/archive_gis.result:
bug #27531: join cache in EXPLAIN
mysql-test/r/compress.result:
bug #27531:
- join cache in EXPLAIN.
- prefer filesort over full scan over index for ORDER BY.
mysql-test/r/ctype_utf8.result:
bug #27531: join cache in EXPLAIN
mysql-test/r/derived.result:
bug #27531: join cache in EXPLAIN
mysql-test/r/distinct.result:
bug #27531: join cache in EXPLAIN
mysql-test/r/func_group.result:
bug #27531: join cache in EXPLAIN
mysql-test/r/func_group_innodb.result:
bug #27531: join cache in EXPLAIN
mysql-test/r/gis.result:
bug #27531: join cache in EXPLAIN
mysql-test/r/greedy_optimizer.result:
bug #27531: join cache in EXPLAIN
mysql-test/r/group_by.result:
bug #27531: join cache in EXPLAIN
mysql-test/r/group_min_max.result:
bug #27531: join cache in EXPLAIN
mysql-test/r/index_merge_myisam.result:
bug #27531: join cache in EXPLAIN
mysql-test/r/information_schema.result:
bug #27531: join cache in EXPLAIN
mysql-test/r/innodb_gis.result:
bug #27531: join cache in EXPLAIN
mysql-test/r/innodb_mysql.result:
bug #27531: join cache in EXPLAIN
mysql-test/r/join.result:
bug #27531: join cache in EXPLAIN
mysql-test/r/join_nested.result:
bug #27531: join cache in EXPLAIN
mysql-test/r/key_diff.result:
bug #27531: join cache in EXPLAIN
mysql-test/r/myisam.result:
bug #27531: join cache in EXPLAIN
mysql-test/r/ndb_condition_pushdown.result:
bug #27531: join cache in EXPLAIN
mysql-test/r/ndb_gis.result:
bug #27531: join cache in EXPLAIN
mysql-test/r/range.result:
bug #27531: join cache in EXPLAIN
mysql-test/r/row.result:
bug #27531: join cache in EXPLAIN
mysql-test/r/select.result:
bug #27531:
- join cache in EXPLAIN.
- prefer filesort over full scan over index for ORDER BY.
mysql-test/r/ssl.result:
bug #27531:
- join cache in EXPLAIN.
- prefer filesort over full scan over index for ORDER BY.
mysql-test/r/ssl_compress.result:
bug #27531:
- join cache in EXPLAIN.
- prefer filesort over full scan over index for ORDER BY.
mysql-test/r/subselect.result:
bug #27531: join cache in EXPLAIN
mysql-test/r/subselect3.result:
bug #27531: join cache in EXPLAIN
mysql-test/r/union.result:
bug #27531: join cache in EXPLAIN
mysql-test/r/view.result:
bug #27531: join cache in EXPLAIN
sql/sql_select.cc:
bug #27531:
- join cache in EXPLAIN.
- prefer filesort over full scan over
index for ORDER BY.
- disable sorting on the first table only
when switching from REF to RANGE.
into magare.gmz:/home/kgeorge/mysql/work/B27531-5.1-opt-after-merge
mysql-test/r/join.result:
Auto merged
mysql-test/t/join.test:
Auto merged
sql/sql_select.cc:
Auto merged
into magare.gmz:/home/kgeorge/mysql/work/B27531-5.0-opt
mysql-test/t/join.test:
Auto merged
sql/sql_select.cc:
Auto merged
mysql-test/r/join.result:
SCCS merged
When checking for applicability of join cache
we must disable its usage only if there is no
temp table in use.
When a temp table is used we can use join
cache (and it will not make the result-set
unordered) to fill the temp table. The filesort()
operation is then applied to the data in the temp
table and hence is not affected by join cache
usage.
Fixed by narrowing the condition for disabling
join cache to exclude the case where temp table
is used.
mysql-test/r/join.result:
Bug #27531: test case
mysql-test/t/join.test:
Bug #27531: test case
sql/sql_select.cc:
Bug #27531:
Disable join cache only if not using temp table
into mysql.com:/d2/hf/mrg/mysql-5.1-opt
mysql-test/r/alter_table.result:
Auto merged
mysql-test/r/distinct.result:
Auto merged
mysql-test/r/heap.result:
Auto merged
mysql-test/r/ps_2myisam.result:
Auto merged
mysql-test/r/ps_3innodb.result:
Auto merged
mysql-test/r/ps_4heap.result:
Auto merged
mysql-test/r/ps_5merge.result:
Auto merged
mysql-test/r/ps_7ndb.result:
Auto merged
mysql-test/r/query_cache.result:
Auto merged
BitKeeper/deleted/.del-CMakeLists.txt~1:
Auto merged
BitKeeper/deleted/.del-ps_6bdb.result:
Auto merged
mysql-test/t/alter_table.test:
Auto merged
mysys/my_error.c:
Auto merged
sql/field.cc:
Auto merged
sql/field.h:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_cmpfunc.h:
Auto merged
sql/item_sum.cc:
Auto merged
sql/key.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/table.cc:
Auto merged
tests/mysql_client_test.c:
Auto merged
mysql-test/include/mix1.inc:
merging
mysql-test/r/group_by.result:
SCCS merged
mysql-test/r/innodb_mysql.result:
merging
mysql-test/r/join.result:
merging
mysql-test/r/subselect.result:
merging
mysql-test/r/type_datetime.result:
SCCS merged
mysql-test/r/windows.result:
SCCS merged
mysql-test/t/group_by.test:
SCCS merged
mysql-test/t/join.test:
merging
mysql-test/t/subselect.test:
merging
mysql-test/t/type_datetime.test:
merging
mysql-test/t/windows.test:
SCCS merged
sql/item_timefunc.cc:
merging
sql/sql_base.cc:
SCCS merged
storage/innobase/handler/ha_innodb.cc:
merging
into pilot.blaudden:/home/msvensson/mysql/bug20166/my51-bug20166
BitKeeper/etc/ignore:
auto-union
BitKeeper/deleted/.del-init_db.sql~a77d572c39d5a1f8:
Auto merged
BitKeeper/deleted/.del-mysql_create_system_tables.sh:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/create.result:
Auto merged
mysql-test/r/join.result:
Auto merged
mysql-test/r/sp-security.result:
Auto merged
mysql-test/t/create.test:
Auto merged
mysql-test/t/grant2.test:
Auto merged
mysql-test/t/init_connect.test:
Auto merged
mysql-test/t/ndb_basic.test:
Auto merged
mysql-test/t/ndb_index_ordered.test:
Auto merged
mysql-test/t/ndb_multi.test:
Auto merged
scripts/Makefile.am:
Auto merged
BitKeeper/deleted/.del-init_db.sql~af2dfeabaa348dd7:
Auto merged
mysql-test/r/mysql_upgrade.result:
SCCS merged
mysql-test/t/lock_multi.test:
Use local
mysql-test/t/rpl_temporary.test:
Use local
mysql-test/Makefile.am:
Manual merge
scripts/mysql_fix_privilege_tables.sh:
Manual merge
scripts/mysql_fix_privilege_tables.sql.in:
Manual merge
scripts/mysql_install_db.sh:
Manual merge
- Use mysql_system_tables.sql to create MySQL system tables in
all places where we create them(mysql_install_db, mysql-test-run-pl
and mysql_fix_privilege_tables.sql)
BitKeeper/deleted/.del-init_db.sql:
Rename: mysql-test/init_db.sql -> BitKeeper/deleted/.del-init_db.sql
BitKeeper/deleted/.del-init_db.sql~a77d572c39d5a1f8:
Rename: mysql-test/lib/init_db.sql -> BitKeeper/deleted/.del-init_db.sql~a77d572c39d5a1f8
BitKeeper/deleted/.del-mysql_create_system_tables.sh:
Rename: scripts/mysql_create_system_tables.sh -> BitKeeper/deleted/.del-mysql_create_system_tables.sh
BitKeeper/etc/ignore:
Added scripts/mysql_fix_privilege_tables.sql to the ignore list
mysql-test/Makefile.am:
lib/init_db.sql has been removed
mysql-test/mysql-test-run.pl:
- Build var/tmp/bootstrap.sql from mysql_system_tables.sql,
mysql_test_data_timezone.sql and fill_help_tables.sql and use
it when bootsraping the system tables to use during test.
mysql-test/r/create.result:
Update result file
mysql-test/r/derived.result:
Update result file
mysql-test/r/join.result:
Update result file
mysql-test/r/mysql_upgrade.result:
Update result file
mysql-test/r/sp-security.result:
Update result file
mysql-test/t/create.test:
Add user mysqltest_1 before trying to connect as that user - no
anon users by default anymore
mysql-test/t/derived.test:
Add user mysqltest_1 before trying to connect as that user - no
anon users by default anymore
mysql-test/t/grant2.test:
Add anonymous users for part of thes that need it.
mysql-test/t/grant_cache.test:
Add anonymous users for part of thes that need it.
mysql-test/t/init_connect.test:
Add anonymous users for part of thes that need it.
mysql-test/t/lock_multi.test:
Add anonymous users for part of thes that need it.
mysql-test/t/ndb_basic.test:
Connect as "root", blank user will take currently logged in
username
mysql-test/t/ndb_index_ordered.test:
Connect as "root", blank user will take currently logged in
username
mysql-test/t/ndb_multi.test:
Connect as "root", blank user will take currently logged in
username
mysql-test/t/overflow.test:
Connect as root - no anonymous users by default anymore
mysql-test/t/rpl_temporary.test:
Add anonymous users for the test
mysql-test/t/xa.test:
Connect as "root", blank user wil pick currently logged in user
scripts/Makefile.am:
Remove mysql_create_system_tables.sh
Add mysql_system_tables.sql and mysql_test_data_timezone.sql
Build mysql_fix_privilege_tables.sql from mysql_system_tables.sql
and mysql_fix_privilege_tables.sql.in
scripts/mysql_fix_privilege_tables.sh:
Update message describing what the script does
scripts/mysql_fix_privilege_tables.sql.in:
Remove the part that creates system tables as that will be added to
mysql_fix_privileg_tables.sql from mysql_system_tables.sql
Change all comments to use #
scripts/mysql_install_db.sh:
Use mysql_system_tables.sql to create the MySQL system tables
Update comments and indentation
Add more descriptive comments about --windows switch
Reduce number of hardcoded names for the SQL files the script
looks for
mysql-test/include/add_anonymous_users.inc:
New BitKeeper file ``mysql-test/include/add_anonymous_users.inc''
mysql-test/include/delete_anonymous_users.inc:
New BitKeeper file ``mysql-test/include/delete_anonymous_users.inc''
scripts/mysql_system_tables.sql:
New BitKeeper file ``scripts/mysql_system_tables.sql''
scripts/mysql_test_data_timezone.sql:
New BitKeeper file ``scripts/mysql_test_data_timezone.sql''
into mysql.com:/home/gluh/MySQL/Merge/5.1-opt
mysql-test/r/order_by.result:
Auto merged
mysql-test/t/order_by.test:
Auto merged
sql/item.cc:
Auto merged
sql/mysqld.cc:
Auto merged
sql/sql_base.cc:
Auto merged
mysql-test/r/join.result:
manual merge
mysql-test/t/join.test:
manual merge
aliases ignored
When a column reference to a column in JOIN USING is resolved and a new
Item is created for this column the user defined name was lost.
This fix preserves the alias by setting the name of the new Item to the
original alias.
mysql-test/r/join.result:
BUG#25106: A USING clause in combination with a VIEW results in column
aliases ignored
- test case
mysql-test/t/join.test:
BUG#25106: A USING clause in combination with a VIEW results in column
aliases ignored
- test case
sql/sql_base.cc:
BUG#25106: A USING clause in combination with a VIEW results in column
aliases ignored
- take the alias of the Item to be replaced and set it into the newly
allocated Item.
libmysqld/lib_sql.cc:
check for bootstrap added
mysql-test/include/federated.inc:
disabled in embedded
mysql-test/mysql-test-run.pl:
we disable ssh in embedded server
mysql-test/r/bdb.result:
part moved to bdb_notembedded as it uses binlog
mysql-test/r/flush_block_commit.result:
part moved to flush_block_commit_notembedded
mysql-test/r/insert.result:
part moved to insert_notembedded as delayed works differently in embedded server
mysql-test/r/insert_select.result:
part moved to insert_notembedded as GRANTS usually disabled in embedded server
mysql-test/r/join.result:
access rights hidden in result
mysql-test/t/backup.test:
now available in embedded server
mysql-test/t/bdb.test:
part moved to bdb_notembedded as it uses binlog
mysql-test/t/delayed.test:
code trimmed
mysql-test/t/execution_constants.test:
skipped in embedded-server mode
mysql-test/t/flush_block_commit.test:
moved to flush_block_commit_notembedded
mysql-test/t/information_schema_db.test:
skipped in embedded-server
mysql-test/t/innodb.test:
directories replaced to be embedded-server compliant
mysql-test/t/insert.test:
part moved to insert_notembedded
mysql-test/t/insert_select.test:
part moved to insert_notembedded
mysql-test/t/join.test:
access rights hidden
mysql-test/t/status.test:
skipped in embedded server
mysql-test/t/trigger.test:
directories replaced to be embedded-server compliant
sql/item_strfunc.cc:
extra contexts not needed whan access checks disabled
sql/share/errmsg.txt:
bigger paths reserved to prevent test's fails
mysql-test/r/bdb_notembedded.result:
***MISSING WEAVE***
mysql-test/r/flush_block_commit_notembedded.result:
added
mysql-test/r/insert_notembedded.result:
added
mysql-test/t/bdb_notembedded.test:
***MISSING WEAVE***
mysql-test/t/flush_block_commit_notembedded.test:
added
mysql-test/t/insert_notembedded.test:
added
- Re-worked the prev_record_reads() function to return the lower bound of
number of different table access scans that will be performed.
mysql-test/r/join.result:
BUG#14940: testcase
mysql-test/t/join.test:
BUG#14940: testcase
sql/sql_select.cc:
BUG#14940: Slow join order is chosen:
- Re-worked the prev_record_reads() function to return the lower bound of
number of different table access scans that will be performed.
sql/sql_select.h:
BUG#14940: Slow join order is chosen:
- Added comments in struct POSITION
- Added POSITION::ref_depend_map: bitmap of tables that the table access
method depends on.
- Make the range-et-al optimizer produce E(#table records after table
condition is applied),
- Make the join optimizer use this value,
- Add "filtered" column to EXPLAIN EXTENDED to show
fraction of records left after table condition is applied
- Adjust test results, add comments
mysql-test/r/archive_gis.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/auto_increment.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/bdb_gis.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/bench_count_distinct.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/binlog_stm_blackhole.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/case.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/cast.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/compress.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/ctype_collate.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/ctype_cp1250_ch.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/date_formats.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/distinct.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/fulltext.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_compress.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_crypt.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_default.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_encrypt.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_gconcat.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_group.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_if.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_in.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_like.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_math.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_op.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_regexp.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_set.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_str.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_system.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_test.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/func_time.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/gis.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/group_by.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/group_min_max.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/having.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/heap.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/heap_hash.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/index_merge.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/index_merge_innodb.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/index_merge_ror.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/innodb_gis.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/insert_update.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/join.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/join_nested.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/key_diff.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/myisam.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/ndb_gis.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/negation_elimination.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/null.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/olap.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/partition_pruning.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/query_cache.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/row.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/rpl_get_lock.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/rpl_master_pos_wait.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/select.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/ssl.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/ssl_compress.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/subselect.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/type_blob.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/union.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/varbinary.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/variables.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/r/view.result:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/t/ctype_cp1250_ch.test:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/t/func_like.test:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/t/group_min_max.test:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/t/index_merge_ror.test:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/t/index_merge_ror_cpk.test:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/t/join.test:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
mysql-test/t/partition_pruning.test:
BUG#14940: Adjust the test results: EXPLAIN EXTENDED now has extra "filtered" column
sql/opt_range.cc:
BUG#14940: Make range/index_merge/group-min-max optimizer produce TABLE::quick_condition_rows -
estimate of #records that will match the table condition.
sql/sql_class.cc:
BUG#14940: Add "filtered" column to output of EXPLAIN EXTENDED
sql/sql_select.cc:
BUG#14940:
- Make the join optimizer to use TABLE::quick_condition_rows=
= E(#table records after filtering with table condition)
- Add "filtered" column to output of EXPLAIN EXTENDED
sql/sql_select.h:
BUG#14940: Added comments
sql/table.h:
BUG#14940: Added comments
into bk-internal.mysql.com:/data0/bk/mysql-5.1-kt
mysql-test/r/join.result:
Auto merged
mysql-test/t/join.test:
Auto merged
sql/log.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_show.cc:
Auto merged
query
Problem:
There was a wrong context assigned to the columns that were added in insert_fields()
when expanding a '*'. When this is done in a prepared statement it causes
fix_fields() to fail to find the table that these columns reference.
Actually the right context is set in setup_natural_join_row_types() called at the
end of setup_tables(). However when executed in a context of a prepared statement
setup_tables() resets the context, but setup_natural_join_row_types() was not
setting it to the correct value assuming it has already done so.
Solution:
The top-most, left-most NATURAL/USING join must be set as a
first_name_resolution_table in context even when operating on prepared statements.
mysql-test/r/join.result:
testsuite for the bug
mysql-test/t/join.test:
testsuite for the bug
sql/sql_base.cc:
The context must be set even when executed as prepared statement.
mysql-test/r/information_schema.result:
Fix for bug#19236 bad COLUMNS.CHARACTER_MAXIMUM_LENGHT and CHARACTER_OCTET_LENGTH
test case
mysql-test/r/join.result:
Fix for bug#19236 bad COLUMNS.CHARACTER_MAXIMUM_LENGHT and CHARACTER_OCTET_LENGTH
result fix
mysql-test/t/information_schema.test:
Fix for bug#19236 bad COLUMNS.CHARACTER_MAXIMUM_LENGHT and CHARACTER_OCTET_LENGTH
test case
into mysql.com:/home/timka/mysql/src/5.0-bug-15229
mysql-test/r/join.result:
Auto merged
mysql-test/t/join.test:
Auto merged
sql/table.cc:
Auto merged
sql/table.h:
Auto merged
sql/sql_base.cc:
SCCS merged
The cause of this bug was a design flaw due to which the list of natural
join columns was incorrectly computed and stored for nested joins that
are not natural joins, but are operands (possibly indirect) of nested joins.
The patch corrects the flaw in a such a way, that the result columns of a
table reference are materialized only if it is a leaf table (that is, only
if it is a view, stored table, or natural/using join).
mysql-test/r/join.result:
Added test for BUG#15229 and uncommented failing test cases of
BUG#15357 (now fixed by this patch).
mysql-test/t/join.test:
Added test for BUG#15229 and uncommented failing test cases of
BUG#15357 (now fixed by this patch).
sql/sql_base.cc:
- Do not materialize the result columns of regular nested joins
(that are not natural/using joins).
- Moved most of the code that creates/adds new natural join column
references to the method 'get_or_create_column_ref', and simplified
'mark_common_columns'.
- Replaced a call to 'get_or_create_column_ref' with 'get_natural_column_ref'
where it is for sure all columns are alredy created.
sql/table.cc:
- Modified the method 'get_or_create_column_ref' so that it adds itself
the newly created natural join columns to the respective table reference.
sql/table.h:
- Modified the method 'get_or_create_column_ref' so that it adds itself
the newly created natural join columns to the respective table reference.
The cause of the bug was an ASSERT that checked the consistency
of TABLE_SHARE::db and TABLE_LIST::db and failed for I_S tables.
The fix relaxes the requirement for consistency for I_S.
mysql-test/r/join.result:
Added test for BUG#17523
mysql-test/t/join.test:
Added test for BUG#17523
sql/table.cc:
Take into account that for I_S tables, TABLE_SHARE::db == 0,
while TABLE_LIST::db contains the database name of a table.
The only change is in the ASSERTs.
Commented out one failing query in the regression test (reported as a bug).
mysql-test/r/join.result:
Commented out failing query.
mysql-test/t/join.test:
Commented out failing query.
Implemented specialized regression test for the WL.
mysql-test/r/join.result:
Test results for natural join tests.
mysql-test/t/join.test:
Specialized test for natural join, and join ... on.
* Provide backwards compatibility extension to name resolution of
coalesced columns. The patch allows such columns to be qualified
with a table (and db) name, as it is in 4.1.
Based on a patch from Monty.
* Adjusted tests accordingly to test both backwards compatible name
resolution of qualified columns, and ANSI-style resolution of
non-qualified columns.
For this, each affected test has two versions - one with qualified
columns, and one without.
mysql-test/include/ps_query.inc:
Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/bdb.result:
Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/innodb.result:
Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/join.result:
Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/join_nested.result:
Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/join_outer.result:
Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/null_key.result:
Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/order_by.result:
Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/ps_2myisam.result:
Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/ps_3innodb.result:
Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/ps_4heap.result:
Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/ps_5merge.result:
Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/ps_6bdb.result:
Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/ps_7ndb.result:
Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/select.result:
Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/subselect.result:
Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/type_ranges.result:
Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/bdb.test:
Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/innodb.test:
Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/join.test:
Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/join_nested.test:
Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/join_outer.test:
Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/null_key.test:
Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/order_by.test:
Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/select.test:
Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/subselect.test:
Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/type_ranges.test:
Put back old tests to test that coalesced columns of natural joins can be qualified.
sql/sql_base.cc:
* Applied Monty's patch for backwards compatible name resolution
of qualified columns. The idea is:
- When a column is qualified, search for the column in all
tables/views underlying each natural join. In this case
natural joins are *not* considered leaves.
- If a column is not qualified, then consider natural joins
as leaves, thus directly search the result columns of
natural joins.
* Simplified 'find_field_in_tables()' - unified two similar
loops into one.
sql/table.cc:
- Removed method & members not needed after Monty's patch.
sql/table.h:
- Removed method & members not needed after Monty's patch.
tests/mysql_client_test.c:
Put back old tests to test that coalesced columns of natural joins can be qualified.