Skip to content

Commit 824e2b4

Browse files
Tor Didriksendahlerlend
authored andcommitted
Bug#36027494 Add mtr test for my_print_stacktrace
Add an mtr test which is only inteded to be run manually: ./mtr --no-check-testcases print_stacktrace Inspect output in var/log/msqld.1.err Change-Id: Ia308592441df0e4a23a18c590df867a15882cbef
1 parent 9ed16d4 commit 824e2b4

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

mysql-test/collections/disabled.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ component_keyring_file.mysql_ts_alter_encrypt_1 : BUG#29531106 - ATTACHABLE_TRX(
6262
# main suite tests
6363
main.ds_mrr-big @solaris : BUG#14168107 Test leads to timeout on Solaris on slow sparc servers.
6464
main.gtid_next_xa_binlog_off : BUG#33650776 Failure of XA COMMIT of prepared txn, can result in txn rollback
65+
main.print_stacktrace : Bug#36027494 Add mtr test for my_print_stacktrace
6566

6667
# Disabled due to InnoDB issues
6768

mysql-test/t/print_stacktrace.test

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Run manually, to test output from my_print_stacktrace()
2+
# ./mtr --no-check-testcases print_stacktrace
3+
# inspect output in var/log/msqld.1.err
4+
5+
--source include/have_debug.inc
6+
7+
--disable_query_log
8+
SET GLOBAL debug='+d,print_stacktrace';
9+
SELECT CONCAT("Please inspect mysqld server log,",
10+
" look for print_stacktrace.\n") as Hello;
11+
SET GLOBAL debug='-d,print_stacktrace';
12+
--enable_query_log

sql/item_strfunc.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
#include "my_md5_size.h"
7070
#include "my_rnd.h" // my_rand_buffer
7171
#include "my_sqlcommand.h"
72+
#include "my_stacktrace.h"
7273
#include "my_sys.h"
7374
#include "my_systime.h"
7475
#include "myisampack.h"
@@ -1106,6 +1107,9 @@ String *Item_func_concat::val_str(String *str) {
11061107
}
11071108
if (tmp_value.append(*res)) return error_str();
11081109
}
1110+
DBUG_EXECUTE_IF(
1111+
"print_stacktrace", fprintf(stderr, "Calling my_print_stacktrace\n");
1112+
my_print_stacktrace(nullptr, my_thread_stack_size); fflush(stderr););
11091113
tmp_value.set_charset(collation.collation);
11101114
return &tmp_value;
11111115
}

0 commit comments

Comments
 (0)