Below is the list of changes that have just been committed into a local
5.0 repository of jan. When jan does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1898 05/07/28 14:48:34 jan@stripped +9 -0
Corrected errors on function comments. Added information about open
read views to SHOW INNODB STATUS and a check that there are no open
read views except purge read view in shutdown.
sql/ha_innodb.h
1.99 05/07/28 14:48:24 jan@stripped +12 -9
Corrected errors on function comments.
sql/ha_innodb.cc
1.230 05/07/28 14:48:24 jan@stripped +16 -13
Corrected errors on function comments.
innobase/trx/trx0trx.c
1.59 05/07/28 14:48:24 jan@stripped +4 -16
Close global read view and set read view to NULL in commit.
innobase/srv/srv0start.c
1.83 05/07/28 14:48:24 jan@stripped +10 -0
Check that all read views are closed except read view owned by a purge
before shutdown. If there is more than two open read views print a
error message to a mysqld log.
innobase/srv/srv0srv.c
1.91 05/07/28 14:48:24 jan@stripped +4 -0
Print number of open read views indside InnoDB in SHOW INNODB STATUS.
innobase/row/row0sel.c
1.96 05/07/28 14:48:24 jan@stripped +10 -2
Restore a global read view back to a transaction on both exits of
row_search_for_mysql function. This forces MySQL always to set a cursor
before fecth from a cursor.
innobase/read/read0read.c
1.8 05/07/28 14:48:23 jan@stripped +3 -3
Corrected errors on function comments.
innobase/include/trx0trx.h
1.52 05/07/28 14:48:23 jan@stripped +5 -6
Corrected errors on comments.
innobase/include/read0read.h
1.5 05/07/28 14:48:23 jan@stripped +3 -5
Corrected errors on function comments.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: jan
# Host: hundin.mysql.fi
# Root: /home/jan/mysql-5.0
--- 1.4/innobase/include/read0read.h 2005-07-22 14:09:51 +03:00
+++ 1.5/innobase/include/read0read.h 2005-07-28 14:48:23 +03:00
@@ -68,7 +68,6 @@
read_view_print(
/*============*/
read_view_t* view); /* in: read view */
-
/*************************************************************************
Create a consistent cursor view for mysql to be used in cursors. In this
consistent read view modifications done by the creating transaction or future
@@ -78,10 +77,9 @@
read_cursor_view_create_for_mysql(
/*==============================*/
trx_t* cr_trx);/* in: trx where cursor view is created */
-
/*************************************************************************
-Close a given consistent cursor view for and restore global read view
-back to a transaction. */
+Close a given consistent cursor view for mysql and restore global read view
+back to a transaction read view. */
void
read_cursor_view_close_for_mysql(
@@ -90,7 +88,7 @@
cursor_view_t* curview); /* in: cursor view to be closed */
/*************************************************************************
This function sets a given consistent cursor view to a transaction
-read view if given consistent cursor view is not null. Otherwice, function
+read view if given consistent cursor view is not NULL. Otherwise, function
restores a global read view to a transaction read view. */
void
--- 1.51/innobase/include/trx0trx.h 2005-07-22 14:09:52 +03:00
+++ 1.52/innobase/include/trx0trx.h 2005-07-28 14:48:23 +03:00
@@ -606,14 +606,13 @@
/* memory heap for the global read
view */
read_view_t* global_read_view;
- /* consistent read view used in the
- transaction is stored here if
- transaction is using a consistent
- read view associated to a cursor */
+ /* consistent read view associated
+ to a transaction or NULL */
read_view_t* read_view; /* consistent read view used in the
transaction or NULL, this read view
- can be normal read view associated
- to a transaction or read view
+ if defined can be normal read view
+ associated to a transaction (i.e.
+ same as global_read_view) or read view
associated to a cursor */
/*------------------------------*/
UT_LIST_BASE_NODE_T(trx_named_savept_t)
--- 1.7/innobase/read/read0read.c 2005-07-22 14:09:52 +03:00
+++ 1.8/innobase/read/read0read.c 2005-07-28 14:48:23 +03:00
@@ -347,8 +347,8 @@
}
/*************************************************************************
-Close a given consistent cursor view for and restore global read view
-back to a transaction. */
+Close a given consistent cursor view for mysql and restore global read view
+back to a transaction read view. */
void
read_cursor_view_close_for_mysql(
@@ -372,7 +372,7 @@
/*************************************************************************
This function sets a given consistent cursor view to a transaction
-read view if given consistent cursor view is not null. Otherwice, function
+read view if given consistent cursor view is not NULL. Otherwise, function
restores a global read view to a transaction read view. */
void
--- 1.95/innobase/row/row0sel.c 2005-07-22 14:09:52 +03:00
+++ 1.96/innobase/row/row0sel.c 2005-07-28 14:48:24 +03:00
@@ -3092,6 +3092,13 @@
"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n"
"InnoDB: how you can resolve the problem.\n",
prebuilt->table->name);
+
+ /* Restore a global read view back to a transaction. This
+ forces MySQL always to set a cursor view before fetch from
+ a cursor. */
+
+ trx->read_view = trx->global_read_view;
+
return(DB_ERROR);
}
@@ -4083,8 +4090,9 @@
}
func_exit:
- /* Restore a global read view back to transaction. This forces
- MySQL always to set cursor view before fetch if it is used. */
+ /* Restore a global read view back to a transaction. This
+ forces MySQL always to set a cursor view before fetch from
+ a cursor. */
trx->read_view = trx->global_read_view;
--- 1.90/innobase/srv/srv0srv.c 2005-07-06 09:38:21 +03:00
+++ 1.91/innobase/srv/srv0srv.c 2005-07-28 14:48:24 +03:00
@@ -1711,6 +1711,10 @@
fprintf(file, "%ld queries inside InnoDB, %lu queries in queue\n",
(long) srv_conc_n_threads,
(ulong) srv_conc_n_waiting_threads);
+
+ fprintf(file, "%lu read views open inside InnoDB\n",
+ UT_LIST_GET_LEN(trx_sys->view_list));
+
n_reserved = fil_space_get_n_reserved_extents(0);
if (n_reserved > 0) {
fprintf(file,
--- 1.82/innobase/srv/srv0start.c 2005-06-21 07:36:02 +03:00
+++ 1.83/innobase/srv/srv0start.c 2005-07-28 14:48:24 +03:00
@@ -1833,6 +1833,16 @@
srv_free();
os_sync_free();
+ /* Check that all read views are closed except read view owned
+ by a purge. */
+
+ if (UT_LIST_GET_LEN(trx_sys->view_list) > 1) {
+ fprintf(stderr,
+"InnoDB: Error: all read views were not closed before shutdown:\n"
+"InnoDB: %lu read views open \n",
+ UT_LIST_GET_LEN(trx_sys->view_list) - 1);
+ }
+
/* 5. Free all allocated memory and the os_fast_mutex created in
ut0mem.c */
--- 1.58/innobase/trx/trx0trx.c 2005-07-22 14:09:52 +03:00
+++ 1.59/innobase/trx/trx0trx.c 2005-07-28 14:48:24 +03:00
@@ -833,25 +833,13 @@
lock_release_off_kernel(trx);
- if (trx->read_view) {
- /* If transaction has a global read view this case
- means that transaction has been using a consistent
- read view associated to a cursor. Only the global
- read view associated to a transaction is closed
- and read view is then removed from the transaction.
- If read view associated to a cursor is still used
- it must be re-registered to another transaction. */
-
- if (UNIV_LIKELY_NULL(trx->global_read_view)) {
- trx->read_view = trx->global_read_view;
- }
-
- read_view_close(trx->read_view);
-
+ if (trx->global_read_view) {
+ read_view_close(trx->global_read_view);
mem_heap_empty(trx->global_read_view_heap);
- trx->read_view = NULL;
trx->global_read_view = NULL;
}
+
+ trx->read_view = NULL;
if (must_flush_log) {
--- 1.229/sql/ha_innodb.cc 2005-07-22 14:09:52 +03:00
+++ 1.230/sql/ha_innodb.cc 2005-07-28 14:48:24 +03:00
@@ -538,7 +538,7 @@
}
/*****************************************************************
-Relases the mutex reserved by innobase_mysql_prepare_print_arbitrary_thd().
+Releases the mutex reserved by innobase_mysql_prepare_print_arbitrary_thd().
NOTE that /mysql/innobase/lock/lock0lock.c must contain the prototype for this
function! */
extern "C"
@@ -1700,7 +1700,7 @@
/* Commits the mini-transaction */
mtr_commit(&mtr);
- /* Syncronous flush of the log buffer to disk */
+ /* Synchronous flush of the log buffer to disk */
log_buffer_flush_to_disk();
}
#endif
@@ -2834,7 +2834,7 @@
/* All indexes on BLOB and TEXT are column prefix
indexes, and we may need to truncate the data to be
- stored in the kay value: */
+ stored in the key value: */
if (blob_len > key_part->length) {
blob_len = key_part->length;
@@ -7117,7 +7117,7 @@
innobase_rollback_by_xid(
/*=====================*/
/* out: 0 or error number */
- XID *xid) /* in: X/Open XA transaction idenfification */
+ XID *xid) /* in: X/Open XA transaction identification */
{
trx_t* trx;
@@ -7131,9 +7131,10 @@
}
/***********************************************************************
-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. */
+Create a consistent view for a cursor based on current transaction
+which is created if the corresponding MySQL thread still lacks one.
+This consistent view is then used inside of MySQL when accessing records
+using a cursor. */
void*
innobase_create_cursor_view(void)
@@ -7145,9 +7146,9 @@
}
/***********************************************************************
-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. */
+Close the given consistent cursor view of a transaction and restore
+global read view to a transaction read view. Transaction is created if the
+corresponding MySQL thread still lacks one. */
void
innobase_close_cursor_view(
@@ -7159,13 +7160,15 @@
}
/***********************************************************************
-This function sets the given consistent cursor view to a transaction.
-If a transaction does not exist, transaction is started. */
+Set the given consistent cursor view to a transaction which is created
+if the corresponding MySQL thread still lacks one. If the given
+consistent cursor view is NULL global read view of a transaction is
+restored to a transaction read view. */
void
innobase_set_cursor_view(
/*=====================*/
- void* curview)/* in: Consistent cursor view to be closed */
+ void* curview)/* in: Consistent cursor view to be set */
{
read_cursor_set_for_mysql(check_trx_exists(current_thd),
(cursor_view_t*) curview);
--- 1.98/sql/ha_innodb.h 2005-07-22 14:09:52 +03:00
+++ 1.99/sql/ha_innodb.h 2005-07-28 14:48:24 +03:00
@@ -302,7 +302,7 @@
int innobase_rollback_by_xid(
/* out: 0 or error number */
- XID *xid); /* in : X/Open XA Transaction Idenfification */
+ XID *xid); /* in : X/Open XA Transaction Identification */
int innobase_xa_end(THD *thd);
@@ -312,9 +312,10 @@
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. */
+Create a consistent view for a cursor based on current transaction
+which is created if the corresponding MySQL thread still lacks one.
+This consistent view is then used inside of MySQL when accessing records
+using a cursor. */
void*
innobase_create_cursor_view(void);
@@ -322,9 +323,9 @@
/* 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. */
+Close the given consistent cursor view of a transaction and restore
+global read view to a transaction read view. Transaction is created if the
+corresponding MySQL thread still lacks one. */
void
innobase_close_cursor_view(
@@ -332,8 +333,10 @@
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. */
+Set the given consistent cursor view to a transaction which is created
+if the corresponding MySQL thread still lacks one. If the given
+consistent cursor view is NULL global read view of a transaction is
+restored to a transaction read view. */
void
innobase_set_cursor_view(
| Thread |
|---|
| • bk commit into 5.0 tree (jan:1.1898) | Jan Lindstrom | 28 Jul |