Debian Codegraph @

mysql-test/suite/x/t/notice_warning.test

raw
1 ## Test notices
2
3 --source include/xplugin_preamble.inc
4 --source include/xplugin_create_user.inc
5 ## Test starts here
6 --let $xtest_file= $MYSQL_TMP_DIR/stmtexecute_query_result_mysqlx.xpl
7 --write_file $xtest_file
8 -->quiet
9
10 -->sql
11 USE test;
12 CREATE TABLE chartab (d VARCHAR(1));
13 SET @old_sql_mode=@@sql_mode;
14 SET @@sql_mode='ERROR_FOR_DIVISION_BY_ZERO';
15 -->endsql
16
17 Mysqlx.Sql.StmtExecute {
18 stmt: "SELECT 1/0, 1/0"
19 }
20 -->recvresult
21
22 ## Disable warnings and try again
23 -->stmtadmin disable_notices {"notice":"warnings"}
24 -->recvresult
25
26 Mysqlx.Sql.StmtExecute {
27 stmt: "SELECT 1/0"
28 }
29 -->recvresult
30
31 ## Enable warnings and try again
32 -->stmtadmin enable_notices {"notice":["warnings"]}
33 -->recvresult
34
35 ## SQL
36 Mysqlx.Sql.StmtExecute {
37 stmt: "SELECT 1/0"
38 }
39 -->recvresult
40
41 ## CRUD Insert
42 Mysqlx.Crud.Insert {
43 collection {
44 name: "chartab"
45 schema: "test"
46 }
47 data_model: TABLE
48 projection {
49 name: "d"
50 }
51 row {
52 field {
53 type: LITERAL
54 literal {
55 type: V_STRING
56 v_string {
57 value: "XX"
58 }
59 }
60 }
61 }
62 }
63 -->recvresult
64
65 ## CRUD Find
66 Mysqlx.Crud.Find {
67 collection {
68 name: "chartab"
69 schema: "test"
70 }
71 data_model: TABLE
72 criteria {
73 type: OPERATOR
74 operator {
75 name: "/"
76 param {
77 type: LITERAL
78 literal {
79 type: V_SINT
80 v_signed_int: 1
81 }
82 }
83 param {
84 type: LITERAL
85 literal {
86 type: V_SINT
87 v_signed_int: 0
88 }
89 }
90 }
91 }
92 }
93 -->recvresult
94
95 ## CRUD Update
96 Mysqlx.Crud.Update {
97 collection {
98 name: "chartab"
99 schema: "test"
100 }
101 data_model: TABLE
102 operation {
103 source {
104 name: "d"
105 }
106 operation: SET
107 value {
108 type: LITERAL
109 literal {
110 type: V_STRING
111 v_string {
112 value: "XX"
113 }
114 }
115 }
116 }
117 }
118 -->recvresult
119
120 ## CRUD Delete
121 # Not sure what kind of delete generates warnings...
122
123 -->stmtadmin list_notices
124 -->recvresult
125
126 -->sql
127 DROP TABLE chartab;
128 SET @@sql_mode = @old_sql_mode;
129 -->endsql
130
131 -->sql
132 SHOW STATUS LIKE 'Mysqlx_stmt_execute_mysqlx';
133 -->endsql
134
135 EOF
136
137 --exec $MYSQLXTEST -ux_root --password='' --file=$xtest_file 2>&1
138
139 ## Cleanup
140 --source ../include/xplugin_cleanup.inc