Debian Codegraph @

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

raw
1
2 ## Various regression tests
3 ##
4 --let $wait_for_unixsocket_status = no_wait
5 --source include/xplugin_preamble.inc
6 --source include/xplugin_create_user.inc
7
8 call mtr.add_suppression("Plugin mysqlx reported: .Error parsing message of type 17:");
9 call mtr.add_suppression("Plugin mysqlx reported: .Setup of socket: '' failed, the socket file path is empty");
10
11 --let $wait_for_unixsocket_status = no_wait
12 --source include/restart_mysqld.inc
13
14
15 ## Test starts here
16 --write_file $MYSQL_TMP_DIR/mysqlx-regression-ps.xpl
17 # Test case for Bug #21472634 SHOW PROCESSLIST RETURNS DIFERENT RESULTS THAN IS QUERY WITH XPROTOCOL CONNECTN
18 -->echo Bug #21472634
19 -->stmtsql show processlist;
20 -->recvresult Id User Host db Command State Info
21 -->sql
22 SELECT id,user,command,state FROM information_schema.processlist ORDER BY id;
23 -->endsql
24 EOF
25 --replace_regex /localhost:[0-9]*/localhost/ / [12] / 0 / /[0-9]+ root(.+)Sleep/$PROC_1_ID root\1Sleep/ /[0-9]+ x_root(.+)Query/$PROC_2_ID x_root\1Query/ /Execute/Query/
26 --exec $MYSQLXTEST -ux_root --password='' --file=$MYSQL_TMP_DIR/mysqlx-regression-ps.xpl 2>&1
27 --remove_file $MYSQL_TMP_DIR/mysqlx-regression-ps.xpl
28
29
30 ## New Test starts here
31 --write_file $MYSQL_TMP_DIR/mysqlx-regression.xpl
32
33 # Test case for Issue MYP-150 count() function is quoted causing error in server
34 -->echo Issue MYP-150
35
36 -->sql
37 use test;
38 create table complexq (age int, name varchar(100));
39 insert into complexq values (50, 'blabla');
40 -->endsql
41
42 Mysqlx.Crud.Find {
43 collection {
44 name: "complexq"
45 schema: "test"
46 }
47 data_model: TABLE
48 projection {
49 source {
50 type: IDENT
51 identifier {
52 name: "age"
53 }
54 }
55 alias: "age_group"
56 }
57 projection {
58 source {
59 type: FUNC_CALL
60 function_call {
61 name {
62 name: "count"
63 }
64 param {
65 type: IDENT
66 identifier {
67 name: "name"
68 }
69 }
70 }
71 }
72 alias: "cnt"
73 }
74 grouping {
75 type: IDENT
76 identifier {
77 name: "age_group"
78 }
79 }
80 }
81 -->recvresult
82
83 -->sql
84 drop table complexq;
85 -->endsql
86 EOF
87
88 --exec $MYSQLXTEST -ux_root --password='' --file=$MYSQL_TMP_DIR/mysqlx-regression.xpl 2>&1
89 --remove_file $MYSQL_TMP_DIR/mysqlx-regression.xpl
90
91 ## MYP-140 - not "in" a database after logging in
92 --echo Check whether default db on connect works
93 --write_file $MYSQL_TMP_DIR/mysqlx-regression.xpl
94 -->sql
95 select schema();
96 -->endsql
97 EOF
98 --exec $MYSQLXTEST -ux_root --password='' --schema=test --file=$MYSQL_TMP_DIR/mysqlx-regression.xpl 2>&1
99 --remove_file $MYSQL_TMP_DIR/mysqlx-regression.xpl
100
101 ## MYP-255 - LIST_CLIENTS,KILL_CLIENTS WORKS WITH PASSWORD_EXPIRED USER WITHOUT SETTING PWD
102 create user expired@localhost;
103 alter user expired@localhost password expire;
104 --echo Check whether password expired sandbox applies to admin cmds
105 --write_file $MYSQL_TMP_DIR/mysqlx-regression.xpl
106 -->stmtadmin list_clients
107 -->expecterror 1820
108 -->recvresult
109
110 Mysqlx.Sql.StmtExecute {
111 stmt: "set password='a'"
112 }
113 -->recvresult
114
115 -->stmtadmin list_clients
116 -->recvresult
117 EOF
118
119 --replace_regex /[0-9]+ /N / / [0-9]+/ N/
120 --exec $MYSQLXTEST -uexpired --password='' --connect-expired-password --file=$MYSQL_TMP_DIR/mysqlx-regression.xpl 2>&1
121 --remove_file $MYSQL_TMP_DIR/mysqlx-regression.xpl
122 drop user expired@localhost;
123
124 ###
125
126 # install and uninstall plugin a bunch of times... should fail because uninstall is forbidden
127 --write_file $MYSQL_TMP_DIR/mysqlx-regression.xpl
128 -->title -Bug #21362400 MYSQLXTEST HANG WHEN EXECUTING INSTALL AND UNINSTALL PLUGIN
129 -->expecterror 3130
130 -->sql
131 INSTALL PLUGIN mysqlx SONAME 'mysqlx.so';
132 -->endsql
133 -->expecterror 3130
134 -->sql
135 UNINSTALL PLUGIN mysqlx;
136 -->endsql
137 -->expecterror 3130
138 -->sql
139 INSTALL PLUGIN mysqlx SONAME 'mysqlx.so';
140 -->endsql
141 -->expecterror 3130
142 -->sql
143 UNINSTALL PLUGIN mysqlx;
144 -->endsql
145 -->expecterror 3130
146 -->sql
147 INSTALL PLUGIN mysqlx SONAME 'mysqlx.so';
148 -->endsql
149
150 EOF
151
152 --exec $MYSQLXTEST -ux_root --password='' --file=$MYSQL_TMP_DIR/mysqlx-regression.xpl 2>&1
153 --remove_file $MYSQL_TMP_DIR/mysqlx-regression.xpl
154
155 ###
156
157 # send a msg with invalid encoding, which was triggering a crash
158
159 --write_file $MYSQL_TMP_DIR/mysqlx-regression.xpl
160 -->import connection.macro
161
162 -->title -Bug Crash when sending an invalid message of type Find, for example
163
164 -->repeat 10
165
166 -->newsession foo
167 # send a Find message with missing fields
168 -->binsend \x01\x00\x00\x00\x11
169 # expect a protobuf decode error
170 -->recverror 5000
171 -->closesession abort
172
173 -->newsession foo -
174 -->callmacro Verify_its_xprotocol_connection
175 # send a CapabilitySet message with missing fields
176 -->binsend \x01\x00\x00\x00\x02
177 # expect a protobuf decode error
178 -->recverror 5000
179 -->closesession abort
180
181 -->endrepeat
182
183 EOF
184
185 --exec $MYSQLXTEST -ux_root --password='' --file=$MYSQL_TMP_DIR/mysqlx-regression.xpl 2>&1
186
187 ## Cleanup
188 --source ../include/xplugin_cleanup.inc