mariadb/sql
dlenev@mockturtle.local 5f149dde09 Fix for bug#20670 "UPDATE using key and invoking trigger that modifies
this key does not stop" (5.1 version).

UPDATE statement which WHERE clause used key and which invoked trigger
that modified field in this key worked indefinetely.

This problem occured because in cases when UPDATE statement was
executed in update-on-the-fly mode (in which row is updated right
during evaluation of select for WHERE clause) the new version of
the row became visible to select representing WHERE clause and was
updated again and again.
We already solve this problem for UPDATE statements which does not
invoke triggers by detecting the fact that we are going to update
field in key used for scanning and performing update in two steps,
during the first step we gather information about the rows to be
updated and then doing actual updates. We also do this for
MULTI-UPDATE and in its case we even detect situation when such
fields are updated in triggers (actually we simply assume that
we always update fields used in key if we have before update
trigger).

The fix simply extends this check which is done with help of
check_if_key_used()/QUICK_SELECT_I::check_if_keys_used()
routine/method in such way that it also detects cases when
field used in key is updated in trigger. We do this by
changing check_if_key_used() to take field bitmap instead
field list as argument and passing TABLE::write_set
to it (we also have to add info about fields used in
triggers to this bitmap a bit earlier).
As nice side-effect we have more precise and thus more optimal
perfomance-wise check for the MULTI-UPDATE.
Also check_if_key_used() routine and similar method were renamed
to is_key_used()/is_keys_used() in order to better reflect that
it is simple boolean predicate.
Finally, partition_key_modified() routine now also takes field
bitmap instead of field list as argument.
2006-09-21 13:39:29 +04:00
..
share Merge bodhi.local:/opt/local/work/mysql-5.0-runtime-safemerge 2006-08-30 03:00:19 +04:00
.cvsignore
add_errmsg
authors.h
client_settings.h
CMakeLists.txt fix for windows build 2006-08-24 22:10:55 -07:00
contributors.h
custom_conf.h
derror.cc
des_key_file.cc
discover.cc
event_scheduler.cc
event_scheduler.h
event_timed.cc
event_timed.h
events.cc
events.h
events_priv.h
field.cc Post-merge fixes. 2006-08-30 23:09:47 +04:00
field.h
field_conv.cc
filesort.cc This is a cleanup of warnings that windows is complaining about. 2006-08-23 15:12:42 -07:00
frm_crypt.cc
gen_lex_hash.cc
gstream.cc
gstream.h
ha_innodb.cc This is a cleanup of warnings that windows is complaining about. 2006-08-23 15:12:42 -07:00
ha_innodb.h Cleanup of unused variables. 2006-08-25 13:31:15 -07:00
ha_ndbcluster.cc Cleanup of unused variables. 2006-08-25 13:31:15 -07:00
ha_ndbcluster.h
ha_ndbcluster_binlog.cc
ha_ndbcluster_binlog.h
ha_ndbcluster_tables.h
ha_partition.cc This is a cleanup of warnings that windows is complaining about. 2006-08-23 15:12:42 -07:00
ha_partition.h
handler.cc Merge baker@bk-internal.mysql.com:/home/bk/mysql-5.1 2006-08-25 14:07:30 -07:00
handler.h Cleanup of unused variables. 2006-08-25 13:31:15 -07:00
hash_filo.cc
hash_filo.h
hostname.cc
init.cc
item.cc Merge bodhi.local:/opt/local/work/mysql-5.0-runtime-safemerge 2006-08-30 03:00:19 +04:00
item.h Merge bodhi.local:/opt/local/work/mysql-5.0-runtime-safemerge 2006-08-30 03:00:19 +04:00
item_buff.cc
item_cmpfunc.cc Post-merge fixes. 2006-08-30 23:09:47 +04:00
item_cmpfunc.h
item_create.cc
item_create.h
item_func.cc Merge bodhi.local:/opt/local/work/mysql-5.0-runtime-safemerge 2006-08-30 03:00:19 +04:00
item_func.h
item_geofunc.cc
item_geofunc.h
item_row.cc Merge bodhi.local:/opt/local/work/mysql-5.0-runtime-safemerge 2006-08-30 03:00:19 +04:00
item_row.h
item_strfunc.cc Merge bodhi.local:/opt/local/work/mysql-5.0-runtime-safemerge 2006-08-30 03:00:19 +04:00
item_strfunc.h Merge bodhi.local:/opt/local/work/mysql-5.0-runtime-safemerge 2006-08-30 03:00:19 +04:00
item_subselect.cc
item_subselect.h
item_sum.cc
item_sum.h
item_timefunc.cc
item_timefunc.h
item_uniq.cc
item_uniq.h
item_xmlfunc.cc
item_xmlfunc.h
key.cc Fix for bug#20670 "UPDATE using key and invoking trigger that modifies 2006-09-21 13:39:29 +04:00
lex.h
lex_symbol.h
lock.cc
log.cc
log.h
log_event.cc
log_event.h
Makefile.am Merge bodhi.local:/opt/local/work/mysql-5.0-runtime-safemerge 2006-08-30 03:00:19 +04:00
matherr.c
message.mc
mf_iocache.cc
my_decimal.cc
my_decimal.h
my_lock.c
mysql_priv.h Fix for bug#20670 "UPDATE using key and invoking trigger that modifies 2006-09-21 13:39:29 +04:00
mysqld.cc Merge bodhi.local:/opt/local/work/mysql-5.0-runtime-safemerge 2006-08-30 03:00:19 +04:00
mysqld_suffix.h
net_serv.cc Merge bodhi.local:/opt/local/work/mysql-5.0-runtime-safemerge 2006-08-30 03:00:19 +04:00
nt_servc.cc
nt_servc.h
opt_range.cc Fix for bug#20670 "UPDATE using key and invoking trigger that modifies 2006-09-21 13:39:29 +04:00
opt_range.h Fix for bug#20670 "UPDATE using key and invoking trigger that modifies 2006-09-21 13:39:29 +04:00
opt_sum.cc
parse_file.cc
parse_file.h
partition_element.h This is a cleanup of warnings that windows is complaining about. 2006-08-23 15:12:42 -07:00
partition_info.cc
partition_info.h
password.c
procedure.cc
procedure.h
protocol.cc Merge bodhi.local:/opt/local/work/mysql-5.0-runtime-safemerge 2006-08-30 03:00:19 +04:00
protocol.h
records.cc
repl_failsafe.cc
repl_failsafe.h
rpl_filter.cc
rpl_filter.h
rpl_injector.cc
rpl_injector.h
rpl_rli.h
rpl_tblmap.cc
rpl_tblmap.h
set_var.cc
set_var.h
slave.cc
slave.h
sp.cc Merge bodhi.local:/opt/local/work/mysql-5.0-runtime-safemerge 2006-08-30 03:00:19 +04:00
sp.h
sp_cache.cc
sp_cache.h
sp_head.cc Post-merge fixes. 2006-08-30 23:09:47 +04:00
sp_head.h Post-merge fixes. 2006-08-30 23:09:47 +04:00
sp_pcontext.cc
sp_pcontext.h
sp_rcontext.cc
sp_rcontext.h
spatial.cc
spatial.h
sql_acl.cc Merge bodhi.local:/opt/local/work/mysql-5.0-runtime-safemerge 2006-08-30 03:00:19 +04: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 Merge bodhi.local:/opt/local/work/mysql-5.0-runtime-safemerge 2006-08-30 03:00:19 +04:00
sql_cache.h
sql_class.cc Merge bodhi.local:/opt/local/work/mysql-5.0-runtime-safemerge 2006-08-30 03:00:19 +04:00
sql_class.h
sql_client.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 Merge bodhi.local:/opt/local/work/mysql-5.0-runtime-safemerge 2006-08-30 03:00:19 +04:00
sql_error.h
sql_handler.cc
sql_help.cc
sql_insert.cc
sql_lex.cc
sql_lex.h
sql_list.cc
sql_list.h
sql_load.cc
sql_locale.cc
sql_manager.cc
sql_map.cc
sql_map.h
sql_olap.cc
sql_parse.cc Merge bodhi.local:/opt/local/work/mysql-5.0-runtime-safemerge 2006-08-30 03:00:19 +04:00
sql_partition.cc Fix for bug#20670 "UPDATE using key and invoking trigger that modifies 2006-09-21 13:39:29 +04:00
sql_partition.h Fix for bug#20670 "UPDATE using key and invoking trigger that modifies 2006-09-21 13:39:29 +04:00
sql_plugin.cc Merge baker@bk-internal.mysql.com:/home/bk/mysql-5.1 2006-08-25 14:07:30 -07:00
sql_plugin.h
sql_prepare.cc Fix for bug All commands supported in Stored Procedures 2006-08-23 15:50:06 +02:00
sql_rename.cc
sql_repl.cc
sql_repl.h
sql_select.cc Merge lamia.home:/home/timka/mysql/src/5.0-bug-21456 2006-08-29 16:39:09 +03:00
sql_select.h
sql_show.cc Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.1 2006-08-23 16:48:39 +04:00
sql_show.h
sql_sort.h
sql_state.c
sql_string.cc
sql_string.h
sql_table.cc
sql_tablespace.cc
sql_test.cc
sql_trigger.cc Merge bodhi.local:/opt/local/work/mysql-5.0-runtime-safemerge 2006-08-30 03:00:19 +04:00
sql_trigger.h Merge bodhi.local:/opt/local/work/mysql-5.0-runtime-safemerge 2006-08-30 03:00:19 +04:00
sql_udf.cc
sql_udf.h
sql_union.cc
sql_update.cc Fix for bug#20670 "UPDATE using key and invoking trigger that modifies 2006-09-21 13:39:29 +04:00
sql_view.cc Merge bodhi.local:/opt/local/work/mysql-5.0-runtime-safemerge 2006-08-30 03:00:19 +04:00
sql_view.h
sql_yacc.yy Merge bodhi.local:/opt/local/work/mysql-5.0-runtime-safemerge 2006-08-30 03:00:19 +04:00
stacktrace.c
stacktrace.h
strfunc.cc
structs.h
table.cc Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.1 2006-08-23 16:48:39 +04:00
table.h Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.1 2006-08-23 16:48:39 +04:00
thr_malloc.cc
time.cc
tzfile.h
tztime.cc
tztime.h
udf_example.c
uniques.cc
unireg.cc
unireg.h