File: events_sql_mode.result

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (95 lines) | stat: -rw-r--r-- 3,261 bytes parent folder | download
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#
# Bug#34134794: SQL_MODE with ANSI_QUOTES affects events created
#               without ANSI_QUOTES
#

SET @@session.time_zone=@@global.log_timestamps;
SET @err_code=ER_CONDITIONAL_DEBUG;
SELECT FROM_UNIXTIME(VARIABLE_VALUE/1000000)
INTO @pfs_errlog_latest
FROM performance_schema.global_status
WHERE VARIABLE_NAME LIKE "Error_log_latest_write";
SET @@global.debug="+d,log_event_query_string";
SET @@SESSION.sql_mode = '';
SET @@GLOBAL.sql_mode = '';
CREATE SCHEMA s;
CREATE TABLE s.modes (time TIMESTAMP, sess VARCHAR(256), glob VARCHAR (256));
# Create event.
CREATE EVENT s.ev
ON SCHEDULE EVERY 1 SECOND
ON COMPLETION PRESERVE
ENABLE
DO
INSERT INTO s.modes VALUES (now(), @@SESSION.sql_mode, @@GLOBAL.sql_mode);

# Show debug entry for execution while global ANSI_QUOTES was disabled.
SELECT data
FROM performance_schema.error_log
WHERE error_code=@err_code
AND logged>@pfs_errlog_latest
ORDER BY logged ASC LIMIT 1;
data
Query string to be compiled: ""/"" >>CREATE PROCEDURE `ev`() SQL SECURITY INVOKER INSERT INTO s.modes VALUES (now(), @@SESSION.sql_mode, @@GLOBAL.sql_mode)<< 

# Show any errors that were thrown. We expect none.
SELECT prio,error_code,data
FROM performance_schema.error_log
WHERE data LIKE "Event Scheduler: %"
   AND logged>@pfs_errlog_latest
LIMIT 3;
prio	error_code	data
SELECT FROM_UNIXTIME(VARIABLE_VALUE/1000000)
INTO @pfs_errlog_latest
FROM performance_schema.global_status
WHERE VARIABLE_NAME LIKE "Error_log_latest_write";
# Change SQL-mode.
SET @@GLOBAL.sql_mode = 'ANSI_QUOTES';
TRUNCATE s.modes;

# Show debug entry for execution while global ANSI_QUOTES was enabled.
# Without patch for Bug#34134794, we shown sql_mode should be global
# (i.e., it should contain ANSI_QUOTES). With the patch, the sql_mode
# at create-time (without ANSI_QUOTES) should be shown.
SELECT data
FROM performance_schema.error_log
WHERE error_code=@err_code
AND logged>@pfs_errlog_latest
ORDER BY logged ASC LIMIT 1;
data
Query string to be compiled: ""/"" >>CREATE PROCEDURE `ev`() SQL SECURITY INVOKER INSERT INTO s.modes VALUES (now(), @@SESSION.sql_mode, @@GLOBAL.sql_mode)<< 

# Show any errors that were thrown after ANSI_QUOTES was enabled.
#
# Without patch for Bug#34134794, we expect some or all of:
# ER_EVENT_ERROR_DURING_COMPILATION
# ER_EVENT_MESSAGE_STACK
# ER_EVENT_EXECUTION_FAILED
#
# With patch, we expect none of the above.
SELECT prio,error_code,data
FROM performance_schema.error_log
WHERE data LIKE "Event Scheduler: %"
   AND logged>@pfs_errlog_latest
LIMIT 3;
prio	error_code	data
DROP EVENT s.ev;
SET @@SESSION.sql_mode = 'ANSI_QUOTES';
# Create event while ANSI_QUOTES is active in session.
CREATE EVENT s.ev
ON SCHEDULE EVERY 1 SECOND
ON COMPLETION PRESERVE
ENABLE
DO
INSERT INTO s.modes VALUES (now(), @@SESSION.sql_mode, @@GLOBAL.sql_mode);
TRUNCATE s.modes;

# Show debug entry for execution of event created with ANSI_QUOTES.
SELECT data
FROM performance_schema.error_log
WHERE error_code=@err_code
ORDER BY logged DESC LIMIT 1;
data
Query string to be compiled: "ANSI_QUOTES"/"ANSI_QUOTES" >>CREATE PROCEDURE "ev"() SQL SECURITY INVOKER INSERT INTO s.modes VALUES (now(), @@SESSION.sql_mode, @@GLOBAL.sql_mode)<< 
SET @@GLOBAL.sql_mode = DEFAULT;
DROP SCHEMA s;
SET @@global.debug="-d,log_event_query_string";