File: audit_plugin.test

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 (53 lines) | stat: -rw-r--r-- 1,478 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
--source include/have_null_audit_plugin.inc
# Test for WL#3771 (audit null plugin)
# Created by HHunger 2009-09-02
#

# Adjustment to the OS dependent extension of shared libraries.
let $expected_extension= so;
if(`SELECT CONVERT(@@version_compile_os USING latin1)
           IN ("Win32","Win64","Windows")`)
{
   let $expected_extension= dll;
}

# Adjustment to the fact that protocols which lead to the use
# of prepared statements cause that a higher number of
# plugin calls gets counted.
let $expected_calls= 65;
if(`SELECT $PS_PROTOCOL > 0`)
{
   let $expected_calls= 112;
}
if(`SELECT $SP_PROTOCOL > 0`)
{
   let $expected_calls= 65;
}
if(`SELECT $CURSOR_PROTOCOL > 0`)
{
   let $expected_calls= 50;
}
if(`SELECT $VIEW_PROTOCOL > 0`)
{
   let $expected_calls= 94;
}

--replace_result $expected_extension  <expected_extension>
--error ER_CANT_FIND_DL_ENTRY
eval INSTALL PLUGIN audit_null SONAME 'adt_null.$expected_extension';
--replace_result $expected_extension <expected_extension>
eval INSTALL PLUGIN null_audit SONAME 'adt_null.$expected_extension';
CREATE TABLE t1 (c1 INT, c2 CHAR(20));
--error ER_TABLE_EXISTS_ERROR
CREATE TABLE t1 (c1 INT, c2 CHAR(20));
INSERT INTO t1 VALUES (1,'a'),(2,'b'),(3,'c');
SELECT * FROM t1;
--error ER_NO_SUCH_TABLE
SELECT * FROM t2;
DROP TABLE t1;
--replace_result $expected_calls <expected_number_of_calls>
SHOW STATUS LIKE 'audit_null_called';
--error ER_SP_DOES_NOT_EXIST
UNINSTALL PLUGIN audit_null;
UNINSTALL PLUGIN null_audit;