summaryrefslogtreecommitdiff
path: root/sql/ha_innobase.cc
diff options
context:
space:
mode:
authorunknown <heikki@donna.mysql.fi>2001-06-03 22:58:03 +0300
committerunknown <heikki@donna.mysql.fi>2001-06-03 22:58:03 +0300
commit9d4272bbac3678fbd8594027dd6ad62e69d065f3 (patch)
treece963973f9fcd0dfa6b854cc66c3c0d53fc93ea0 /sql/ha_innobase.cc
parent5ec76be436655eefc2a6403b21606fad914ac814 (diff)
downloadmariadb-git-9d4272bbac3678fbd8594027dd6ad62e69d065f3.tar.gz
manual.texi website address change
row0sel.c CHECK TABLE now also for InnoDB, a join speed optimization trx0trx.c CHECK TABLE now also for InnoDB, a join speed optimization rem0cmp.c CHECK TABLE now also for InnoDB, a join speed optimization row0mysql.c CHECK TABLE now also for InnoDB, a join speed optimization page0page.c CHECK TABLE now also for InnoDB, a join speed optimization row0mysql.h CHECK TABLE now also for InnoDB, a join speed optimization trx0trx.h CHECK TABLE now also for InnoDB, a join speed optimization btr0btr.h CHECK TABLE now also for InnoDB, a join speed optimization btr0cur.h CHECK TABLE now also for InnoDB, a join speed optimization btr0pcur.h CHECK TABLE now also for InnoDB, a join speed optimization btr0pcur.ic CHECK TABLE now also for InnoDB, a join speed optimization btr0btr.c CHECK TABLE now also for InnoDB, a join speed optimization btr0cur.c CHECK TABLE now also for InnoDB, a join speed optimization btr0sea.c CHECK TABLE now also for InnoDB, a join speed optimization innodb.result CHECK TABLE now also for InnoDB, a join speed optimization ha_innobase.cc CHECK TABLE now also for InnoDB, a join speed optimization ha_innobase.h CHECK TABLE now also for InnoDB, a join speed optimization sql/ha_innobase.cc: CHECK TABLE now also for InnoDB, a join speed optimization sql/ha_innobase.h: CHECK TABLE now also for InnoDB, a join speed optimization mysql-test/r/innodb.result: CHECK TABLE now also for InnoDB, a join speed optimization innobase/btr/btr0btr.c: CHECK TABLE now also for InnoDB, a join speed optimization innobase/btr/btr0cur.c: CHECK TABLE now also for InnoDB, a join speed optimization innobase/btr/btr0sea.c: CHECK TABLE now also for InnoDB, a join speed optimization innobase/include/btr0btr.h: CHECK TABLE now also for InnoDB, a join speed optimization innobase/include/btr0cur.h: CHECK TABLE now also for InnoDB, a join speed optimization innobase/include/btr0pcur.h: CHECK TABLE now also for InnoDB, a join speed optimization innobase/include/btr0pcur.ic: CHECK TABLE now also for InnoDB, a join speed optimization innobase/include/row0mysql.h: CHECK TABLE now also for InnoDB, a join speed optimization innobase/include/trx0trx.h: CHECK TABLE now also for InnoDB, a join speed optimization innobase/page/page0page.c: CHECK TABLE now also for InnoDB, a join speed optimization innobase/rem/rem0cmp.c: CHECK TABLE now also for InnoDB, a join speed optimization innobase/row/row0mysql.c: CHECK TABLE now also for InnoDB, a join speed optimization innobase/row/row0sel.c: CHECK TABLE now also for InnoDB, a join speed optimization innobase/trx/trx0trx.c: CHECK TABLE now also for InnoDB, a join speed optimization Docs/manual.texi: website address change
Diffstat (limited to 'sql/ha_innobase.cc')
-rw-r--r--sql/ha_innobase.cc56
1 files changed, 52 insertions, 4 deletions
diff --git a/sql/ha_innobase.cc b/sql/ha_innobase.cc
index fa44cebe19d..4a69056a9e2 100644
--- a/sql/ha_innobase.cc
+++ b/sql/ha_innobase.cc
@@ -2142,6 +2142,7 @@ ha_innobase::external_lock(
prebuilt->in_update_remember_pos = TRUE;
if (lock_type == F_WRLCK) {
+
/* If this is a SELECT, then it is in UPDATE TABLE ...
or SELECT ... FOR UPDATE */
prebuilt->select_lock_type = LOCK_X;
@@ -2153,13 +2154,27 @@ ha_innobase::external_lock(
}
trx->n_mysql_tables_in_use++;
+
+ if (prebuilt->select_lock_type != LOCK_NONE) {
+
+ trx->mysql_n_tables_locked++;
+ }
} else {
trx->n_mysql_tables_in_use--;
- if (trx->n_mysql_tables_in_use == 0 &&
- !(thd->options
- & (OPTION_NOT_AUTO_COMMIT | OPTION_BEGIN))) {
- innobase_commit(thd, trx);
+ if (trx->n_mysql_tables_in_use == 0) {
+
+ trx->mysql_n_tables_locked = 0;
+
+ if (trx->has_search_latch) {
+
+ trx_search_latch_release_if_reserved(trx);
+ }
+
+ if (!(thd->options
+ & (OPTION_NOT_AUTO_COMMIT | OPTION_BEGIN))) {
+ innobase_commit(thd, trx);
+ }
}
}
@@ -2690,6 +2705,39 @@ ha_innobase::info(
DBUG_VOID_RETURN;
}
+/***********************************************************************
+Tries to check that an InnoDB table is not corrupted. If corruption is
+noticed, prints to stderr information about it. In case of corruption
+may also assert a failure and crash the server. */
+
+int
+ha_innobase::check(
+/*===============*/
+ /* out: HA_ADMIN_CORRUPT or
+ HA_ADMIN_OK */
+ THD* thd, /* in: user thread handle */
+ HA_CHECK_OPT* check_opt) /* in: check options, currently
+ ignored */
+{
+ row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt;
+ ulint ret;
+
+ if (prebuilt->mysql_template == NULL) {
+ /* Build the template; we will use a dummy template
+ in index scans done in checking */
+
+ build_template(prebuilt, NULL, table, ROW_MYSQL_WHOLE_ROW);
+ }
+
+ ret = row_check_table_for_mysql(prebuilt);
+
+ if (ret == DB_SUCCESS) {
+ return(HA_ADMIN_OK);
+ }
+
+ return(HA_ADMIN_CORRUPT);
+}
+
/*****************************************************************
Adds information about free space in the InnoDB tablespace to a
table comment which is printed out when a user calls SHOW TABLE STATUS. */