mariadb/sql
Evgeny Potemkin 60fc8507bd Bug#30302: Tables that were optimized away are printed in the
EXPLAIN EXTENDED warning.

Query optimizer searches for the constant tables and optimizes them away. This
means that fields of such tables are substituted for their values and on later
phases they are treated as constants. After this constant tables are removed
from the query execution plan. Nevertheless constant tables were shown in 
the EXPLAIN EXTENDED warning thus producing query that might be not an
equivalent of the original query.
        
Now the print_join function skips all tables that were optimized away from
printing to the EXPLAIN EXTENDED warning. If all tables were optimized away it
produces the 'FROM dual' clause.


mysql-test/r/explain.result:
  A test case added for the bug#30302.
mysql-test/r/func_default.result:
  Adjusted test case result after fix for the bug#30302.
mysql-test/r/func_regexp.result:
  Adjusted test case result after fix for the bug#30302.
mysql-test/r/func_test.result:
  Adjusted test case result after fix for the bug#30302.
mysql-test/r/having.result:
  Adjusted test case result after fix for the bug#30302.
mysql-test/r/select.result:
  Adjusted test case result after fix for the bug#30302.
mysql-test/r/subselect.result:
  Adjusted test case result after fix for the bug#30302.
mysql-test/r/subselect3.result:
  Adjusted test case result after fix for the bug#30302.
mysql-test/r/type_datetime.result:
  Adjusted test case result after fix for the bug#30302.
mysql-test/t/explain.test:
  A test case added for the bug#30302.
sql/sql_select.cc:
  Bug#30302: Tables that were optimized away are printed in the
  EXPLAIN EXTENDED warning.
  Now the print_join function skips all tables that were optimized away from
  printing to the EXPLAIN EXTENDED warning. If all tables were optimized away it
  produces the 'FROM dual' clause.
sql/table.h:
  Adjusted test case result after fix for the bug#30302.
  The optimized_away flag is added to the TABLE_LIST struct.
2009-10-19 15:13:26 +04:00
..
examples Bug #43414 Parenthesis (and other) warnings compiling MySQL 2009-06-17 15:54:01 +02:00
share Merge mysql-next-mr --> mysql-trunk-signal 2009-09-17 03:20:11 -06:00
.cvsignore
add_errmsg
authors.h WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
client_settings.h Bug#46013: rpl_extraColmaster_myisam fails on pb2 2009-08-13 17:07:20 -03:00
CMakeLists.txt Backport http://lists.mysql.com/commits/57778 2009-09-30 15:35:01 +02:00
contributors.h
custom_conf.h
derror.cc
des_key_file.cc
discover.cc
event_data_objects.cc A backport of a patch for Bug#35297. 2009-10-08 00:57:03 +04:00
event_data_objects.h
event_db_repository.cc
event_db_repository.h
event_parse_data.cc
event_parse_data.h
event_queue.cc
event_queue.h
event_scheduler.cc WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
event_scheduler.h
events.cc Bug #44331 Restore of database with events produces warning in replication 2009-08-29 16:52:22 +08:00
events.h
field.cc Merge mysql-next-mr --> mysql-trunk-signal 2009-09-17 03:20:11 -06:00
field.h Ported WL#3220 to mysql-next-mr. 2009-09-28 10:21:25 +03:00
field_conv.cc Bug #43414 Parenthesis (and other) warnings compiling MySQL 2009-06-17 15:54:01 +02:00
filesort.cc
frm_crypt.cc
gen_lex_hash.cc
gstream.cc Bug #43414 Parenthesis (and other) warnings compiling MySQL 2009-06-09 18:11:21 +02:00
gstream.h
ha_ndbcluster.cc WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
ha_ndbcluster.h
ha_ndbcluster_binlog.cc WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
ha_ndbcluster_binlog.h
ha_ndbcluster_cond.cc
ha_ndbcluster_cond.h
ha_ndbcluster_tables.h
ha_partition.cc Merge to mysql-next-mr 2009-09-28 09:39:50 +02:00
ha_partition.h Merge to mysql-next-mr 2009-09-28 09:39:50 +02:00
handler.cc Merge to mysql-next-mr 2009-09-28 09:39:50 +02:00
handler.h automerge 2009-08-17 17:14:51 +03:00
hash_filo.cc
hash_filo.h
hostname.cc
init.cc
item.cc Merge mysql-next-mr --> mysql-trunk-signal 2009-09-17 03:20:11 -06:00
item.h Manual merge between bug#46362 and bug#20577. 2009-08-28 12:55:59 +02:00
item_buff.cc
item_cmpfunc.cc Merge from 5.0 for 43414 2009-08-28 18:21:54 +02:00
item_cmpfunc.h
item_create.cc Merge from 5.0 for 43414 2009-08-28 18:21:54 +02:00
item_create.h
item_func.cc Merge mysql-next-mr --> mysql-trunk-signal 2009-09-17 03:20:11 -06:00
item_func.h Bug#45261: Crash, stored procedure + decimal 2009-08-24 16:47:08 -03:00
item_geofunc.cc Bug#44684: valgrind reports invalid reads in 2009-06-17 16:58:33 +02:00
item_geofunc.h
item_row.cc
item_row.h
item_strfunc.cc Merge mysql-next-mr --> mysql-trunk-signal 2009-09-17 03:20:11 -06:00
item_strfunc.h Manual merge. 2009-06-01 16:00:38 +04:00
item_subselect.cc Fix for bug#46629: Item_in_subselect::val_int(): Assertion `0' 2009-09-04 13:14:54 +05:00
item_subselect.h
item_sum.cc Ported WL#3220 to mysql-next-mr. 2009-09-28 10:21:25 +03:00
item_sum.h Ported WL#3220 to mysql-next-mr. 2009-09-28 10:21:25 +03:00
item_timefunc.cc Merge mysql-next-mr --> mysql-trunk-signal 2009-09-17 03:20:11 -06:00
item_timefunc.h Backport of fix to bug #33629 into mysql-next-mr-bugfixing. 2009-10-13 21:50:08 +05:00
item_xmlfunc.cc Bug#43183 ExctractValue() brings result list in missorder 2009-04-01 13:40:33 +05:00
item_xmlfunc.h
key.cc
lex.h WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
lex_symbol.h
lock.cc Merge from 5.0 for 43414 2009-08-28 18:21:54 +02:00
log.cc backport of 2009-09-30 22:10:22 +02:00
log.h BUG#43929 binlog corruption when max_binlog_cache_size is exceeded 2009-06-18 14:52:46 +01:00
log_event.cc Merge mysql-next-mr --> mysql-trunk-signal 2009-09-17 03:20:11 -06:00
log_event.h merge: 5.1-bt bug branch --> 5.1-bt latest 2009-06-30 19:40:38 +01:00
log_event_old.cc WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
log_event_old.h
Makefile.am WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
message.h
message.mc
message.rc
mf_iocache.cc
MSG00001.bin
my_decimal.cc WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
my_decimal.h Bug#45261: Crash, stored procedure + decimal 2009-08-24 16:47:08 -03:00
my_lock.c
mysql_priv.h Merge mysql-next-mr --> mysql-trunk-signal 2009-09-17 03:20:11 -06:00
mysql_priv.h.pp
mysqld.cc Bug #48047 Can't do normal shutdown 2009-10-15 05:18:52 +02:00
mysqld_suffix.h
net_serv.cc merge of 5.1-main into mysql-trunk. 2009-08-12 15:44:34 +02:00
nt_servc.cc
nt_servc.h
opt_range.cc Ported WL#3220 to mysql-next-mr. 2009-09-28 10:21:25 +03:00
opt_range.h Ported WL#3220 to mysql-next-mr. 2009-09-28 10:21:25 +03:00
opt_sum.cc Ported WL#3220 to mysql-next-mr. 2009-09-28 10:21:25 +03:00
parse_file.cc Bug#44834 strxnmov is expected to behave as you'd expect 2009-06-19 13:24:43 +05:00
parse_file.h Bug#43385 Cannot ALTER DATABASE ... UPGRADE DATA DIRECTORY NAME when Views exist(addon) 2009-04-13 18:09:10 +05:00
partition_element.h WL#4444 Added TRUNCATE partition support, fixes bug#19405 and bug #35111 2009-09-10 11:15:39 +02:00
partition_info.cc
partition_info.h fixed a valgrind warning in partition_pruning 2009-09-02 18:42:08 +03:00
password.c Manual merge. 2009-06-01 16:00:38 +04:00
procedure.cc
procedure.h
protocol.cc Backporting WL#3759 Optimize identifier conversion in client-server protocol 2009-09-30 10:09:28 +05:00
protocol.h Backporting WL#3759 Optimize identifier conversion in client-server protocol 2009-09-30 10:09:28 +05:00
records.cc
repl_failsafe.cc WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
repl_failsafe.h
rpl_constants.h
rpl_filter.cc A patch for Bug#45118 (mysqld.exe crashed in debug mode 2009-09-10 11:40:57 +04:00
rpl_filter.h
rpl_injector.cc
rpl_injector.h
rpl_mi.cc
rpl_mi.h
rpl_record.cc
rpl_record.h
rpl_record_old.cc
rpl_record_old.h
rpl_reporting.cc BUG#45511 rpl.rpl_binlog_corruption fails with warning messages in Valgrind 2009-06-16 16:04:30 +01:00
rpl_reporting.h BUG#45511 rpl.rpl_binlog_corruption fails with warning messages in Valgrind 2009-06-16 16:04:30 +01:00
rpl_rli.cc WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
rpl_rli.h
rpl_tblmap.cc
rpl_tblmap.h
rpl_utility.cc
rpl_utility.h Bug#42977 RBR logs for rows with more than 250 column results in corrupt binlog 2009-03-25 12:53:56 +02:00
scheduler.cc
scheduler.h
set_var.cc Pull from mysql-next-mr. 2009-10-09 13:50:49 +04:00
set_var.h Bug #32223 SETting max_allowed_packet variable 2009-06-19 11:27:19 +02:00
slave.cc WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
slave.h BUG#44581 Slave stops when transaction with non-transactional table gets lock wait 2009-07-06 09:02:14 +01:00
sp.cc WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
sp.h BUG#41166 stored function requires "deterministic" if binlog_format is "statement" 2009-07-28 18:44:38 +01:00
sp_cache.cc
sp_cache.h
sp_head.cc WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
sp_head.h merging 2009-04-29 07:59:10 +05:00
sp_pcontext.cc WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
sp_pcontext.h WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
sp_rcontext.cc WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
sp_rcontext.h WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
spatial.cc Merge from 5.0 for 43414 2009-08-28 18:21:54 +02:00
spatial.h Merge from 5.0-bugteam 2009-06-17 16:56:44 +02:00
sql_acl.cc WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
sql_acl.h Bug#44658 Create procedure makes server crash when user does not have ALL privilege 2009-05-29 15:37:54 +02:00
sql_analyse.cc Merge from 5.0-bugteam 2009-06-17 16:56:44 +02:00
sql_analyse.h
sql_array.h
sql_base.cc Merge mysql-next-mr --> mysql-trunk-signal 2009-09-17 03:20:11 -06:00
sql_binlog.cc
sql_bitmap.h
sql_builtin.cc.in
sql_cache.cc WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
sql_cache.h Undoing mikael@mysql.com-20081015100345-8tu2vmh7mzs60c23 2009-08-04 13:37:32 +02:00
sql_class.cc Merge mysql-next-mr --> mysql-trunk-signal 2009-09-17 03:20:11 -06:00
sql_class.h Ported WL#3220 to mysql-next-mr. 2009-09-28 10:21:25 +03:00
sql_client.cc
sql_connect.cc backport of 2009-09-30 22:10:22 +02:00
sql_crypt.cc Bug#44358 valgrind errors with decode() function 2009-04-23 12:43:42 +05:00
sql_crypt.h Bug#44358 valgrind errors with decode() function 2009-04-23 12:43:42 +05:00
sql_cursor.cc
sql_cursor.h
sql_db.cc A backport of patch for Bug#26704. 2009-10-07 20:39:57 +04:00
sql_delete.cc WL#4444 Added TRUNCATE partition support, fixes bug#19405 and bug #35111 2009-09-10 11:15:39 +02:00
sql_derived.cc WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
sql_do.cc
sql_error.cc WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
sql_error.h WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
sql_handler.cc Bug#45781 infinite hang/crash in "opening tables" after handler tries to open merge 2009-07-16 01:23:57 +02:00
sql_help.cc Merge from 5.0-bugteam 2009-06-17 16:56:44 +02:00
sql_insert.cc Backport of this changeset 2009-09-30 17:40:12 +02:00
sql_lex.cc Manual merge. 2009-08-10 15:46:20 -03:00
sql_lex.h WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
sql_list.cc
sql_list.h Backport WL#3653 to 5.1 to enable bundled innodb plugin. 2009-06-10 10:59:49 +02:00
sql_load.cc WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
sql_locale.cc
sql_manager.cc
sql_map.cc
sql_map.h
sql_olap.cc
sql_parse.cc Merge mysql-next-mr --> mysql-trunk-signal 2009-09-17 03:20:11 -06:00
sql_partition.cc Backport of the fix for BUG#33730 "Full table scan instead selected partitions for query more than 10 partitions" 2009-10-05 22:59:19 +02:00
sql_partition.h
sql_plugin.cc bug#33731 - INSTALL/UNINSTALL PLUGIN: Inconsistent handling of identifier case 2009-10-12 20:15:10 +02:00
sql_plugin.h Bug#19027 MySQL 5.0 starts even with Fatal InnoDB errors 2009-05-14 14:03:33 +02:00
sql_prepare.cc WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
sql_profile.cc Bug #45287: phase 2 : 5.0 64 bit compilation warnings 2009-07-16 15:37:38 +03:00
sql_profile.h Backport WL#3653 to 5.1 to enable bundled innodb plugin. 2009-06-10 10:59:49 +02:00
sql_rename.cc Bug#44834 strxnmov is expected to behave as you'd expect 2009-06-19 13:24:43 +05:00
sql_repl.cc WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
sql_repl.h
sql_select.cc Bug#30302: Tables that were optimized away are printed in the 2009-10-19 15:13:26 +04:00
sql_select.h Ported WL#3220 to mysql-next-mr. 2009-09-28 10:21:25 +03:00
sql_servers.cc WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
sql_servers.h
sql_show.cc WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
sql_show.h
sql_signal.cc WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
sql_signal.h WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
sql_sort.h
sql_state.c
sql_string.cc Backporting WL#3759 Optimize identifier conversion in client-server protocol 2009-09-30 10:09:28 +05:00
sql_string.h Bug# 30946: mysqldump silently ignores --default-character-set 2009-07-31 22:14:52 +05:00
sql_table.cc Merge to mysql-next-mr 2009-09-28 09:39:50 +02:00
sql_tablespace.cc WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
sql_test.cc Bug#44164: TL_WRITE has no description in lock_descriptions[] 2009-04-14 14:05:32 +02:00
sql_trigger.cc Merge from 5.0-bugteam 2009-06-17 16:56:44 +02:00
sql_trigger.h
sql_udf.cc
sql_udf.h
sql_union.cc 5.0-bugteam->5.1-bugteam merge 2009-05-15 12:11:07 +05:00
sql_update.cc WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
sql_view.cc Merge from 5.0 for 43414 2009-08-28 18:21:54 +02:00
sql_view.h Bug#43385 Cannot ALTER DATABASE ... UPGRADE DATA DIRECTORY NAME when Views exist(addon) 2009-04-13 18:09:10 +05:00
sql_yacc.yy merge mysql-trunk-wl4444_4571 to mysql-wl3220-next-mr 2009-09-29 10:34:37 +03:00
strfunc.cc @@optimizer_switch backport and change from no_xxx to xx=on|off: post-review fixes 2009-03-14 21:58:23 +03:00
structs.h Bug#45266: Uninitialized variable lead to an empty result. 2009-06-26 19:57:42 +00:00
table.cc WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
table.h Bug#30302: Tables that were optimized away are printed in the 2009-10-19 15:13:26 +04:00
thr_malloc.cc WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
time.cc WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
tzfile.h
tztime.cc WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
tztime.h
udf_example.c Backport http://lists.mysql.com/commits/57778 2009-09-30 15:35:01 +02:00
udf_example.def
uniques.cc Merge from 5.0-bugteam 2009-06-17 16:56:44 +02:00
unireg.cc Merge mysql-next-mr --> mysql-trunk-signal 2009-09-17 03:20:11 -06:00
unireg.h Auto-merge 2009-07-31 15:28:15 -04:00