mariadb/sql
Sergey Petrunya 2c28412e2e Port of code for: (part of testcase is in mysql-test/t/subquery*.test and will be ported separately)
Bug#11766642: crash in Item_field::register_field_in_read_map 
              with view

(Former 59793)

Prior to the refactoring in this patch, Item_cond_xor behaved 
partially as an Item_cond and partially as an Item_func. The
reasoning behind this was that XOR is currently not optimized
(thus should be Item_func instead of Item_cond), but it was 
planned optimize it in the future (thus, made Item_cond anyway 
to ease optimization later). 

Even though Item_cond inherits from Item_func, there are 
differences between these two. One difference is that the 
arguments are stored differently. Item_cond stores them in a 
list while Item_func store them in an args[]. 

BUG no 45221 was caused by Item_cond_xor storing arguments in 
the list while users of the objects would look for them in 
args[]. The fix back then was to store the arguments in both 
locations.

In this bug, Item_cond_xor initially gets two Item_field 
arguments. These are stored in the list inherited from 
Item_cond and in args[] inherited from Item_func. During
resolution, find_field_in_view() replaces the Item_fields 
stored in the list with Item_direct_view_refs, but args[] 
still points to the unresolved Item_fields. This shows that 
the fix for 45221 was incorrect.

The refactoring performed in this patch removes the confusion
by making the XOR item an Item_func period. A neg_transformer() 
is also implemented for Item_func_xor to improve performance 
when negating XOR expressions. An XOR is negated by negating 
one of the operands.
2011-07-11 23:48:35 +04:00
..
examples
share
.cvsignore
add_errmsg
authors.h
client_settings.h
CMakeLists.txt
contributors.h
create_options.cc
create_options.h
custom_conf.h
debug_sync.cc
debug_sync.h
derror.cc
des_key_file.cc
discover.cc
event_data_objects.cc
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
event_scheduler.h
events.cc
events.h
field.cc
field.h
field_conv.cc
filesort.cc
frm_crypt.cc
gen_lex_hash.cc
gstream.cc
gstream.h
ha_ndbcluster.cc
ha_ndbcluster.h
ha_ndbcluster_binlog.cc
ha_ndbcluster_binlog.h
ha_ndbcluster_cond.cc
ha_ndbcluster_cond.h
ha_ndbcluster_tables.h
ha_partition.cc
ha_partition.h
handler.cc
handler.h Semi-join fixes: make COST_VECT objects survive add_io(add_io_cnt=0, add_avg_cost=...) calls without 2011-07-09 16:33:40 +04:00
hash_filo.cc
hash_filo.h
hostname.cc
init.cc
item.cc [No BUG#] Fixes for problems discovered when running mysql-trunk's subquery testsuite 2011-07-09 13:47:41 +04:00
item.h Fixed LP bug #804686. 2011-07-03 14:59:01 -07:00
item_buff.cc
item_cmpfunc.cc Port of code for: (part of testcase is in mysql-test/t/subquery*.test and will be ported separately) 2011-07-11 23:48:35 +04:00
item_cmpfunc.h Port of code for: (part of testcase is in mysql-test/t/subquery*.test and will be ported separately) 2011-07-11 23:48:35 +04:00
item_create.cc
item_create.h
item_func.cc
item_func.h Port of code for: (part of testcase is in mysql-test/t/subquery*.test and will be ported separately) 2011-07-11 23:48:35 +04:00
item_geofunc.cc
item_geofunc.h
item_row.cc
item_row.h
item_strfunc.cc merge Windows performance patches into 5.3 2011-07-05 21:46:53 +02:00
item_strfunc.h
item_subselect.cc
item_subselect.h
item_sum.cc
item_sum.h
item_timefunc.cc
item_timefunc.h
item_xmlfunc.cc
item_xmlfunc.h
key.cc
lex.h
lex_symbol.h
lock.cc
log.cc
log.h
log_event.cc
log_event.h
log_event_old.cc
log_event_old.h
log_slow.h
Makefile.am
message.h
message.mc
message.rc
mf_iocache.cc
MSG00001.bin
multi_range_read.cc
multi_range_read.h
my_decimal.cc
my_decimal.h
my_lock.c
mysql_install_db.cc
mysql_priv.h Make table_elimination=on|off flag to be always present in @@optimizer_switch. 2011-07-08 19:09:30 +04:00
mysql_upgrade_service.cc
mysqld.cc Make table_elimination=on|off flag to be always present in @@optimizer_switch. 2011-07-08 19:09:30 +04:00
mysqld_suffix.h
net_serv.cc
nt_servc.cc
nt_servc.h
opt_index_cond_pushdown.cc
opt_range.cc Fix LP bug lp:802979 2011-07-04 14:51:16 +03:00
opt_range.h
opt_range_mrr.cc
opt_subselect.cc Alternate version of MySQL's fix for BUG#49453. 2011-07-11 17:13:16 +04:00
opt_subselect.h
opt_sum.cc
opt_table_elimination.cc
parse_file.cc fix compile warnings 2011-07-05 22:38:38 +02:00
parse_file.h
partition_element.h
partition_info.cc
partition_info.h
password.c
procedure.cc
procedure.h
protocol.cc Added progress reporting for alter table, LOAD DATA INFILE and for aria tables: check table, repair table, analyze table. 2011-07-01 15:08:30 +03:00
protocol.h Added progress reporting for alter table, LOAD DATA INFILE and for aria tables: check table, repair table, analyze table. 2011-07-01 15:08:30 +03:00
records.cc
repl_failsafe.cc
repl_failsafe.h
rpl_constants.h
rpl_filter.cc
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
rpl_reporting.h
rpl_rli.cc
rpl_rli.h
rpl_tblmap.cc
rpl_tblmap.h
rpl_utility.cc
rpl_utility.h
scheduler.cc
scheduler.h
set_var.cc Added progress reporting for alter table, LOAD DATA INFILE and for aria tables: check table, repair table, analyze table. 2011-07-01 15:08:30 +03:00
set_var.h
slave.cc
slave.h
sp.cc
sp.h
sp_cache.cc
sp_cache.h
sp_head.cc
sp_head.h
sp_pcontext.cc
sp_pcontext.h
sp_rcontext.cc
sp_rcontext.h
spatial.cc
spatial.h
sql_acl.cc Added progress reporting for alter table, LOAD DATA INFILE and for aria tables: check table, repair table, analyze table. 2011-07-01 15:08:30 +03:00
sql_acl.h
sql_analyse.cc
sql_analyse.h
sql_array.h
sql_base.cc
sql_binlog.cc
sql_bitmap.h
sql_builtin.cc.in
sql_cache.cc
sql_cache.h
sql_class.cc Added progress reporting for alter table, LOAD DATA INFILE and for aria tables: check table, repair table, analyze table. 2011-07-01 15:08:30 +03:00
sql_class.h Added progress reporting for alter table, LOAD DATA INFILE and for aria tables: check table, repair table, analyze table. 2011-07-01 15:08:30 +03:00
sql_client.cc
sql_connect.cc
sql_crypt.cc
sql_crypt.h
sql_cursor.cc
sql_cursor.h
sql_db.cc
sql_delete.cc
sql_derived.cc
sql_do.cc
sql_error.cc
sql_error.h
sql_expression_cache.cc
sql_expression_cache.h
sql_handler.cc
sql_handler.h
sql_help.cc
sql_insert.cc
sql_join_cache.cc
sql_join_cache.h
sql_lex.cc Fixed LP bug #806477. 2011-07-07 13:04:48 -07:00
sql_lex.h
sql_lifo_buffer.h
sql_list.cc
sql_list.h
sql_load.cc Added progress reporting for alter table, LOAD DATA INFILE and for aria tables: check table, repair table, analyze table. 2011-07-01 15:08:30 +03:00
sql_locale.cc
sql_manager.cc
sql_map.cc
sql_map.h
sql_olap.cc
sql_parse.cc Added progress reporting for alter table, LOAD DATA INFILE and for aria tables: check table, repair table, analyze table. 2011-07-01 15:08:30 +03:00
sql_partition.cc
sql_partition.h
sql_plugin.cc
sql_plugin.h
sql_plugin_services.h Added progress reporting for alter table, LOAD DATA INFILE and for aria tables: check table, repair table, analyze table. 2011-07-01 15:08:30 +03:00
sql_prepare.cc
sql_profile.cc
sql_profile.h
sql_rename.cc
sql_repl.cc
sql_repl.h
sql_select.cc Fixed LP bug #806510. 2011-07-08 16:39:28 -07:00
sql_select.h
sql_servers.cc
sql_servers.h
sql_show.cc Added progress reporting for alter table, LOAD DATA INFILE and for aria tables: check table, repair table, analyze table. 2011-07-01 15:08:30 +03:00
sql_show.h
sql_sort.h
sql_state.c
sql_string.cc
sql_string.h
sql_table.cc Added progress reporting for alter table, LOAD DATA INFILE and for aria tables: check table, repair table, analyze table. 2011-07-01 15:08:30 +03:00
sql_tablespace.cc
sql_test.cc
sql_trigger.cc
sql_trigger.h
sql_udf.cc
sql_udf.h
sql_union.cc
sql_update.cc
sql_view.cc
sql_view.h
sql_yacc.yy Port of code for: (part of testcase is in mysql-test/t/subquery*.test and will be ported separately) 2011-07-11 23:48:35 +04:00
strfunc.cc
structs.h
table.cc
table.h [No BUG#] Fixes for problems discovered when running mysql-trunk's subquery testsuite 2011-07-09 13:47:41 +04:00
thr_malloc.cc
time.cc
tzfile.h
tztime.cc
tztime.h
udf_example.c
udf_example.def
uniques.cc
unireg.cc
unireg.h
winservice.c
winservice.h