mariadb/sql
unknown 810fc001d9 Fix for bug#20390 "SELECT FOR UPDATE does not release locks
of untouched rows in full table scans".

SELECT ... FOR UPDATE/LOCK IN SHARE MODE statements as well as
UPDATE/DELETE statements which were executed using full table
scan were not releasing locks on rows which didn't satisfy
WHERE condition.
This bug surfaced in 5.0 and affected NDB tables. (InnoDB tables
intentionally don't support such unlocking in default mode).

This problem occured because code implementing join didn't call
handler::unlock_row() for rows which didn't satisfy part of condition
attached to this particular table/level of nested loop. So we solve
the problem adding this call.
Note that we already had this call in place in 4.1 but it was lost
(actually not quite correctly placed) when we have introduced nested 
joins.

Also note that additional QA should be requested once this patch is
pushed as interaction between handler::unlock_row() and many recent
MySQL features such as subqueries, unions, views is not tested enough.


mysql-test/r/ndb_lock.result:
  Enabled back part of the test that covers bug #20390 "SELECT FOR
  UPDATE does not release locks of untouched rows in full table scans".
  Adjusted test in such way that it now covers both execution paths
  in which we unlock non-matching rows inspected during table scan.
mysql-test/t/ndb_lock.test:
  Enabled back part of the test that covers bug #20390 "SELECT FOR
  UPDATE does not release locks of untouched rows in full table scans".
  Adjusted test in such way that it now covers both execution paths
  in which we unlock non-matching rows inspected during table scan.
sql/sql_select.cc:
  evaluate_join_record() should call handler::unlock_row() for records
  which don't satisfy condition which was pushed-down to this table/level
  of nested loop.
  We just put back the thing that we already have in 4.1 and which was lost
  when we have introduced nested joins.
2007-01-15 12:32:38 +03:00
..
examples Merge willster.(none):/home/stewart/Documents/MySQL/4.1/bug19914-mk2 2006-10-16 17:39:38 +10:00
share Addition to fix for bug#10974. Fixed spelling. 2006-10-06 11:03:14 +05:00
.cvsignore
add_errmsg
client_settings.h
CMakeLists.txt Fix for bug #19121: Windows incompatible udf_example 2006-09-22 14:42:43 +02:00
custom_conf.h
derror.cc
des_key_file.cc Many files: 2005-09-30 14:03:55 +02:00
discover.cc
field.cc Merge bk@192.168.21.1:mysql-5.0-opt 2006-11-17 10:30:16 +04:00
field.h Merge bk@192.168.21.1:mysql-5.0-opt 2006-11-17 10:30:16 +04:00
field_conv.cc Bug#19960 Inconsistent results when joining InnoDB tables using partial UTF8 indexes 2006-09-29 16:15:57 +05:00
filesort.cc Merge bk-internal:/home/bk/mysql-5.0 2006-11-27 16:25:52 +01:00
frm_crypt.cc
gen_lex_hash.cc Merge zippy.cornsilk.net:/home/cmiller/work/mysql/merge/mysql-5.0-maint-gca 2006-08-23 18:37:04 -04:00
gstream.cc
gstream.h
ha_archive.cc Remove compiler warnings 2006-11-20 22:42:06 +02:00
ha_archive.h Merge willster.(none):/home/stewart/Documents/MySQL/4.1/bug19914-mk2 2006-10-16 17:39:38 +10:00
ha_berkeley.cc Merge willster.(none):/home/stewart/Documents/MySQL/4.1/bug19914-mk2 2006-10-16 17:39:38 +10:00
ha_berkeley.h Merge willster.(none):/home/stewart/Documents/MySQL/4.1/bug19914-mk2 2006-10-16 17:39:38 +10:00
ha_blackhole.cc Merge willster.(none):/home/stewart/Documents/MySQL/4.1/bug19914-mk2 2006-10-16 17:39:38 +10:00
ha_blackhole.h Merge willster.(none):/home/stewart/Documents/MySQL/4.1/bug19914-mk2 2006-10-16 17:39:38 +10:00
ha_federated.cc Remove compiler warnings 2006-11-20 22:42:06 +02:00
ha_federated.h Remove compiler warnings 2006-11-20 22:42:06 +02:00
ha_heap.cc Merge willster.(none):/home/stewart/Documents/MySQL/4.1/bug19914-mk2 2006-10-16 17:39:38 +10:00
ha_heap.h Merge willster.(none):/home/stewart/Documents/MySQL/4.1/bug19914-mk2 2006-10-16 17:39:38 +10:00
ha_innodb.cc Remove compiler warnings 2006-11-20 22:42:06 +02:00
ha_innodb.h Merge willster.(none):/home/stewart/Documents/MySQL/4.1/bug19914-mk2 2006-10-16 17:39:38 +10:00
ha_myisam.cc Remove compiler warnings 2006-11-20 22:42:06 +02:00
ha_myisam.h Merge willster.(none):/home/stewart/Documents/MySQL/4.1/bug19914-mk2 2006-10-16 17:39:38 +10:00
ha_myisammrg.cc Remove compiler warnings 2006-11-20 22:42:06 +02:00
ha_myisammrg.h Merge willster.(none):/home/stewart/Documents/MySQL/4.1/bug19914-mk2 2006-10-16 17:39:38 +10:00
ha_ndbcluster.cc Remove compiler warnings 2006-11-20 22:42:06 +02:00
ha_ndbcluster.h Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb 2006-10-24 08:29:37 +02:00
handler.cc Merge bk-internal:/home/bk/mysql-5.0 2006-11-27 16:25:52 +01:00
handler.h Merge willster.(none):/home/stewart/Documents/MySQL/4.1/bug19914-mk2 2006-10-16 17:39:38 +10:00
hash_filo.cc
hash_filo.h
hostname.cc Merge mysql.com:/usr/home/ram/work/mysql-4.1 2006-03-03 15:32:00 +04:00
init.cc Fixes during review of new pushed code 2005-08-12 13:54:42 +03:00
item.cc Merge bk@192.168.21.1:mysql-5.0-opt 2006-11-17 10:30:16 +04:00
item.h Merge bk@192.168.21.1:mysql-5.0-opt 2006-11-17 10:30:16 +04:00
item_buff.cc Bug#22138: Unhandled NULL caused server crash 2006-10-11 19:44:12 +04:00
item_cmpfunc.cc Merge bk-internal.mysql.com:/home/bk/mysql-5.0 2006-11-29 02:44:12 +03:00
item_cmpfunc.h BUG#8804: wrong results for NULL IN (SELECT ...) 2006-10-31 20:51:09 +03:00
item_create.cc Bug#16172 DECIMAL data type processed incorrectly 2006-08-08 14:40:07 +05:00
item_create.h Bug#20570: CURRENT_USER() in a VIEW with SQL SECURITY DEFINER returns 2006-07-02 14:35:45 +04:00
item_func.cc Merge bk-internal.mysql.com:/home/bk/mysql-5.0 2006-11-29 02:44:12 +03:00
item_func.h Merge bk@192.168.21.1:mysql-5.0-opt 2006-11-17 10:30:16 +04:00
item_geofunc.cc bug #14807 (GeomFromText() should return MYSQL_TYPE_GEOMETRY) 2006-07-04 12:56:53 +05:00
item_geofunc.h Merge mysql.com:/home/mydev/mysql-4.1-bug14400 2006-07-05 11:20:10 +02:00
item_row.cc BUG#21166: Prepared statement causes signal 11 on second execution 2006-08-24 15:49:12 +04:00
item_row.h Merge mysql.com:/opt/local/work/mysql-4.1-16365 2006-04-12 18:30:54 +04:00
item_strfunc.cc Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0 2006-11-16 14:19:37 +03:00
item_strfunc.h Add 5.0 part of fix for bug 17047. 2006-11-16 14:06:51 +03:00
item_subselect.cc Merge bk-internal:/home/bk/mysql-5.0 2006-11-27 16:25:52 +01:00
item_subselect.h Merge mysql.com:/home/hf/work/mysql-4.1-mrg 2006-11-16 23:16:44 +04:00
item_sum.cc Merge bk-internal.mysql.com:/home/bk/mysql-5.0 2006-11-29 02:44:12 +03:00
item_sum.h Merge bk@192.168.21.1:mysql-5.0-opt 2006-11-17 10:30:16 +04:00
item_timefunc.cc Merge bk-internal:/home/bk/mysql-5.0 2006-11-27 16:25:52 +01:00
item_timefunc.h Merge bk@192.168.21.1:mysql-5.0-opt 2006-11-17 10:30:16 +04:00
item_uniq.cc
item_uniq.h Inefficient usage of String::append() fixed. 2005-11-20 20:47:07 +02:00
key.cc Fix for bug#20670 "UPDATE using key and invoking trigger that modifies 2006-09-21 11:35:38 +04:00
lex.h Fixed BUG#18949: Test case sp-goto is disabled 2006-04-18 11:07:34 +02:00
lex_symbol.h
lock.cc Fix for bug#21216 "Simultaneous DROP TABLE and SHOW OPEN TABLES causes 2006-08-21 12:18:59 +04:00
log.cc Merge bk-internal:/home/bk/mysql-5.0 2006-10-03 20:28:59 +02:00
log_event.cc Merge bk-internal.mysql.com:/home/bk/mysql-5.0 2006-11-20 22:46:52 +02:00
log_event.h bug#19402 SQL close to the size of the max_allowed_packet fails on the slave 2006-11-14 12:48:17 +02:00
Makefile.am Makefile.am: 2006-11-28 18:08:30 +01:00
matherr.c
message.mc make dist changes for Cmake build 2006-09-01 10:32:12 +02:00
mf_iocache.cc
my_decimal.cc bug #19491 (CAST do DATETIME wrong result) 2006-10-25 20:14:39 +05:00
my_decimal.h bug #19491 (CAST do DATETIME wrong result) 2006-10-25 20:14:39 +05:00
my_lock.c
mysql_priv.h Merge bk@192.168.21.1:mysql-5.0-opt 2006-11-17 10:30:16 +04:00
mysqld.cc Merge bk-internal.mysql.com:/home/bk/mysql-5.0 2006-11-29 02:44:12 +03:00
mysqld_suffix.h
net_serv.cc Remove compiler warnings 2006-11-20 22:42:06 +02:00
nt_servc.cc
nt_servc.h
opt_range.cc Remove compiler warnings 2006-11-20 22:42:06 +02:00
opt_range.h Merge siva.hindu.god:/usr/home/tim/m/bk/g50 2006-10-24 14:42:08 -06:00
opt_sum.cc Merge willster.(none):/home/stewart/Documents/MySQL/4.1/bug19914-mk2 2006-10-16 17:39:38 +10:00
parse_file.cc Fix for BUG#15921: DROP TRIGGER - can't be drop trigger created 2006-03-28 01:01:51 +04:00
parse_file.h Fix for bug#15228 "'invalid access to non-static data member' 2006-10-20 15:47:52 +04:00
password.c Merge mysql.com:/opt/local/work/mysql-4.1-root 2006-01-11 17:49:56 +03:00
procedure.cc
procedure.h
protocol.cc Merge mysql.com:/home/hf/work/mysql-4.1-mrg 2006-11-16 23:16:44 +04:00
protocol.h Merge mysql.com:/home/hf/work/mysql-4.1-mrg 2006-11-16 23:16:44 +04:00
records.cc Merge rurik.mysql.com:/home/igor/mysql-5.0-opt 2006-11-01 14:50:14 -08:00
repl_failsafe.cc Bug #18607: LOAD DATA FROM MASTER fails because of INFORMATION_SCHEMA database 2006-04-21 18:26:39 -07:00
repl_failsafe.h pthread_handler_decl() changed to be ctags-friendly 2005-10-08 16:39:55 +02:00
set_var.cc Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-4.1-bug23159 2006-11-21 16:53:33 +03:00
set_var.h A post-merge fix. 2006-07-08 04:07:43 +04:00
slave.cc Merge bk-internal.mysql.com:/home/bk/mysql-5.0 2006-11-20 22:46:52 +02:00
slave.h Merge bk-internal:/home/bk/mysql-5.0-maint 2006-09-28 20:17:17 -07:00
sp.cc Merge bk-internal.mysql.com:/home/bk/mysql-5.0 2006-11-02 17:39:52 -05:00
sp.h A fix and a test case for 2006-06-27 00:47:52 +04:00
sp_cache.cc Fix use of "%*s" *printf() specifiers that were really meant to be 2005-10-06 17:37:24 -07:00
sp_cache.h BUG#12228: Post review fixes: Added test case, code cleanup. 2005-08-10 21:17:02 +00:00
sp_head.cc Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.0-runtime 2006-12-11 17:15:08 -07:00
sp_head.h Bug#19194 (Right recursion in parser for CASE causes excessive stack usage, 2006-11-17 12:14:29 -07:00
sp_pcontext.cc Fixed BUG#18949: Test case sp-goto is disabled 2006-04-18 11:07:34 +02:00
sp_pcontext.h Fixed BUG#18949: Test case sp-goto is disabled 2006-04-18 11:07:34 +02:00
sp_rcontext.cc Bug#8153 (Stored procedure with subquery and continue handler, wrong result) 2006-08-02 22:18:49 -07:00
sp_rcontext.h Bug#8153 (Stored procedure with subquery and continue handler, wrong result) 2006-08-02 22:18:49 -07:00
spatial.cc Merge sanja.is.com.ua:/home/bell/mysql/bk/work-bug1-5.0 2005-11-21 21:15:48 +02:00
spatial.h gcc 4.1 linux warning fixes backported from 5.0. 2006-06-28 16:28:29 +03:00
sql_acl.cc Remove compiler warnings 2006-11-20 22:42:06 +02:00
sql_acl.h Reapply fix for bug#16372 (Server crashes when test 'conc_sys' is running) 2006-05-06 11:25:59 +04:00
sql_analyse.cc Merge rolltop.ignatz42.dyndns.org:/mnt/storeage/bug20305/my41-bug20305 2006-09-28 14:32:30 -04:00
sql_analyse.h
sql_array.h Fix for BUG#12335 (SP replication) : New binlogging strategy for stored PROCEDUREs/FUNCTIONs. 2005-08-25 17:34:34 +04:00
sql_base.cc Merge bk@192.168.21.1:mysql-5.0-opt 2006-11-17 10:30:16 +04:00
sql_bitmap.h
sql_cache.cc Merge bk-internal.mysql.com:/home/bk/mysql-5.0 2006-11-29 02:44:12 +03:00
sql_cache.h BUG#21051: RESET QUERY CACHE very slow when query_cache_type=0 2006-08-22 11:47:52 +04:00
sql_class.cc A fix and a test case for Bug#24179 "select b into $var" fails with 2006-12-01 13:25:06 +03:00
sql_class.h A fix and a test case for Bug#24179 "select b into $var" fails with 2006-12-01 13:25:06 +03:00
sql_client.cc
sql_crypt.cc
sql_crypt.h
sql_cursor.cc Fixed BUG#15758: "Holding adaptive search latch in 2006-04-07 23:58:17 +04:00
sql_cursor.h A fix and a test case for Bug#6513 "Test Suite: Values inserted by using 2005-09-22 02:11:21 +04:00
sql_db.cc Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint 2006-10-13 08:57:15 -04:00
sql_delete.cc Remove compiler warnings 2006-11-20 22:42:06 +02:00
sql_derived.cc support of view underlying tables and SP functions security check added (BUG#9505) (WL#2787) 2005-10-28 00:18:23 +03:00
sql_do.cc
sql_error.cc Bug#8153 (Stored procedure with subquery and continue handler, wrong result) 2006-08-02 22:18:49 -07:00
sql_error.h
sql_handler.cc Bug#16986 - Deadlock condition with MyISAM tables 2006-06-26 19:14:35 +02:00
sql_help.cc many warnings (practically safe but annoying) corrected 2006-01-03 17:54:54 +01:00
sql_insert.cc BUG#21726: Incorrect result with multiple invocations of LAST_INSERT_ID. 2006-10-06 13:34:07 +04:00
sql_lex.cc Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.0-runtime 2006-12-11 17:15:08 -07:00
sql_lex.h Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.0-runtime 2006-12-11 17:15:08 -07:00
sql_list.cc
sql_list.h Fixed bug #16081: row equalities were not taken into 2006-09-01 04:23:04 -07:00
sql_load.cc BUG#21726: Incorrect result with multiple invocations of LAST_INSERT_ID. 2006-10-06 13:34:07 +04:00
sql_locale.cc Fix compile errors in VC++ 7.0 2006-08-21 16:21:48 +04:00
sql_manager.cc Merge bk-internal.mysql.com:/home/bk/mysql-5.0 2005-10-12 00:59:52 +03:00
sql_manager.h
sql_map.cc
sql_map.h
sql_olap.cc Implementation of WL#2486 - 2005-08-12 17:57:19 +03:00
sql_parse.cc Merge bk-internal:/home/bk/mysql-5.0 2006-11-27 16:25:52 +01:00
sql_prepare.cc A fix and a test case for Bug#24179 "select b into $var" fails with 2006-12-01 13:25:06 +03:00
sql_rename.cc sql_rename.cc: 2006-10-18 00:14:14 +04:00
sql_repl.cc Merge bk-internal.mysql.com:/home/bk/mysql-5.0 2006-11-20 22:46:52 +02:00
sql_repl.h after merge fix 2006-09-27 19:21:29 +05:00
sql_select.cc Fix for bug#20390 "SELECT FOR UPDATE does not release locks 2007-01-15 12:32:38 +03:00
sql_select.h BUG#8804: wrong results for NULL IN (SELECT ...) 2006-10-31 20:51:09 +03:00
sql_show.cc Merge bk@192.168.21.1:mysql-5.0-opt 2006-11-17 10:30:16 +04:00
sql_sort.h
sql_state.c
sql_string.cc Bug#18908: ERROR 1406 (22001): Data too long for column :: using utf8 2006-10-30 10:14:03 +04:00
sql_string.h Bug#18908: ERROR 1406 (22001): Data too long for column :: using utf8 2006-10-30 10:14:03 +04:00
sql_table.cc Merge bk@192.168.21.1:mysql-5.0-opt 2006-11-17 10:30:16 +04:00
sql_test.cc Post-review changes. 2006-05-03 21:35:27 -07:00
sql_trigger.cc Bug#23703 (DROP TRIGGER needs an IF EXISTS) 2006-11-13 15:40:22 -07:00
sql_trigger.h Fix for bug#20670 "UPDATE using key and invoking trigger that modifies 2006-09-21 11:35:38 +04:00
sql_udf.cc Merge bk-internal:/home/bk/mysql-5.0-maint 2006-07-18 09:32:49 +02:00
sql_udf.h Fix compiler warnings in sql_udf.h: ISO C++ forbids casting 2006-07-09 13:03:51 +04:00
sql_union.cc Merge bk-internal.mysql.com:/home/bk/mysql-5.0 2006-11-02 17:39:52 -05:00
sql_update.cc Remove compiler warnings 2006-11-20 22:42:06 +02:00
sql_view.cc Remove compiler warnings 2006-11-20 22:42:06 +02:00
sql_view.h Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint 2006-10-13 08:57:15 -04:00
sql_yacc.yy Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.0-runtime 2006-12-11 17:15:08 -07:00
stacktrace.c Merge polly.local:/tmp/maint/bug23256/mysql-4.1-maint 2006-10-20 14:32:31 +04:00
stacktrace.h Merge maint1.mysql.com:/data/localhome/tsmith/bk/bfx/my41-bfx 2006-09-07 00:59:08 +02:00
strfunc.cc Remove compiler warnings 2006-11-20 22:42:06 +02:00
structs.h Manually merged 2006-06-14 23:54:08 +04:00
table.cc Merge bk-internal:/home/bk/mysql-5.0 2006-11-27 16:25:52 +01:00
table.h Fixed bug #21727. 2006-10-31 17:31:56 -08:00
thr_malloc.cc
time.cc Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-4.1 2006-11-10 15:05:38 +03:00
tzfile.h
tztime.cc Remove compiler warnings 2006-11-20 22:42:06 +02:00
tztime.h Fix for bug#11081 "Using a CONVERT_TZ function in a stored function or 2006-04-24 18:57:00 +04:00
udf_example.c Fix for bug #19121: Windows incompatible udf_example 2006-09-22 14:42:43 +02:00
udf_example.def Fix for bug #19121: Windows incompatible udf_example 2006-09-22 14:42:43 +02:00
uniques.cc many warnings (practically safe but annoying) corrected 2006-01-03 17:54:54 +01:00
unireg.cc Remove compiler warnings 2006-11-20 22:42:06 +02:00
unireg.h sql_base.cc, unireg.h, sql_lex.h, table.cc, sql_view.h, sql_view.cc: 2006-08-09 00:05:42 +04:00
watchdog_mysqld