File: nested_profiling.test

package info (click to toggle)
mariadb 1%3A11.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 772,520 kB
  • sloc: ansic: 2,414,714; cpp: 1,791,394; asm: 381,336; perl: 62,905; sh: 49,647; pascal: 40,897; java: 39,363; python: 20,791; yacc: 20,432; sql: 17,907; xml: 12,344; ruby: 8,544; cs: 6,542; makefile: 6,145; ada: 1,879; lex: 1,193; javascript: 996; objc: 80; tcl: 73; awk: 46; php: 22
file content (44 lines) | stat: -rw-r--r-- 1,276 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# ==== Purpose ====
#
# Test verifies that "init_connect" and "init_slave" system variables work
# fine when "profiling=on".
#
# ==== Implementation ====
#
# Steps:
#    0 - Create regular user without super privilege so that "init_connect"
#        variable is effective.
#    1 - Enable profiling.
#    2 - Start a new connection which will try to execute the statements
#        specified in "init_connect". No assert should be reported.
#    3 - Execute SHOW PROFILES to verify that statements specified in
#        "init_connect" are displayed as part of profiling.
#
# ==== References ====
#
# MDEV-22706: Assertion `!current' failed in PROFILING::start_new_query
#
--source include/not_embedded.inc
--source include/have_profiling.inc

SET @saved_profiling=@@GLOBAL.profiling;
SET @saved_init_connect=@@GLOBAL.init_connect;
SET GLOBAL init_connect="set @a=2;set @b=3";
SET GLOBAL profiling=on;

create user mysqltest1@localhost;
connect (con1,localhost,mysqltest1,,);
connection con1;
--disable_ps2_protocol
SELECT @a, @b;
--enable_ps2_protocol
--replace_column 2 #
SHOW PROFILES;

#========== Clean up ===========
connection default;
disconnect con1;
DROP USER mysqltest1@localhost;

SET GLOBAL profiling=@saved_profiling;
SET GLOBAL init_connect=@saved_init_connect;