1/*****************************************************************************
2
3Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
4Copyright (c) 2017, 2018, MariaDB Corporation.
5
6This program is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free Software
8Foundation; version 2 of the License.
9
10This program is distributed in the hope that it will be useful, but WITHOUT
11ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License along with
15this program; if not, write to the Free Software Foundation, Inc.,
1651 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
17
18*****************************************************************************/
19
20/*****************************************************************//**
21@file ut/ut0dbg.cc
22Debug utilities for Innobase.
23
24Created 1/30/1994 Heikki Tuuri
25**********************************************************************/
26
27#include "ha_prototypes.h"
28
29#include "ut0dbg.h"
30
31/*************************************************************//**
32Report a failed assertion. */
33ATTRIBUTE_NORETURN
34void
35ut_dbg_assertion_failed(
36/*====================*/
37 const char* expr, /*!< in: the failed assertion (optional) */
38 const char* file, /*!< in: source file containing the assertion */
39 unsigned line) /*!< in: line number of the assertion */
40{
41 ut_print_timestamp(stderr);
42 fprintf(stderr, " InnoDB: Assertion failure in file %s line %u\n",
43 file, line);
44 if (expr) {
45 fprintf(stderr,
46 "InnoDB: Failing assertion: %s\n", expr);
47 }
48
49 fputs("InnoDB: We intentionally generate a memory trap.\n"
50 "InnoDB: Submit a detailed bug report"
51 " to https://jira.mariadb.org/\n"
52 "InnoDB: If you get repeated assertion failures"
53 " or crashes, even\n"
54 "InnoDB: immediately after the mysqld startup, there may be\n"
55 "InnoDB: corruption in the InnoDB tablespace. Please refer to\n"
56 "InnoDB: https://mariadb.com/kb/en/library/xtradbinnodb-recovery-modes/\n"
57 "InnoDB: about forcing recovery.\n", stderr);
58
59 fflush(stderr);
60 fflush(stdout);
61 abort();
62}
63