summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@sun.com>2008-11-14 23:51:17 +0100
committerMattias Jonsson <mattias.jonsson@sun.com>2008-11-14 23:51:17 +0100
commitc0240bca20d852d2175d3cba848cbd1d43e2faea (patch)
tree61c703ee0ae786a7a2feda05649b57c2b6573497 /sql
parentde1fe9054fd2dfd419c47b73ea4f3c255a4dd41a (diff)
parenta891c0e8f4309ea34605745e9332e57fcdd7ac64 (diff)
downloadmariadb-git-c0240bca20d852d2175d3cba848cbd1d43e2faea.tar.gz
Bug#40595: Non-matching rows not released with READ-COMMITTED on tables
with partitions Pre push fix, optimized replace_regex, to cut 2 seconds from test time.
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_partition.cc36
-rw-r--r--sql/ha_partition.h4
2 files changed, 39 insertions, 1 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 3324bbc2f45..a1131a99fa4 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -2813,8 +2813,42 @@ uint ha_partition::lock_count() const
void ha_partition::unlock_row()
{
+ DBUG_ENTER("ha_partition::unlock_row");
m_file[m_last_part]->unlock_row();
- return;
+ DBUG_VOID_RETURN;
+}
+
+
+/**
+ Use semi consistent read if possible
+
+ SYNOPSIS
+ try_semi_consistent_read()
+ yes Turn on semi consistent read
+
+ RETURN VALUE
+ NONE
+
+ DESCRIPTION
+ See handler.h:
+ Tell the engine whether it should avoid unnecessary lock waits.
+ If yes, in an UPDATE or DELETE, if the row under the cursor was locked
+ by another transaction, the engine may try an optimistic read of
+ the last committed row value under the cursor.
+ Note: prune_partitions are already called before this call, so using
+ pruning is OK.
+*/
+void ha_partition::try_semi_consistent_read(bool yes)
+{
+ handler **file;
+ DBUG_ENTER("ha_partition::try_semi_consistent_read");
+
+ for (file= m_file; *file; file++)
+ {
+ if (bitmap_is_set(&(m_part_info->used_partitions), (file - m_file)))
+ (*file)->try_semi_consistent_read(yes);
+ }
+ DBUG_VOID_RETURN;
}
diff --git a/sql/ha_partition.h b/sql/ha_partition.h
index 78cf47dd1aa..dd06d8d647b 100644
--- a/sql/ha_partition.h
+++ b/sql/ha_partition.h
@@ -325,6 +325,10 @@ public:
Call to unlock rows not to be updated in transaction
*/
virtual void unlock_row();
+ /*
+ Call to hint about semi consistent read
+ */
+ virtual void try_semi_consistent_read(bool);
/*
-------------------------------------------------------------------------