| 1 |
## This is test file for verification of disabiling warning,password_expired,generated_insert_id,rows_affected,produced_message notices and their functionality |
| 2 |
|
| 3 |
## Preamble |
| 4 |
--source include/xplugin_preamble.inc |
| 5 |
--source include/xplugin_create_user.inc |
| 6 |
## Test starts here |
| 7 |
--let $xtest_result= $MYSQL_TMP_DIR/stmtexecute_query_result_mysqlx.xpl |
| 8 |
--write_file $xtest_result |
| 9 |
-->quiet |
| 10 |
|
| 11 |
-->stmtadmin disable_notices {"notice": "warnings"} |
| 12 |
-->recvresult |
| 13 |
|
| 14 |
-->echo check with dropping db which doesn't exists |
| 15 |
-->stmtsql drop database if exists mysqltest; |
| 16 |
-->recvresult |
| 17 |
|
| 18 |
-->echo check with dropping table which doesn't exists |
| 19 |
-->stmtsql drop table if exists test.mysqltest; |
| 20 |
-->recvresult |
| 21 |
|
| 22 |
-->echo check with dropping procedure which doesn't exists |
| 23 |
-->stmtsql drop procedure if exists test.test_invalid; |
| 24 |
-->recvresult |
| 25 |
|
| 26 |
-->echo check with dropping function which doesn't exists |
| 27 |
-->stmtsql drop function if exists test.test_signal_func; |
| 28 |
-->recvresult |
| 29 |
|
| 30 |
-->echo check with dropping view which doesn't exists |
| 31 |
-->stmtsql drop view if exists test.v1; |
| 32 |
-->recvresult |
| 33 |
|
| 34 |
-->echo out of range values for INT,UNSIGN INT |
| 35 |
-->stmtsql create table test.t1 (c1 INT, c2 INT UNSIGNED); |
| 36 |
-->recvresult |
| 37 |
|
| 38 |
-->stmtsql insert ignore into test.t1 values ('21474836461','21474836461'); |
| 39 |
-->recvresult |
| 40 |
|
| 41 |
-->stmtsql insert ignore into test.t1 values ('-21474836461','-21474836461'); |
| 42 |
-->recvresult |
| 43 |
|
| 44 |
-->stmtsql drop table test.t1; |
| 45 |
-->recvresult |
| 46 |
|
| 47 |
-->echo checking double data type |
| 48 |
-->stmtsql create table test.t1 (grp int, a bigint unsigned, c char(10) not null, d char(10) not null); |
| 49 |
-->recvresult |
| 50 |
|
| 51 |
-->stmtsql insert into test.t1 values (1,1,"a","a"); |
| 52 |
-->recvresult |
| 53 |
|
| 54 |
-->stmtsql insert into test.t1 values (2,2,"b","a"); |
| 55 |
-->recvresult |
| 56 |
|
| 57 |
-->stmtsql insert into test.t1 values (2,3,"c","b"); |
| 58 |
-->recvresult |
| 59 |
|
| 60 |
-->stmtsql insert into test.t1 values (3,4,"E","a"); |
| 61 |
-->recvresult |
| 62 |
|
| 63 |
-->stmtsql insert into test.t1 values (3,5,"C","b"); |
| 64 |
-->recvresult |
| 65 |
|
| 66 |
-->stmtsql insert into test.t1 values (3,6,"D","b"); |
| 67 |
-->recvresult |
| 68 |
|
| 69 |
-->stmtsql insert into test.t1 values (3,7,"d","d"); |
| 70 |
-->recvresult |
| 71 |
|
| 72 |
-->stmtsql insert into test.t1 values (3,8,"d","d"); |
| 73 |
-->recvresult |
| 74 |
|
| 75 |
-->stmtsql insert into test.t1 values (3,9,"D","c"); |
| 76 |
-->recvresult |
| 77 |
|
| 78 |
-->stmtsql select grp,group_concat(a order by a,d+c-ascii(c)-a) from test.t1 group by grp; |
| 79 |
-->recvresult |
| 80 |
|
| 81 |
-->stmtsql select grp,group_concat(a order by d+c-ascii(c),a) from test.t1 group by grp; |
| 82 |
-->recvresult |
| 83 |
|
| 84 |
-->stmtsql set group_concat_max_len = 4; |
| 85 |
-->recvresult |
| 86 |
|
| 87 |
-->stmtsql select grp,group_concat(c order by c) from test.t1 group by grp; |
| 88 |
-->recvresult |
| 89 |
|
| 90 |
-->stmtsql drop table test.t1; |
| 91 |
-->recvresult |
| 92 |
|
| 93 |
-->echo checking character data type |
| 94 |
-->echo Error is returned instead of warning for insert operation with xplugin |
| 95 |
-->stmtsql SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; |
| 96 |
-->recvresult |
| 97 |
|
| 98 |
-->stmtsql prepare stmt from 'create table test.t1 (a varchar(10) character set utf8)'; |
| 99 |
-->recvresult |
| 100 |
|
| 101 |
-->stmtsql execute stmt; |
| 102 |
-->recvresult |
| 103 |
|
| 104 |
-->stmtsql insert into test.t1 (a) values (repeat('a', 20)); |
| 105 |
-->recvresult |
| 106 |
|
| 107 |
-->stmtsql select length(a) from test.t1; |
| 108 |
-->recvresult |
| 109 |
|
| 110 |
-->stmtsql drop table test.t1; |
| 111 |
-->recvresult |
| 112 |
|
| 113 |
-->stmtsql execute stmt; |
| 114 |
-->recvresult |
| 115 |
|
| 116 |
-->echo checking directly from IS tables |
| 117 |
-->stmtsql select * from performance_schema.session_variables where variable_name like 'max_join_size'; |
| 118 |
-->recvresult |
| 119 |
|
| 120 |
-->stmtsql select * from performance_schema.session_variables where variable_name like 'concurrent_insert'; |
| 121 |
-->recvresult |
| 122 |
|
| 123 |
-->stmtsql select * from performance_schema.session_variables where variable_name like 'default_storage_engine'; |
| 124 |
-->recvresult |
| 125 |
|
| 126 |
-->echo checking errors and warnings with duplicate table |
| 127 |
-->stmtsql SET SQL_WARNINGS=1; |
| 128 |
-->recvresult |
| 129 |
|
| 130 |
-->echo checking errors and warnings with duplicate table names |
| 131 |
-->stmtsql create table test.dup (a int); |
| 132 |
-->recvresult |
| 133 |
|
| 134 |
-->stmtsql create table test.dup (a int); |
| 135 |
-->expecterror 1050 |
| 136 |
-->recvresult |
| 137 |
|
| 138 |
-->stmtsql show count(*) errors; |
| 139 |
-->recvresult |
| 140 |
|
| 141 |
-->stmtsql show errors; |
| 142 |
-->recvresult |
| 143 |
|
| 144 |
-->stmtsql drop table test.dup; |
| 145 |
-->recvresult |
| 146 |
|
| 147 |
-->echo checking creating table with if not exists |
| 148 |
-->stmtsql flush status; |
| 149 |
-->recvresult |
| 150 |
|
| 151 |
-->stmtsql use test; |
| 152 |
-->recvresult |
| 153 |
|
| 154 |
-->stmtsql create table t1 (a int not null, b int, primary key (a)); |
| 155 |
-->expecterror 1050 |
| 156 |
-->recvresult |
| 157 |
|
| 158 |
-->stmtsql create table if not exists t1 select 2; |
| 159 |
-->recvresult |
| 160 |
|
| 161 |
-->stmtsql select * from t1; |
| 162 |
-->recvresult |
| 163 |
|
| 164 |
-->stmtsql create table if not exists t1 select 3 as 'a',4 as 'b'; |
| 165 |
-->recvresult |
| 166 |
|
| 167 |
-->stmtsql show status like "Opened_tables"; |
| 168 |
-->recvresult |
| 169 |
|
| 170 |
-->stmtsql select * from t1; |
| 171 |
-->recvresult |
| 172 |
|
| 173 |
-->stmtsql drop table t1; |
| 174 |
-->recvresult |
| 175 |
|
| 176 |
-->echo try droping mutliplt tables with if exists and check multiple warnings |
| 177 |
-->stmtsql use test; |
| 178 |
-->recvresult |
| 179 |
|
| 180 |
-->stmtsql drop tables if exists t1, t2; |
| 181 |
-->recvresult |
| 182 |
-->echo try checking may warnings |
| 183 |
-->stmtsql drop tables if exists t1, t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,a1, a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,aa1, aa2,aa3,aa4,aa5,aa6,aa7,aa8,aa9,aa10,aa11,aa12,aa13,aa14,aa15,aa16,aa17,aa18,aa19,aa20,aa21,aa22,aa23,aa24,aa25,aa26,aa27,aa28,aa29,aa30,aaaa1, aaaa2,aaaa3,aaaa4,aaaa5,aaaa6,aaaa7,aaaa8,aaaa9,aaaa10,aaaa11,aaaa12,aaaa13,aaaa14,aaaa15,aaaa16,aaaa17,aaaa18,aaaa19,aaaa20,aaaa21,aaaa22,aaaa23,aaaa24,aaaa25,aaaa26,aaaa27,aaaa28,aaaa29,aaaa30; |
| 184 |
-->recvresult |
| 185 |
|
| 186 |
-->echo try dropping same table with if exists and observe error/wrarnings |
| 187 |
Mysqlx.Sql.StmtExecute { |
| 188 |
stmt: "drop tables if exists t1,t1;" |
| 189 |
} |
| 190 |
-->expecterror 1066 |
| 191 |
-->recvresult |
| 192 |
|
| 193 |
Mysqlx.Sql.StmtExecute { |
| 194 |
stmt: "set max_error_count=65535;" |
| 195 |
} |
| 196 |
-->recvresult |
| 197 |
|
| 198 |
-->echo check more than 64 warnings returned |
| 199 |
Mysqlx.Sql.StmtExecute { |
| 200 |
stmt: "drop tables if exists t1, t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,a1, a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,aa1, aa2,aa3,aa4,aa5,aa6,aa7,aa8,aa9,aa10,aa11,aa12,aa13,aa14,aa15,aa16,aa17,aa18,aa19,aa20,aa21,aa22,aa23,aa24,aa25,aa26,aa27,aa28,aa29,aa30,aaaa1, aaaa2,aaaa3,aaaa4,aaaa5,aaaa6,aaaa7,aaaa8,aaaa9,aaaa10,aaaa11,aaaa12,aaaa13,aaaa14,aaaa15,aaaa16,aaaa17,aaaa18,aaaa19,aaaa20,aaaa21,aaaa22,aaaa23,aaaa24,aaaa25,aaaa26,aaaa27,aaaa28,aaaa29,aaaa30,bb1, bb2,bb3,bb4,bb5,bb6,bb7,bb8,bb9,bb10,bb11,bb12,bb13,bb14,bb15,bb16,bb17,bb18,bb19,bb20,bb21,bb22,bb23,bb24,bb25,bb26,bb27,bb28,bb29,bb30,b1, b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29,b30;" |
| 201 |
} |
| 202 |
-->recvresult |
| 203 |
|
| 204 |
-->echo check no warnings based on max_error_count parameter set |
| 205 |
Mysqlx.Sql.StmtExecute { |
| 206 |
stmt: "set max_error_count=0;" |
| 207 |
} |
| 208 |
-->recvresult |
| 209 |
|
| 210 |
Mysqlx.Sql.StmtExecute { |
| 211 |
stmt: "drop tables if exists t1,t2;" |
| 212 |
} |
| 213 |
-->recvresult |
| 214 |
|
| 215 |
Mysqlx.Sql.StmtExecute { |
| 216 |
stmt: "set max_error_count=-64;" |
| 217 |
} |
| 218 |
-->recvresult |
| 219 |
|
| 220 |
Mysqlx.Sql.StmtExecute { |
| 221 |
stmt: "show variables like 'max_error_count';" |
| 222 |
} |
| 223 |
-->recvresult |
| 224 |
|
| 225 |
Mysqlx.Sql.StmtExecute { |
| 226 |
stmt: "set max_error_count=64;" |
| 227 |
} |
| 228 |
-->recvresult |
| 229 |
|
| 230 |
-->echo checking creating temporary table when normal and temp table exists |
| 231 |
-->stmtsql use test; |
| 232 |
-->recvresult |
| 233 |
|
| 234 |
-->stmtsql create table if not exists t1 (a int) select 2 as a; |
| 235 |
-->recvresult |
| 236 |
|
| 237 |
-->stmtsql create temporary table t1 (a int) select 2 as a; |
| 238 |
-->recvresult |
| 239 |
|
| 240 |
-->stmtsql select * from t1; |
| 241 |
-->recvresult |
| 242 |
|
| 243 |
-->stmtsql create temporary table if not exists t1 (a int) select 2 as a; |
| 244 |
-->recvresult |
| 245 |
|
| 246 |
-->stmtsql select * from t1; |
| 247 |
-->recvresult |
| 248 |
|
| 249 |
-->stmtsql drop temporary table t1; |
| 250 |
-->recvresult |
| 251 |
|
| 252 |
-->stmtsql drop table t1; |
| 253 |
-->recvresult |
| 254 |
|
| 255 |
-->echo checking data truncation warnings for default values |
| 256 |
-->stmtsql use test; |
| 257 |
-->recvresult |
| 258 |
|
| 259 |
-->stmtsql CREATE TABLE t1 SELECT 0.123456789012345678901234567890123456 AS f1; |
| 260 |
-->recvresult |
| 261 |
|
| 262 |
-->stmtsql drop table t1; |
| 263 |
-->recvresult |
| 264 |
|
| 265 |
-->echo checking data truncation warnings while creating table with expression |
| 266 |
-->stmtsql use test; |
| 267 |
-->recvresult |
| 268 |
|
| 269 |
-->stmtsql create table t1 as select 5.05 / 0.014; |
| 270 |
-->recvresult |
| 271 |
|
| 272 |
-->stmtsql drop table t1; |
| 273 |
-->recvresult |
| 274 |
|
| 275 |
-->echo checking warnings with insert and select operations |
| 276 |
-->echo below insert into t1 returns 17775 warnings,checking only limited warnings as test takes more time to render the warnings |
| 277 |
-->stmtsql use test; |
| 278 |
-->recvresult |
| 279 |
|
| 280 |
-->stmtsql create table t2 (a char(1)); |
| 281 |
-->recvresult |
| 282 |
|
| 283 |
-->stmtsql insert into t2 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'); |
| 284 |
-->recvresult |
| 285 |
|
| 286 |
-->stmtsql insert into t2 values ('8'),('9'),('A'),('B'),('C'),('D'),('E'),('F'); |
| 287 |
-->recvresult |
| 288 |
|
| 289 |
-->stmtsql create table t1 (a varchar(2) character set cp932) engine=myisam; |
| 290 |
-->recvresult |
| 291 |
|
| 292 |
-->echo checking for more than default 64 warnings |
| 293 |
Mysqlx.Sql.StmtExecute { |
| 294 |
stmt: "set max_error_count=500;" |
| 295 |
} |
| 296 |
-->recvresult |
| 297 |
|
| 298 |
-->stmtsql insert into t1 select unhex(concat(t24.a, t23.a, t22.a, t21.a)) from t2 t21, t2 t22, t2 t23, t2 t24; |
| 299 |
-->recvresult |
| 300 |
|
| 301 |
Mysqlx.Sql.StmtExecute { |
| 302 |
stmt: "set max_error_count=64;" |
| 303 |
} |
| 304 |
-->recvresult |
| 305 |
|
| 306 |
-->stmtsql drop tables t1,t2; |
| 307 |
-->recvresult |
| 308 |
|
| 309 |
-->echo checking warnigns with prepare and execute statmenets |
| 310 |
-->stmtsql use test; |
| 311 |
-->recvresult |
| 312 |
|
| 313 |
-->stmtsql CREATE TABLE t1(f1 VARCHAR(6) NOT NULL, FULLTEXT KEY(f1), UNIQUE(f1)); |
| 314 |
-->recvresult |
| 315 |
|
| 316 |
-->stmtsql INSERT INTO t1 VALUES ('test'); |
| 317 |
-->recvresult |
| 318 |
|
| 319 |
-->stmtsql SELECT 1 FROM t1 WHERE 1 > ALL((SELECT 1 FROM t1 JOIN t1 a ON (MATCH(t1.f1) against ("")) WHERE t1.f1 GROUP BY t1.f1)) xor f1; |
| 320 |
-->recvresult |
| 321 |
|
| 322 |
-->stmtsql PREPARE stmt FROM 'SELECT 1 FROM t1 WHERE 1 > ALL((SELECT 1 FROM t1 RIGHT OUTER JOIN t1 a ON (MATCH(t1.f1) against ("")) WHERE t1.f1 GROUP BY t1.f1)) xor f1'; |
| 323 |
-->recvresult |
| 324 |
|
| 325 |
-->stmtsql EXECUTE stmt; |
| 326 |
-->recvresult |
| 327 |
|
| 328 |
-->stmtsql EXECUTE stmt; |
| 329 |
-->recvresult |
| 330 |
|
| 331 |
-->stmtsql DEALLOCATE PREPARE stmt; |
| 332 |
-->recvresult |
| 333 |
|
| 334 |
-->stmtsql PREPARE stmt FROM 'SELECT 1 FROM t1 WHERE 1 > ALL((SELECT 1 FROM t1 JOIN t1 a ON (MATCH(t1.f1) against ("")) WHERE t1.f1 GROUP BY t1.f1))'; |
| 335 |
-->recvresult |
| 336 |
|
| 337 |
-->stmtsql EXECUTE stmt; |
| 338 |
-->recvresult |
| 339 |
|
| 340 |
-->stmtsql EXECUTE stmt; |
| 341 |
-->recvresult |
| 342 |
|
| 343 |
-->stmtsql DEALLOCATE PREPARE stmt; |
| 344 |
-->recvresult |
| 345 |
|
| 346 |
-->stmtsql drop table t1; |
| 347 |
-->recvresult |
| 348 |
|
| 349 |
-->echo checking warnings with group by when sql_mode is no_engine_substitution |
| 350 |
-->stmtsql use test; |
| 351 |
-->recvresult |
| 352 |
|
| 353 |
-->stmtsql SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; |
| 354 |
-->recvresult |
| 355 |
|
| 356 |
-->stmtsql create table t1 (c1 char(3), c2 char(3)); |
| 357 |
-->recvresult |
| 358 |
|
| 359 |
-->stmtsql create table t2 (c3 char(3), c4 char(3)); |
| 360 |
-->recvresult |
| 361 |
|
| 362 |
-->stmtsql insert into t1 values ('aaa', 'bb1'), ('aaa', 'bb2'); |
| 363 |
-->recvresult |
| 364 |
|
| 365 |
-->stmtsql insert into t2 values ('aaa', 'bb1'), ('aaa', 'bb2'); |
| 366 |
-->recvresult |
| 367 |
|
| 368 |
-->stmtsql select t1.c1 as c2 from t1, t2 where t1.c2 = t2.c4 group by c2; |
| 369 |
-->recvresult |
| 370 |
|
| 371 |
-->stmtsql select t1.c1 as c2 from t1, t2 where t1.c2 = t2.c4 group by t1.c1; |
| 372 |
-->recvresult |
| 373 |
|
| 374 |
-->stmtsql drop table t1, t2; |
| 375 |
-->recvresult |
| 376 |
|
| 377 |
-->echo setting back to default of sql_mode |
| 378 |
-->stmtsql SET sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION'; |
| 379 |
-->recvresult |
| 380 |
|
| 381 |
-->echo checking with group by where both error and warnings expected with default sql_mode |
| 382 |
-->stmtsql use test; |
| 383 |
-->recvresult |
| 384 |
|
| 385 |
-->stmtsql create table t1 (c1 char(3), c2 char(3)); |
| 386 |
-->recvresult |
| 387 |
|
| 388 |
-->stmtsql create table t2 (c3 char(3), c4 char(3)); |
| 389 |
-->recvresult |
| 390 |
|
| 391 |
-->stmtsql insert into t1 values ('aaa', 'bb1'), ('aaa', 'bb2'); |
| 392 |
-->recvresult |
| 393 |
|
| 394 |
-->stmtsql insert into t2 values ('aaa', 'bb1'), ('aaa', 'bb2'); |
| 395 |
-->recvresult |
| 396 |
|
| 397 |
-->stmtsql select t1.c1 as c2 from t1, t2 where t1.c2 = t2.c4 group by c2; |
| 398 |
-->expecterror 1055 |
| 399 |
-->recvresult |
| 400 |
|
| 401 |
|
| 402 |
-->echo expect both error and warning |
| 403 |
-->echo change result file once Bug#21524666 is fixed |
| 404 |
-->stmtsql select t1.c1 as c2 from t1, t2 where t1.c2 = t2.c4 group by t1.c1; |
| 405 |
-->recvresult |
| 406 |
|
| 407 |
-->stmtsql drop table t1, t2; |
| 408 |
-->recvresult |
| 409 |
|
| 410 |
-->echo checking warnings with rollback on non-transactional tables |
| 411 |
-->stmtsql use test; |
| 412 |
-->recvresult |
| 413 |
|
| 414 |
-->stmtsql create table t1 (n int not null primary key) engine=myisam; |
| 415 |
-->recvresult |
| 416 |
|
| 417 |
-->stmtsql begin work; |
| 418 |
-->recvresult |
| 419 |
|
| 420 |
-->stmtsql insert into t1 values (4); |
| 421 |
-->recvresult |
| 422 |
|
| 423 |
-->stmtsql insert into t1 values (5); |
| 424 |
-->recvresult |
| 425 |
|
| 426 |
-->stmtsql rollback; |
| 427 |
-->recvresult |
| 428 |
|
| 429 |
-->stmtsql show warnings; |
| 430 |
-->recvresult |
| 431 |
|
| 432 |
-->stmtsql show errors; |
| 433 |
-->recvresult |
| 434 |
|
| 435 |
-->stmtsql select @@warning_count,@@error_count; |
| 436 |
-->recvresult |
| 437 |
|
| 438 |
-->stmtsql select * from t1; |
| 439 |
-->recvresult |
| 440 |
|
| 441 |
-->stmtsql show warnings; |
| 442 |
-->recvresult |
| 443 |
|
| 444 |
-->stmtsql select @@warning_count; |
| 445 |
-->recvresult |
| 446 |
|
| 447 |
-->stmtsql drop table t1; |
| 448 |
-->recvresult |
| 449 |
|
| 450 |
-->echo expect 2 warnings for insert related to truncation and incorrect date value |
| 451 |
-->sql |
| 452 |
use test; |
| 453 |
set sql_mode=''; |
| 454 |
create table t1 ( |
| 455 |
a date not null, |
| 456 |
b mediumtext generated always as ((a not in (a,a))) virtual, |
| 457 |
c timestamp generated always as ((a not in (b,b))) stored not null |
| 458 |
); |
| 459 |
-->endsql |
| 460 |
-->stmtsql insert t1(a) values(7777777777); |
| 461 |
-->recvresult |
| 462 |
|
| 463 |
-->sql |
| 464 |
drop table t1; |
| 465 |
SET sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION'; |
| 466 |
-->endsql |
| 467 |
|
| 468 |
-->echo checking warnings while creating index which is more than row size |
| 469 |
-->sql |
| 470 |
use test; |
| 471 |
create table worklog5743_1(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=1; |
| 472 |
create table worklog5743_2(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=2; |
| 473 |
create table worklog5743_4(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=4; |
| 474 |
create table worklog5743_8(a1 int, a2 TEXT, a3 TEXT) KEY_BLOCK_SIZE=8; |
| 475 |
-->endsql |
| 476 |
|
| 477 |
-->echo below statement throws warning as Error and actual error is missing |
| 478 |
-->echo change result file once Bug#21529270 fixed |
| 479 |
-->stmtsql create index idx1 on worklog5743_1(a2(4000)); |
| 480 |
-->expecterror 1071 |
| 481 |
-->recvresult |
| 482 |
|
| 483 |
-->sql |
| 484 |
##setting back to original value |
| 485 |
drop table worklog5743_1; |
| 486 |
drop table worklog5743_2; |
| 487 |
drop table worklog5743_4; |
| 488 |
drop table worklog5743_8; |
| 489 |
-->endsql |
| 490 |
|
| 491 |
-->echo checking warnings with different innodb file format |
| 492 |
-->sql |
| 493 |
use test; |
| 494 |
-->endsql |
| 495 |
|
| 496 |
-->stmtsql set innodb_strict_mode = off; |
| 497 |
-->recvresult |
| 498 |
|
| 499 |
-->stmtsql set global innodb_file_per_table = 0; |
| 500 |
-->recvresult |
| 501 |
|
| 502 |
-->stmtsql create temporary table t (i int) engine = innodb row_format = compressed; |
| 503 |
-->recvresult |
| 504 |
|
| 505 |
-->sql |
| 506 |
##setting back to original value |
| 507 |
drop table t; |
| 508 |
set innodb_strict_mode = on; |
| 509 |
set @@global.innodb_file_per_table = 1; |
| 510 |
-->endsql |
| 511 |
|
| 512 |
-->echo checking warnings with different innodb row format |
| 513 |
-->sql |
| 514 |
use test; |
| 515 |
-->endsql |
| 516 |
|
| 517 |
-->echo expect one Error and Warning |
| 518 |
-->echo modify the result file once Bug#21524666 is fixed |
| 519 |
-->stmtsql create table t2 (id int primary key) engine = innodb key_block_size = 9; |
| 520 |
-->expecterror 1031 |
| 521 |
-->recvresult |
| 522 |
|
| 523 |
-->echo expect 2 warnings and 1 Error |
| 524 |
-->echo modify the result file once Bug#21524666 is fixed |
| 525 |
-->stmtsql create table t2 (id int primary key) engine = innodb key_block_size = 9 row_format = redundant; |
| 526 |
-->expecterror 1031 |
| 527 |
-->recvresult |
| 528 |
|
| 529 |
-->echo expect 1 warning and 2 Error |
| 530 |
-->echo modify the result file once Bug#21524666 is fixed |
| 531 |
-->stmtsql create table bug46000(`id` int, key `GEN_clust_INDEX`(`id`))engine=innodb; |
| 532 |
-->expecterror 1280 |
| 533 |
-->recvresult |
| 534 |
|
| 535 |
## Try to disable fixed notice, should produce an error |
| 536 |
|
| 537 |
-->stmtadmin disable_notices {"notice":"account_expired"} |
| 538 |
-->expecterror 5164 |
| 539 |
-->recvresult |
| 540 |
|
| 541 |
EOF |
| 542 |
|
| 543 |
--let $xtest_warnings= $MYSQL_TMP_DIR/stmtexecute_proc_warnings_mysqlx.xpl |
| 544 |
--write_file $xtest_warnings |
| 545 |
-->quiet |
| 546 |
-->stmtadmin disable_notices {"notice":"warnings"} |
| 547 |
-->recvresult |
| 548 |
-->echo checking warnings with procedure execution |
| 549 |
-->sql |
| 550 |
SET @start_global_value = @@global.max_error_count; |
| 551 |
SELECT @start_global_value; |
| 552 |
SET @start_session_value = @@session.max_error_count; |
| 553 |
SELECT @start_session_value; |
| 554 |
drop database if exists demo; |
| 555 |
create database demo; |
| 556 |
use demo; |
| 557 |
delimiter // |
| 558 |
create procedure proc_1() |
| 559 |
begin |
| 560 |
declare exit handler for sqlexception |
| 561 |
resignal sqlstate '45000' set message_text='Oops in proc_1'; |
| 562 |
call proc_2(); |
| 563 |
end// |
| 564 |
|
| 565 |
delimiter // |
| 566 |
create procedure proc_2() |
| 567 |
begin |
| 568 |
declare exit handler for sqlexception |
| 569 |
resignal sqlstate '45000' set message_text='Oops in proc_2'; |
| 570 |
call proc_3(); |
| 571 |
end// |
| 572 |
|
| 573 |
delimiter // |
| 574 |
create procedure proc_3() |
| 575 |
begin |
| 576 |
declare exit handler for sqlexception |
| 577 |
resignal sqlstate '45000' set message_text='Oops in proc_3'; |
| 578 |
call proc_4(); |
| 579 |
end// |
| 580 |
|
| 581 |
delimiter // |
| 582 |
create procedure proc_4() |
| 583 |
begin |
| 584 |
declare exit handler for sqlexception |
| 585 |
resignal sqlstate '45000' set message_text='Oops in proc_4'; |
| 586 |
call proc_5(); |
| 587 |
end// |
| 588 |
|
| 589 |
delimiter // |
| 590 |
create procedure proc_5() |
| 591 |
begin |
| 592 |
declare exit handler for sqlexception |
| 593 |
resignal sqlstate '45000' set message_text='Oops in proc_5'; |
| 594 |
call proc_6(); |
| 595 |
end// |
| 596 |
|
| 597 |
delimiter // |
| 598 |
create procedure proc_6() |
| 599 |
begin |
| 600 |
declare exit handler for sqlexception |
| 601 |
resignal sqlstate '45000' set message_text='Oops in proc_6'; |
| 602 |
call proc_7(); |
| 603 |
end// |
| 604 |
|
| 605 |
delimiter // |
| 606 |
create procedure proc_7() |
| 607 |
begin |
| 608 |
declare exit handler for sqlexception |
| 609 |
resignal sqlstate '45000' set message_text='Oops in proc_7'; |
| 610 |
call proc_8(); |
| 611 |
end// |
| 612 |
|
| 613 |
delimiter // |
| 614 |
create procedure proc_8() |
| 615 |
begin |
| 616 |
declare exit handler for sqlexception |
| 617 |
resignal sqlstate '45000' set message_text='Oops in proc_8'; |
| 618 |
call proc_9(); |
| 619 |
end// |
| 620 |
|
| 621 |
delimiter // |
| 622 |
create procedure proc_9() |
| 623 |
begin |
| 624 |
declare exit handler for sqlexception |
| 625 |
resignal sqlstate '45000' set message_text='Oops in proc_9'; |
| 626 |
## Do something that fails, to see how errors are reported |
| 627 |
drop table oops_it_is_not_here; |
| 628 |
end// |
| 629 |
|
| 630 |
-->endsql |
| 631 |
|
| 632 |
-->stmtsql call proc_1(); |
| 633 |
-->expecterror 1644 |
| 634 |
-->recvresult |
| 635 |
|
| 636 |
-->sql |
| 637 |
SET @@session.max_error_count = 5; |
| 638 |
SELECT @@session.max_error_count; |
| 639 |
-->endsql |
| 640 |
|
| 641 |
-->stmtsql call proc_1(); |
| 642 |
-->expecterror 1644 |
| 643 |
-->recvresult |
| 644 |
|
| 645 |
-->sql |
| 646 |
SET @@session.max_error_count = 7; |
| 647 |
SELECT @@session.max_error_count; |
| 648 |
-->endsql |
| 649 |
|
| 650 |
-->stmtsql call proc_1(); |
| 651 |
-->expecterror 1644 |
| 652 |
-->recvresult |
| 653 |
|
| 654 |
-->sql |
| 655 |
SET @@session.max_error_count = 9; |
| 656 |
SELECT @@session.max_error_count; |
| 657 |
-->endsql |
| 658 |
|
| 659 |
-->stmtsql call proc_1(); |
| 660 |
-->expecterror 1644 |
| 661 |
-->recvresult |
| 662 |
|
| 663 |
-->sql |
| 664 |
drop database demo; |
| 665 |
SET @@global.max_error_count = @start_global_value; |
| 666 |
SELECT @@global.max_error_count; |
| 667 |
SET @@session.max_error_count = @start_session_value; |
| 668 |
SELECT @@session.max_error_count; |
| 669 |
-->endsql |
| 670 |
|
| 671 |
-->echo checking warnings while creating index with more than row size |
| 672 |
-->sql |
| 673 |
use test; |
| 674 |
create table worklog5743_1(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=1; |
| 675 |
create table worklog5743_2(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=2; |
| 676 |
create table worklog5743_4(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=4; |
| 677 |
create table worklog5743_8(a1 int, a2 TEXT, a3 TEXT) KEY_BLOCK_SIZE=8; |
| 678 |
-->endsql |
| 679 |
|
| 680 |
-->echo below statement throwing warning as an Error and actual error is missing |
| 681 |
-->echo Change result file once Bug#21529270 fixed |
| 682 |
-->stmtsql create index idx1 on worklog5743_1(a2(4000)); |
| 683 |
-->expecterror 1071 |
| 684 |
-->recvresult |
| 685 |
|
| 686 |
|
| 687 |
-->sql |
| 688 |
##setting back to original value |
| 689 |
drop table worklog5743_1; |
| 690 |
drop table worklog5743_2; |
| 691 |
drop table worklog5743_4; |
| 692 |
drop table worklog5743_8; |
| 693 |
-->endsql |
| 694 |
|
| 695 |
EOF |
| 696 |
|
| 697 |
--let $xtest_readonly = $MYSQL_TMP_DIR/disable_notices_readonly.xpl |
| 698 |
--write_file $xtest_readonly |
| 699 |
-->quiet |
| 700 |
-->echo Try Disable warnings |
| 701 |
-->stmtadmin disable_notices {"notice":"warnings"} |
| 702 |
-->recvresult |
| 703 |
|
| 704 |
-->echo Try Disable account_expired |
| 705 |
-->stmtadmin disable_notices {"notice":"account_expired"} |
| 706 |
-->expecterror 5164 |
| 707 |
-->recvresult |
| 708 |
|
| 709 |
-->echo Try Disable generated_insert_id |
| 710 |
-->stmtadmin disable_notices {"notice":"generated_insert_id"} |
| 711 |
-->expecterror 5164 |
| 712 |
-->recvresult |
| 713 |
|
| 714 |
-->echo Try Disable rows_affected |
| 715 |
-->stmtadmin disable_notices {"notice":"rows_affected"} |
| 716 |
-->expecterror 5164 |
| 717 |
-->recvresult |
| 718 |
|
| 719 |
-->echo Try Disable produced_message |
| 720 |
-->stmtadmin disable_notices {"notice":"produced_message"} |
| 721 |
-->expecterror 5164 |
| 722 |
-->recvresult |
| 723 |
|
| 724 |
-->echo expect Mysqlx_stmt_disable_notices=5 and remaining are 0 |
| 725 |
-->sql |
| 726 |
show status like 'Mysqlx%notice%'; |
| 727 |
-->endsql |
| 728 |
|
| 729 |
EOF |
| 730 |
|
| 731 |
--let $xtest_notices= $MYSQL_TMP_DIR/disable_multiple_notices_mysqlx.xpl |
| 732 |
--write_file $xtest_notices |
| 733 |
-->quiet |
| 734 |
-->echo Disable multiple notices both read-only and read-write with single StmtExecute,expect error from the first error is sees |
| 735 |
-->echo expect error from account_expired onwards as it is read-only though warnings returns success as it is rea-write |
| 736 |
-->stmtadmin disable_notices {"notice":["warnings","account_expired","generated_insert_id","rows_affected","produced_message"]} |
| 737 |
-->expecterror 5164 |
| 738 |
-->recvresult |
| 739 |
|
| 740 |
-->stmtadmin list_notices |
| 741 |
-->recvresult |
| 742 |
|
| 743 |
-->echo expect error as disabling account_expired returns error as expected since it is read-ony |
| 744 |
-->stmtadmin disable_notices {"notice":["account_expired","warnings","generated_insert_id","rows_affected","produced_message"]} |
| 745 |
-->expecterror 5164 |
| 746 |
-->recvresult |
| 747 |
|
| 748 |
-->stmtadmin list_notices |
| 749 |
-->recvresult |
| 750 |
|
| 751 |
EOF |
| 752 |
|
| 753 |
--let $xtest_disable= $MYSQL_TMP_DIR/stats_disablenoti_mysqlx.xpl |
| 754 |
--write_file $xtest_disable |
| 755 |
-->quiet |
| 756 |
-->echo Disable warnings notice and observe stats |
| 757 |
-->stmtadmin disable_notices {"notice":"warnings"} |
| 758 |
-->recvresult |
| 759 |
|
| 760 |
-->echo expect Mysqlx_notice_other_sent=0,Mysqlx_stmt_disable_notices=1 with xconnection |
| 761 |
-->sql |
| 762 |
show status like 'Mysqlx%notice%'; |
| 763 |
-->endsql |
| 764 |
|
| 765 |
-->echo Disable account_expired notice and observe stats |
| 766 |
-->stmtadmin disable_notices {"notice":"account_expired"} |
| 767 |
-->expecterror 5164 |
| 768 |
-->recvresult |
| 769 |
|
| 770 |
-->echo expect Mysqlx_notice_other_sent=0,Mysqlx_stmt_disable_notices=2 with xconnection |
| 771 |
-->sql |
| 772 |
show status like 'Mysqlx%notice%'; |
| 773 |
-->endsql |
| 774 |
|
| 775 |
EOF |
| 776 |
|
| 777 |
--exec $MYSQLXTEST -ux_root --password='' --file=$xtest_result 2>&1 |
| 778 |
|
| 779 |
###expect notice %s cannot be disabled related error,change result file once it is fixed |
| 780 |
--exec $MYSQLXTEST -ux_root --password='' --file=$xtest_readonly 2>&1 |
| 781 |
|
| 782 |
###expect notice %s cannot be disabled related error ,change result file once it is fixed with normal user |
| 783 |
create user xplugin@localhost identified by 'xplugin'; |
| 784 |
--exec $MYSQLXTEST -uxplugin --password='xplugin' --file=$xtest_readonly 2>&1 |
| 785 |
|
| 786 |
##change result file once Bug#21611216 is fixed |
| 787 |
--exec $MYSQLXTEST -ux_root --password='' --file=$xtest_warnings 2>&1 |
| 788 |
|
| 789 |
## Disable multiple notices both read-only and read-write with single StmtExecute,expect error from the first error is sees |
| 790 |
--exec $MYSQLXTEST -ux_root --password='' --file=$xtest_notices 2>&1 |
| 791 |
|
| 792 |
## Cleanup |
| 793 |
drop user xplugin@localhost; |
| 794 |
--source ../include/xplugin_cleanup.inc |