summaryrefslogtreecommitdiff
path: root/innobase
diff options
context:
space:
mode:
Diffstat (limited to 'innobase')
-rw-r--r--innobase/os/os0file.c10
-rw-r--r--innobase/row/row0sel.c4
-rw-r--r--innobase/srv/srv0srv.c2
-rw-r--r--innobase/srv/srv0start.c22
4 files changed, 34 insertions, 4 deletions
diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c
index 37f64efb27f..b6d4eba9f9b 100644
--- a/innobase/os/os0file.c
+++ b/innobase/os/os0file.c
@@ -3095,7 +3095,15 @@ consecutive_loop:
/* Do the i/o with ordinary, synchronous i/o functions: */
if (slot->type == OS_FILE_WRITE) {
if (array == os_aio_write_array) {
-
+ if ((total_len % UNIV_PAGE_SIZE != 0)
+ || (slot->offset % UNIV_PAGE_SIZE != 0)) {
+ fprintf(stderr,
+"InnoDB: Error: trying a displaced write to %s %lu %lu, len %lu\n",
+ slot->name, slot->offset_high,
+ slot->offset, total_len);
+ ut_a(0);
+ }
+
/* Do a 'last millisecond' check that the page end
is sensible; reported page checksum errors from
Linux seem to wipe over the page end */
diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c
index 0effdf20766..f41574b2855 100644
--- a/innobase/row/row0sel.c
+++ b/innobase/row/row0sel.c
@@ -3287,14 +3287,14 @@ rec_loop:
latest version of the record */
} else if (index == clust_index) {
-
+
/* Fetch a previous version of the row if the current
one is not visible in the snapshot; if we have a very
high force recovery level set, we try to avoid crashes
by skipping this lookup */
if (srv_force_recovery < 5
- && !lock_clust_rec_cons_read_sees(rec, index,
+ && !lock_clust_rec_cons_read_sees(rec, index,
trx->read_view)) {
err = row_sel_build_prev_vers_for_mysql(
diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
index fa836fb6083..9987804f03e 100644
--- a/innobase/srv/srv0srv.c
+++ b/innobase/srv/srv0srv.c
@@ -1717,7 +1717,7 @@ srv_init(void)
os_fast_mutex_init(&srv_conc_mutex);
UT_LIST_INIT(srv_conc_queue);
-
+
srv_conc_slots = mem_alloc(OS_THREAD_MAX_N * sizeof(srv_conc_slot_t));
for (i = 0; i < OS_THREAD_MAX_N; i++) {
diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c
index 59143e81049..067aec36627 100644
--- a/innobase/srv/srv0start.c
+++ b/innobase/srv/srv0start.c
@@ -1164,6 +1164,28 @@ NetWare. */
/* Note that the call srv_boot() also changes the values of
srv_pool_size etc. to the units used by InnoDB internally */
+ /* Set the maximum number of threads which can wait for a semaphore
+ inside InnoDB */
+#if defined(__WIN__) || defined(__NETWARE__)
+
+/* Create less event semaphores because Win 98/ME had difficulty creating
+40000 event semaphores.
+Comment from Novell, Inc.: also, these just take a lot of memory on
+NetWare. */
+ srv_max_n_threads = 1000;
+#else
+ if (srv_pool_size >= 8 * 1024 * 1024) {
+ /* Here we still have srv_pool_size counted
+ in bytes, srv_boot converts the value to
+ pages; if buffer pool is less than 8 MB,
+ assume fewer threads. */
+ srv_max_n_threads = 10000;
+ } else {
+ srv_max_n_threads = 1000; /* saves several MB of memory,
+ especially in 64-bit
+ computers */
+ }
+#endif
err = srv_boot();
if (err != DB_SUCCESS) {