Debian Codegraph @

mysql-test/suite/audit_null/t/audit_plugin.test

raw
1 --source include/have_null_audit_plugin.inc
2 # Test for WL#3771 (audit null plugin)
3 # Created by HHunger 2009-09-02
4 #
5
6 # Adjustment to the OS dependent extension of shared libraries.
7 let $expected_extension= so;
8 if(`SELECT CONVERT(@@version_compile_os USING latin1)
9 IN ("Win32","Win64","Windows")`)
10 {
11 let $expected_extension= dll;
12 }
13
14 # Adjustment to the fact that protocols which lead to the use
15 # of prepared statements cause that a higher number of
16 # plugin calls gets counted.
17 let $expected_calls= 65;
18 if(`SELECT $PS_PROTOCOL > 0`)
19 {
20 let $expected_calls= 112;
21 }
22 if(`SELECT $SP_PROTOCOL > 0`)
23 {
24 let $expected_calls= 65;
25 }
26 if(`SELECT $CURSOR_PROTOCOL > 0`)
27 {
28 let $expected_calls= 50;
29 }
30 if(`SELECT $VIEW_PROTOCOL > 0`)
31 {
32 let $expected_calls= 94;
33 }
34
35 --replace_result $expected_extension <expected_extension>
36 --error ER_CANT_FIND_DL_ENTRY
37 eval INSTALL PLUGIN audit_null SONAME 'adt_null.$expected_extension';
38 --replace_result $expected_extension <expected_extension>
39 eval INSTALL PLUGIN null_audit SONAME 'adt_null.$expected_extension';
40 CREATE TABLE t1 (c1 INT, c2 CHAR(20));
41 --error ER_TABLE_EXISTS_ERROR
42 CREATE TABLE t1 (c1 INT, c2 CHAR(20));
43 INSERT INTO t1 VALUES (1,'a'),(2,'b'),(3,'c');
44 SELECT * FROM t1;
45 --error ER_NO_SUCH_TABLE
46 SELECT * FROM t2;
47 DROP TABLE t1;
48 --replace_result $expected_calls <expected_number_of_calls>
49 SHOW STATUS LIKE 'audit_null_called';
50 --error ER_SP_DOES_NOT_EXIST
51 UNINSTALL PLUGIN audit_null;
52 UNINSTALL PLUGIN null_audit;
53