summaryrefslogtreecommitdiff
path: root/mysys/my_static.c
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-08-29 13:10:40 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-08-29 13:13:17 +0300
commite50b2bdbcf045e46d1a84ffeb9872d81e3aa5eff (patch)
treea6e8b1fae0fa313d05682901cf022ff3bd0dffe7 /mysys/my_static.c
parent1a3c36595320bd4cf94ba5ab6c5127129269af67 (diff)
downloadmariadb-git-e50b2bdbcf045e46d1a84ffeb9872d81e3aa5eff.tar.gz
MDEV-20425 Implement Boolean debug build option debug_assertbb-10.3-MDEV-20425
Commit 536215e32fc43aa423684e9807640dcf3453924b in MariaDB Server 10.3.1 introduced the compiler flag (not cmake option) DBUG_ASSERT_AS_PRINTF that converts DBUG_ASSERT in non-debug builds into printouts. For debug builds, it could be useful to be able to convert DBUG_ASSERT into a warning or error printout, to allow execution to continue. This would allow debug builds to be used for reproducing hard failures that occur with release builds. my_assert: A Boolean flag (set by default), tied to the new option debug_assert that is available on debug builds only. When set, DBUG_ASSERT() will invoke assert(), like it did until now. When unset, DBUG_ASSERT() will invoke fprintf(stderr, ...) with the file name, line number and assertion expression.
Diffstat (limited to 'mysys/my_static.c')
-rw-r--r--mysys/my_static.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mysys/my_static.c b/mysys/my_static.c
index 909d9ce77fd..2b5f6c3eb1d 100644
--- a/mysys/my_static.c
+++ b/mysys/my_static.c
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
- Copyright (c) 2009, 2012, Monty Program Ab.
+ Copyright (c) 2009, 2019, MariaDB Corporation.
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
@@ -36,6 +36,9 @@ ulong my_file_total_opened= 0;
int my_umask=0664, my_umask_dir=0777;
myf my_global_flags= 0;
+#ifndef DBUG_OFF
+my_bool my_assert= 1;
+#endif
my_bool my_assert_on_error= 0;
struct st_my_file_info my_file_info_default[MY_NFILE];
uint my_file_limit= MY_NFILE;