2009-05-27 11:45:59 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
|
2016-09-06 08:43:16 +02:00
|
|
|
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
|
2009-05-27 11:45:59 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
Foundation; version 2 of the License.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License along with
|
2012-08-01 16:27:34 +02:00
|
|
|
this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
|
2009-05-27 11:45:59 +02:00
|
|
|
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
/*****************************************************************//**
|
2012-08-01 16:27:34 +02:00
|
|
|
@file ut/ut0dbg.cc
|
2009-05-27 11:45:59 +02:00
|
|
|
Debug utilities for Innobase.
|
|
|
|
|
|
|
|
Created 1/30/1994 Heikki Tuuri
|
|
|
|
**********************************************************************/
|
|
|
|
|
2016-08-12 10:17:45 +02:00
|
|
|
#include "ha_prototypes.h"
|
2009-05-27 11:45:59 +02:00
|
|
|
|
2016-08-12 10:17:45 +02:00
|
|
|
#include "ut0dbg.h"
|
2009-05-27 11:45:59 +02:00
|
|
|
|
|
|
|
/*************************************************************//**
|
|
|
|
Report a failed assertion. */
|
|
|
|
void
|
|
|
|
ut_dbg_assertion_failed(
|
|
|
|
/*====================*/
|
|
|
|
const char* expr, /*!< in: the failed assertion (optional) */
|
|
|
|
const char* file, /*!< in: source file containing the assertion */
|
|
|
|
ulint line) /*!< in: line number of the assertion */
|
|
|
|
{
|
|
|
|
ut_print_timestamp(stderr);
|
|
|
|
#ifdef UNIV_HOTBACKUP
|
|
|
|
fprintf(stderr, " InnoDB: Assertion failure in file %s line %lu\n",
|
2012-08-01 16:27:34 +02:00
|
|
|
file, line);
|
2009-05-27 11:45:59 +02:00
|
|
|
#else /* UNIV_HOTBACKUP */
|
|
|
|
fprintf(stderr,
|
2016-09-06 08:43:16 +02:00
|
|
|
" InnoDB: Assertion failure in thread " ULINTPF
|
|
|
|
" in file %s line " ULINTPF "\n",
|
2011-02-25 09:33:13 +01:00
|
|
|
os_thread_pf(os_thread_get_curr_id()),
|
|
|
|
innobase_basename(file), line);
|
2009-05-27 11:45:59 +02:00
|
|
|
#endif /* UNIV_HOTBACKUP */
|
|
|
|
if (expr) {
|
|
|
|
fprintf(stderr,
|
|
|
|
"InnoDB: Failing assertion: %s\n", expr);
|
|
|
|
}
|
|
|
|
|
|
|
|
fputs("InnoDB: We intentionally generate a memory trap.\n"
|
|
|
|
"InnoDB: Submit a detailed bug report"
|
|
|
|
" to http://bugs.mysql.com.\n"
|
|
|
|
"InnoDB: If you get repeated assertion failures"
|
|
|
|
" or crashes, even\n"
|
|
|
|
"InnoDB: immediately after the mysqld startup, there may be\n"
|
|
|
|
"InnoDB: corruption in the InnoDB tablespace. Please refer to\n"
|
2011-01-06 08:19:02 +01:00
|
|
|
"InnoDB: " REFMAN "forcing-innodb-recovery.html\n"
|
2009-05-27 11:45:59 +02:00
|
|
|
"InnoDB: about forcing recovery.\n", stderr);
|
|
|
|
|
2016-08-12 10:17:45 +02:00
|
|
|
fflush(stderr);
|
|
|
|
fflush(stdout);
|
|
|
|
abort();
|
2009-05-27 11:45:59 +02:00
|
|
|
}
|