summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@sun.com>2008-11-10 21:13:24 +0100
committerMattias Jonsson <mattias.jonsson@sun.com>2008-11-10 21:13:24 +0100
commita5ec6953e1fa9fc718cde08babbb1ceb812dea73 (patch)
tree9eee015db5a1b006de00a010ba12ff505f5bcea5 /sql
parent9a0637750a4775e199b3915bd83e630540729d64 (diff)
downloadmariadb-git-a5ec6953e1fa9fc718cde08babbb1ceb812dea73.tar.gz
Bug#40595: Non-matching rows not released with READ-COMMITTED
on tables with partitions Problem was that the handler function try_semi_consistent_read was not propagated to the innodb handler. Solution was to implement that function in the partitioning handler. mysql-test/r/partition_innodb.result: Bug#40595: Non-matching rows not released with READ-COMMITTED on tables with partitions Updated test result. mysql-test/t/partition_innodb.test: Bug#40595: Non-matching rows not released with READ-COMMITTED on tables with partitions Added test case for bug#40595. Note: the replace_regex is taking long time. I have not found any better regex (it takes time using 'sed' too). sql/ha_partition.cc: Bug#40595: Non-matching rows not released with READ-COMMITTED on tables with partitions Added function to the partitioning handler for handling semi consistent reads (unlock_row was already implemented, and this is needed for unlock_row to work properly in innodb). It uses pruning for optimizing the call. sql/ha_partition.h: Bug#40595: Non-matching rows not released with READ-COMMITTED on tables with partitions Added function to the partitioning handler for handling semi consistent reads (unlock_row was already implemented, and this is needed for unlock_row to work properly in innodb).
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);
/*
-------------------------------------------------------------------------