Skip to content

Commit

Permalink
Bug#36027494 Add mtr test for my_print_stacktrace
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Tor Didriksen authored and dahlerlend committed Dec 14, 2023
1 parent 9ed16d4 commit 824e2b4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions mysql-test/collections/disabled.def
Expand Up @@ -62,6 +62,7 @@ component_keyring_file.mysql_ts_alter_encrypt_1 : BUG#29531106 - ATTACHABLE_TRX(
# main suite tests
main.ds_mrr-big @solaris : BUG#14168107 Test leads to timeout on Solaris on slow sparc servers.
main.gtid_next_xa_binlog_off : BUG#33650776 Failure of XA COMMIT of prepared txn, can result in txn rollback
main.print_stacktrace : Bug#36027494 Add mtr test for my_print_stacktrace

# Disabled due to InnoDB issues

Expand Down
12 changes: 12 additions & 0 deletions mysql-test/t/print_stacktrace.test
@@ -0,0 +1,12 @@
# Run manually, to test output from my_print_stacktrace()
# ./mtr --no-check-testcases print_stacktrace
# inspect output in var/log/msqld.1.err

--source include/have_debug.inc

--disable_query_log
SET GLOBAL debug='+d,print_stacktrace';
SELECT CONCAT("Please inspect mysqld server log,",
" look for print_stacktrace.\n") as Hello;
SET GLOBAL debug='-d,print_stacktrace';
--enable_query_log
4 changes: 4 additions & 0 deletions sql/item_strfunc.cc
Expand Up @@ -69,6 +69,7 @@
#include "my_md5_size.h"
#include "my_rnd.h" // my_rand_buffer
#include "my_sqlcommand.h"
#include "my_stacktrace.h"
#include "my_sys.h"
#include "my_systime.h"
#include "myisampack.h"
Expand Down Expand Up @@ -1106,6 +1107,9 @@ String *Item_func_concat::val_str(String *str) {
}
if (tmp_value.append(*res)) return error_str();
}
DBUG_EXECUTE_IF(
"print_stacktrace", fprintf(stderr, "Calling my_print_stacktrace\n");
my_print_stacktrace(nullptr, my_thread_stack_size); fflush(stderr););
tmp_value.set_charset(collation.collation);
return &tmp_value;
}
Expand Down

1 comment on commit 824e2b4

@taozuhong
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi bro, MySQL can't build the libmysqlclient with MSYS2 on Windows, pls see msys2/MINGW-packages#16085

could you guys help solve this issue?

Please sign in to comment.