summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <jan@hundin.mysql.fi>2005-07-26 10:19:36 +0300
committerunknown <jan@hundin.mysql.fi>2005-07-26 10:19:36 +0300
commit74e003111003c654c6ffe0c2764e194031e1bcb4 (patch)
treebfbdd1f2021b5029adeca3ac49d3fb0659bc774e /sql
parent4cc9707e6c40b303a8551887fbe2926d6b355db5 (diff)
parentc9175888ea6e39ab84c685ac85ae32b627a87498 (diff)
downloadmariadb-git-74e003111003c654c6ffe0c2764e194031e1bcb4.tar.gz
Merge jlindstrom@bk-internal.mysql.com:/home/bk/mysql-5.0
into hundin.mysql.fi:/home/jan/mysql-5.0
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_innodb.cc45
-rw-r--r--sql/ha_innodb.h29
2 files changed, 72 insertions, 2 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 690f1354d2b..1c3bca08037 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -5879,7 +5879,7 @@ ha_innobase::start_stmt(
innobase_release_stat_resources(trx);
if (trx->isolation_level <= TRX_ISO_READ_COMMITTED
- && trx->read_view) {
+ && trx->global_read_view) {
/* At low transaction isolation levels we let
each consistent read set its own snapshot */
@@ -6100,7 +6100,7 @@ ha_innobase::external_lock(
}
} else {
if (trx->isolation_level <= TRX_ISO_READ_COMMITTED
- && trx->read_view) {
+ && trx->global_read_view) {
/* At low transaction isolation levels we let
each consistent read set its own snapshot */
@@ -7130,4 +7130,45 @@ innobase_rollback_by_xid(
}
}
+/***********************************************************************
+This function creates a consistent view for a cursor and start a transaction
+if it has not been started. This consistent view is then used inside of MySQL
+when accesing records using a cursor. */
+
+void*
+innobase_create_cursor_view(void)
+/*=============================*/
+ /* out: Pointer to cursor view or NULL */
+{
+ return(read_cursor_view_create_for_mysql(
+ check_trx_exists(current_thd)));
+}
+
+/***********************************************************************
+This function closes the given consistent cursor view. Note that
+global read view is restored to a transaction and a transaction is
+started if it has not been started. */
+
+void
+innobase_close_cursor_view(
+/*=======================*/
+ void* curview)/* in: Consistent read view to be closed */
+{
+ read_cursor_view_close_for_mysql(check_trx_exists(current_thd),
+ (cursor_view_t*) curview);
+}
+
+/***********************************************************************
+This function sets the given consistent cursor view to a transaction.
+If a transaction does not exist, transaction is started. */
+
+void
+innobase_set_cursor_view(
+/*=====================*/
+ void* curview)/* in: Consistent cursor view to be closed */
+{
+ read_cursor_set_for_mysql(check_trx_exists(current_thd),
+ (cursor_view_t*) curview);
+}
+
#endif /* HAVE_INNOBASE_DB */
diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h
index 1584a2182c9..2cbc1c8d91b 100644
--- a/sql/ha_innodb.h
+++ b/sql/ha_innodb.h
@@ -310,3 +310,32 @@ int innobase_xa_end(THD *thd);
int innobase_repl_report_sent_binlog(THD *thd, char *log_file_name,
my_off_t end_offset);
+
+/***********************************************************************
+This function creates a consistent view for a cursor and start a transaction
+if it has not been started. This consistent view is then used inside of MySQL
+when accesing records using a cursor. */
+
+void*
+innobase_create_cursor_view(void);
+/*=============================*/
+ /* out: Pointer to cursor view or NULL */
+
+/***********************************************************************
+This function closes the given consistent cursor view. Note that
+global read view is restored to a transaction and a transaction is
+started if it has not been started. */
+
+void
+innobase_close_cursor_view(
+/*=======================*/
+ void* curview); /* in: Consistent read view to be closed */
+
+/***********************************************************************
+This function sets the given consistent cursor view to a transaction.
+If a transaction does not exist, transaction is started. */
+
+void
+innobase_set_cursor_view(
+/*=====================*/
+ void* curview); /* in: Consistent read view to be closed */