summaryrefslogtreecommitdiff
path: root/storage/xtradb/page
diff options
context:
space:
mode:
authorJan Lindström <jplindst@mariadb.org>2014-07-08 17:21:13 +0300
committerJan Lindström <jplindst@mariadb.org>2014-07-08 17:21:13 +0300
commit970163d0be0d0c2fdb3fb29badba3fde6c40858d (patch)
tree22266a3df2d02595c2de6e350d8e0c5950bbb41d /storage/xtradb/page
parent8d8c456dbb4d227dd8ee8053fb6c86f9d649296e (diff)
downloadmariadb-git-970163d0be0d0c2fdb3fb29badba3fde6c40858d.tar.gz
MDEV-6348: mariadb crash signal 11
Analysis: sync array output function, should make sure that all used pointers are valid before using them.
Diffstat (limited to 'storage/xtradb/page')
-rw-r--r--storage/xtradb/page/page0zip.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/storage/xtradb/page/page0zip.c b/storage/xtradb/page/page0zip.c
index 40d794770ff..de9a6fd920a 100644
--- a/storage/xtradb/page/page0zip.c
+++ b/storage/xtradb/page/page0zip.c
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 2005, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2014, SkySQL Ab. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -1269,6 +1270,28 @@ page_zip_compress(
goto err_exit;
}
+ /* Simulate a compression failure with a probability determined by
+ innodb_simulate_comp_failures, only if the page has 2 or more
+ records. */
+
+ if (srv_simulate_comp_failures
+ && page_get_n_recs(page) >= 2
+ && ((ulint)(rand() % 100) < srv_simulate_comp_failures)) {
+
+#ifdef UNIV_DEBUG
+ fprintf(stderr,
+ "InnoDB: Simulating a compression failure"
+ " for table %s, index %s, page %lu (%s)\n",
+ index->table_name,
+ index->name,
+ page_get_page_no(page),
+ page_is_leaf(page) ? "leaf" : "non-leaf");
+
+#endif
+
+ goto err_exit;
+ }
+
heap = mem_heap_create(page_zip_get_size(page_zip)
+ n_fields * (2 + sizeof *offsets)
+ n_dense * ((sizeof *recs)