summaryrefslogtreecommitdiff
path: root/innobase/fsp
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2002-07-31 00:47:20 +0300
committerunknown <heikki@hundin.mysql.fi>2002-07-31 00:47:20 +0300
commit39ee64cd7e7504b7958953b554c8eccf87c7e754 (patch)
treec292c07f8ce5669e3036ef6b705c347df3e64c0c /innobase/fsp
parentda35a07477a643beea0c1335fbf4fcf72ea9e333 (diff)
downloadmariadb-git-39ee64cd7e7504b7958953b554c8eccf87c7e754.tar.gz
Many files:
Merge InnoDB-3.23.52c; improve AUTO-INC algorithm with SHOW TABLE STATUS; new checksum in log sql/ha_innobase.h: Merge InnoDB-3.23.52c; improve AUTO-INC algorithm with SHOW TABLE STATUS; new checksum in log sql/ha_innobase.cc: Merge InnoDB-3.23.52c; improve AUTO-INC algorithm with SHOW TABLE STATUS; new checksum in log innobase/buf/buf0buf.c: Merge InnoDB-3.23.52c; improve AUTO-INC algorithm with SHOW TABLE STATUS; new checksum in log innobase/dict/dict0dict.c: Merge InnoDB-3.23.52c; improve AUTO-INC algorithm with SHOW TABLE STATUS; new checksum in log innobase/fil/fil0fil.c: Merge InnoDB-3.23.52c; improve AUTO-INC algorithm with SHOW TABLE STATUS; new checksum in log innobase/fsp/fsp0fsp.c: Merge InnoDB-3.23.52c; improve AUTO-INC algorithm with SHOW TABLE STATUS; new checksum in log innobase/ha/ha0ha.c: Merge InnoDB-3.23.52c; improve AUTO-INC algorithm with SHOW TABLE STATUS; new checksum in log innobase/include/dict0dict.h: Merge InnoDB-3.23.52c; improve AUTO-INC algorithm with SHOW TABLE STATUS; new checksum in log innobase/include/dict0mem.h: Merge InnoDB-3.23.52c; improve AUTO-INC algorithm with SHOW TABLE STATUS; new checksum in log innobase/include/dyn0dyn.h: Merge InnoDB-3.23.52c; improve AUTO-INC algorithm with SHOW TABLE STATUS; new checksum in log innobase/include/fsp0fsp.h: Merge InnoDB-3.23.52c; improve AUTO-INC algorithm with SHOW TABLE STATUS; new checksum in log innobase/include/log0log.h: Merge InnoDB-3.23.52c; improve AUTO-INC algorithm with SHOW TABLE STATUS; new checksum in log innobase/include/log0recv.h: Merge InnoDB-3.23.52c; improve AUTO-INC algorithm with SHOW TABLE STATUS; new checksum in log innobase/include/trx0sys.h: Merge InnoDB-3.23.52c; improve AUTO-INC algorithm with SHOW TABLE STATUS; new checksum in log innobase/include/trx0trx.h: Merge InnoDB-3.23.52c; improve AUTO-INC algorithm with SHOW TABLE STATUS; new checksum in log innobase/include/log0log.ic: Merge InnoDB-3.23.52c; improve AUTO-INC algorithm with SHOW TABLE STATUS; new checksum in log innobase/lock/lock0lock.c: Merge InnoDB-3.23.52c; improve AUTO-INC algorithm with SHOW TABLE STATUS; new checksum in log innobase/log/log0log.c: Merge InnoDB-3.23.52c; improve AUTO-INC algorithm with SHOW TABLE STATUS; new checksum in log innobase/log/log0recv.c: Merge InnoDB-3.23.52c; improve AUTO-INC algorithm with SHOW TABLE STATUS; new checksum in log innobase/mem/mem0dbg.c: Merge InnoDB-3.23.52c; improve AUTO-INC algorithm with SHOW TABLE STATUS; new checksum in log innobase/row/row0mysql.c: Merge InnoDB-3.23.52c; improve AUTO-INC algorithm with SHOW TABLE STATUS; new checksum in log innobase/srv/srv0srv.c: Merge InnoDB-3.23.52c; improve AUTO-INC algorithm with SHOW TABLE STATUS; new checksum in log innobase/srv/srv0start.c: Merge InnoDB-3.23.52c; improve AUTO-INC algorithm with SHOW TABLE STATUS; new checksum in log innobase/trx/trx0sys.c: Merge InnoDB-3.23.52c; improve AUTO-INC algorithm with SHOW TABLE STATUS; new checksum in log innobase/trx/trx0trx.c: Merge InnoDB-3.23.52c; improve AUTO-INC algorithm with SHOW TABLE STATUS; new checksum in log
Diffstat (limited to 'innobase/fsp')
-rw-r--r--innobase/fsp/fsp0fsp.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/innobase/fsp/fsp0fsp.c b/innobase/fsp/fsp0fsp.c
index d78db2a5ea8..679af640b99 100644
--- a/innobase/fsp/fsp0fsp.c
+++ b/innobase/fsp/fsp0fsp.c
@@ -933,6 +933,36 @@ fsp_header_get_free_limit(
return(limit);
}
+/**************************************************************************
+Gets the size of the tablespace from the tablespace header. If we do not
+have an auto-extending data file, this should be equal to the size of the
+data files. If there is an auto-extending data file, this can be smaller. */
+
+ulint
+fsp_header_get_tablespace_size(
+/*===========================*/
+ /* out: size in pages */
+ ulint space) /* in: space id */
+{
+ fsp_header_t* header;
+ ulint size;
+ mtr_t mtr;
+
+ ut_a(space == 0); /* We have only one log_fsp_current_... variable */
+
+ mtr_start(&mtr);
+
+ mtr_x_lock(fil_space_get_latch(space), &mtr);
+
+ header = fsp_get_space_header(space, &mtr);
+
+ size = mtr_read_ulint(header + FSP_SIZE, MLOG_4BYTES, &mtr);
+
+ mtr_commit(&mtr);
+
+ return(size);
+}
+
/***************************************************************************
Tries to extend the last data file file if it is defined as auto-extending. */
static