myisam_storedproc_08.result 19.7 KB
Newer Older
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 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122

--source suite/funcs_1/storedproc/load_sp_tb.inc
--------------------------------------------------------------------------------

--source suite/funcs_1/storedproc/cleanup_sp_tb.inc
--------------------------------------------------------------------------------
DROP DATABASE IF EXISTS db_storedproc;
DROP DATABASE IF EXISTS db_storedproc_1;
CREATE DATABASE db_storedproc;
CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t7;
Warnings:
Warning	1265	Data truncated for column 'f3' at row 1
Warning	1265	Data truncated for column 'f3' at row 2
Warning	1265	Data truncated for column 'f3' at row 3
Warning	1265	Data truncated for column 'f3' at row 4
Warning	1265	Data truncated for column 'f3' at row 5
Warning	1265	Data truncated for column 'f3' at row 6
Warning	1265	Data truncated for column 'f3' at row 7
Warning	1265	Data truncated for column 'f3' at row 8
Warning	1265	Data truncated for column 'f3' at row 9
Warning	1265	Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t8;
Warnings:
Warning	1265	Data truncated for column 'f3' at row 1
Warning	1265	Data truncated for column 'f3' at row 2
Warning	1265	Data truncated for column 'f3' at row 3
Warning	1265	Data truncated for column 'f3' at row 4
Warning	1265	Data truncated for column 'f3' at row 5
Warning	1265	Data truncated for column 'f3' at row 6
Warning	1265	Data truncated for column 'f3' at row 7
Warning	1265	Data truncated for column 'f3' at row 8
Warning	1265	Data truncated for column 'f3' at row 9
Warning	1265	Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11;

Section 3.1.8 - SHOW statement checks:
--------------------------------------------------------------------------------

Testcase 3.1.8.9:
-----------------

Ensure that all stored procedure changes made with ALTER PROCEDURE or ALTER
FUNCTION are properly recorded and displayed when a SHOW CREATE PROCEDURE or
SHOW CREATE PROCEDURE STATUS statement, or a SHOW CREATE FUNCTION or SHOW CREATE
FUNCTION STATUS statement (respectively) is executed.
--------------------------------------------------------------------------------
DROP FUNCTION IF EXISTS fn_1;
DROP FUNCTION IF EXISTS fn_2;
DROP PROCEDURE IF EXISTS sp_1;
DROP PROCEDURE IF EXISTS sp_2;
CREATE PROCEDURE sp_1 (i1 int)
BEGIN
set @x=i1;
END//
CREATE PROCEDURE sp_2 (i1 int) SQL SECURITY INVOKER COMMENT 'created with INVOKER'
BEGIN
set @x=i1;
END//
CREATE FUNCTION fn_1 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) returns year
BEGIN
set @x=i1;
set @y=@x;
return i4;
END//
CREATE FUNCTION fn_2 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
RETURNS YEAR
SQL SECURITY INVOKER
COMMENT 'created with INVOKER'
BEGIN
set @x=i1;
set @y=@x;
return i4;
END//

... now check what is stored:
-----------------------------
SELECT * FROM information_schema.routines;
SPECIFIC_NAME	fn_1
ROUTINE_CATALOG	NULL
ROUTINE_SCHEMA	db_storedproc
ROUTINE_NAME	fn_1
ROUTINE_TYPE	FUNCTION
DTD_IDENTIFIER	year(4)
ROUTINE_BODY	SQL
ROUTINE_DEFINITION	BEGIN
set @x=i1;
set @y=@x;
return i4;
END
EXTERNAL_NAME	NULL
EXTERNAL_LANGUAGE	NULL
PARAMETER_STYLE	SQL
IS_DETERMINISTIC	NO
SQL_DATA_ACCESS	CONTAINS SQL
SQL_PATH	NULL
SECURITY_TYPE	DEFINER
CREATED	<modified>
LAST_ALTERED	<created>
SQL_MODE	
ROUTINE_COMMENT	
DEFINER	root@localhost
123 124 125
CHARACTER_SET_CLIENT	latin1
COLLATION_CONNECTION	latin1_swedish_ci
DATABASE_COLLATION	latin1_swedish_ci
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
SPECIFIC_NAME	fn_2
ROUTINE_CATALOG	NULL
ROUTINE_SCHEMA	db_storedproc
ROUTINE_NAME	fn_2
ROUTINE_TYPE	FUNCTION
DTD_IDENTIFIER	year(4)
ROUTINE_BODY	SQL
ROUTINE_DEFINITION	BEGIN
set @x=i1;
set @y=@x;
return i4;
END
EXTERNAL_NAME	NULL
EXTERNAL_LANGUAGE	NULL
PARAMETER_STYLE	SQL
IS_DETERMINISTIC	NO
SQL_DATA_ACCESS	CONTAINS SQL
SQL_PATH	NULL
SECURITY_TYPE	INVOKER
CREATED	<modified>
LAST_ALTERED	<created>
SQL_MODE	
ROUTINE_COMMENT	created with INVOKER
DEFINER	root@localhost
150 151 152
CHARACTER_SET_CLIENT	latin1
COLLATION_CONNECTION	latin1_swedish_ci
DATABASE_COLLATION	latin1_swedish_ci
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
SPECIFIC_NAME	sp_1
ROUTINE_CATALOG	NULL
ROUTINE_SCHEMA	db_storedproc
ROUTINE_NAME	sp_1
ROUTINE_TYPE	PROCEDURE
DTD_IDENTIFIER	NULL
ROUTINE_BODY	SQL
ROUTINE_DEFINITION	BEGIN
set @x=i1;
END
EXTERNAL_NAME	NULL
EXTERNAL_LANGUAGE	NULL
PARAMETER_STYLE	SQL
IS_DETERMINISTIC	NO
SQL_DATA_ACCESS	CONTAINS SQL
SQL_PATH	NULL
SECURITY_TYPE	DEFINER
CREATED	<modified>
LAST_ALTERED	<created>
SQL_MODE	
ROUTINE_COMMENT	
DEFINER	root@localhost
175 176 177
CHARACTER_SET_CLIENT	latin1
COLLATION_CONNECTION	latin1_swedish_ci
DATABASE_COLLATION	latin1_swedish_ci
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199
SPECIFIC_NAME	sp_2
ROUTINE_CATALOG	NULL
ROUTINE_SCHEMA	db_storedproc
ROUTINE_NAME	sp_2
ROUTINE_TYPE	PROCEDURE
DTD_IDENTIFIER	NULL
ROUTINE_BODY	SQL
ROUTINE_DEFINITION	BEGIN
set @x=i1;
END
EXTERNAL_NAME	NULL
EXTERNAL_LANGUAGE	NULL
PARAMETER_STYLE	SQL
IS_DETERMINISTIC	NO
SQL_DATA_ACCESS	CONTAINS SQL
SQL_PATH	NULL
SECURITY_TYPE	INVOKER
CREATED	<modified>
LAST_ALTERED	<created>
SQL_MODE	
ROUTINE_COMMENT	created with INVOKER
DEFINER	root@localhost
200 201 202
CHARACTER_SET_CLIENT	latin1
COLLATION_CONNECTION	latin1_swedish_ci
DATABASE_COLLATION	latin1_swedish_ci
203 204 205 206 207 208 209 210 211
SHOW CREATE FUNCTION  fn_1;
Function	fn_1
sql_mode	
Create Function	CREATE DEFINER=`root`@`localhost` FUNCTION `fn_1`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4)
BEGIN
set @x=i1;
set @y=@x;
return i4;
END
212 213 214
character_set_client	latin1
collation_connection	latin1_swedish_ci
Database Collation	latin1_swedish_ci
215 216 217 218 219 220 221 222 223 224 225
SHOW CREATE FUNCTION  fn_2;
Function	fn_2
sql_mode	
Create Function	CREATE DEFINER=`root`@`localhost` FUNCTION `fn_2`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4)
    SQL SECURITY INVOKER
    COMMENT 'created with INVOKER'
BEGIN
set @x=i1;
set @y=@x;
return i4;
END
226 227 228
character_set_client	latin1
collation_connection	latin1_swedish_ci
Database Collation	latin1_swedish_ci
229 230 231 232 233 234 235
SHOW CREATE PROCEDURE sp_1;
Procedure	sp_1
sql_mode	
Create Procedure	CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_1`(i1 int)
BEGIN
set @x=i1;
END
236 237 238
character_set_client	latin1
collation_connection	latin1_swedish_ci
Database Collation	latin1_swedish_ci
239 240 241 242 243 244 245 246 247
SHOW CREATE PROCEDURE sp_2;
Procedure	sp_2
sql_mode	
Create Procedure	CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
    SQL SECURITY INVOKER
    COMMENT 'created with INVOKER'
BEGIN
set @x=i1;
END
248 249 250
character_set_client	latin1
collation_connection	latin1_swedish_ci
Database Collation	latin1_swedish_ci
251 252 253 254 255 256 257 258 259
SHOW FUNCTION STATUS LIKE 'fn_%';
Db	db_storedproc
Name	fn_1
Type	FUNCTION
Definer	root@localhost
Modified	<modified>
Created	<created>
Security_type	DEFINER
Comment	
260 261 262
character_set_client	latin1
collation_connection	latin1_swedish_ci
Database Collation	latin1_swedish_ci
263 264 265 266 267 268 269 270
Db	db_storedproc
Name	fn_2
Type	FUNCTION
Definer	root@localhost
Modified	<modified>
Created	<created>
Security_type	INVOKER
Comment	created with INVOKER
271 272 273
character_set_client	latin1
collation_connection	latin1_swedish_ci
Database Collation	latin1_swedish_ci
274 275 276 277 278 279 280 281 282
SHOW PROCEDURE STATUS LIKE 'sp_%';
Db	db_storedproc
Name	sp_1
Type	PROCEDURE
Definer	root@localhost
Modified	<modified>
Created	<created>
Security_type	DEFINER
Comment	
283 284 285
character_set_client	latin1
collation_connection	latin1_swedish_ci
Database Collation	latin1_swedish_ci
286 287 288 289 290 291 292 293
Db	db_storedproc
Name	sp_2
Type	PROCEDURE
Definer	root@localhost
Modified	<modified>
Created	<created>
Security_type	INVOKER
Comment	created with INVOKER
294 295 296
character_set_client	latin1
collation_connection	latin1_swedish_ci
Database Collation	latin1_swedish_ci
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340

... now change some stuff:
--------------------------
ALTER PROCEDURE sp_1 SQL SECURITY INVOKER;
ALTER PROCEDURE sp_1 COMMENT 'new comment, SP changed to INVOKER';
ALTER PROCEDURE sp_2 SQL SECURITY DEFINER;
ALTER PROCEDURE sp_2 DROP COMMENT;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DROP COMMENT' at line 1
ALTER PROCEDURE sp_2 COMMENT 'SP changed to DEFINER';
ALTER PROCEDURE sp_2 READS SQL DATA;
ALTER FUNCTION  fn_1 SQL SECURITY INVOKER;
ALTER FUNCTION  fn_1 COMMENT 'new comment, FN changed to INVOKER';
ALTER FUNCTION  fn_1 NO SQL;
ALTER FUNCTION  fn_2 SQL SECURITY DEFINER;
ALTER FUNCTION  fn_2 COMMENT 'FN changed to DEFINER';
ALTER FUNCTION  fn_2 MODIFIES SQL DATA;

... now check what is stored:
-----------------------------
SELECT * FROM information_schema.routines;
SPECIFIC_NAME	fn_1
ROUTINE_CATALOG	NULL
ROUTINE_SCHEMA	db_storedproc
ROUTINE_NAME	fn_1
ROUTINE_TYPE	FUNCTION
DTD_IDENTIFIER	year(4)
ROUTINE_BODY	SQL
ROUTINE_DEFINITION	BEGIN
set @x=i1;
set @y=@x;
return i4;
END
EXTERNAL_NAME	NULL
EXTERNAL_LANGUAGE	NULL
PARAMETER_STYLE	SQL
IS_DETERMINISTIC	NO
SQL_DATA_ACCESS	NO SQL
SQL_PATH	NULL
SECURITY_TYPE	INVOKER
CREATED	<modified>
LAST_ALTERED	<created>
SQL_MODE	
ROUTINE_COMMENT	new comment, FN changed to INVOKER
DEFINER	root@localhost
341 342 343
CHARACTER_SET_CLIENT	latin1
COLLATION_CONNECTION	latin1_swedish_ci
DATABASE_COLLATION	latin1_swedish_ci
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367
SPECIFIC_NAME	fn_2
ROUTINE_CATALOG	NULL
ROUTINE_SCHEMA	db_storedproc
ROUTINE_NAME	fn_2
ROUTINE_TYPE	FUNCTION
DTD_IDENTIFIER	year(4)
ROUTINE_BODY	SQL
ROUTINE_DEFINITION	BEGIN
set @x=i1;
set @y=@x;
return i4;
END
EXTERNAL_NAME	NULL
EXTERNAL_LANGUAGE	NULL
PARAMETER_STYLE	SQL
IS_DETERMINISTIC	NO
SQL_DATA_ACCESS	MODIFIES SQL DATA
SQL_PATH	NULL
SECURITY_TYPE	DEFINER
CREATED	<modified>
LAST_ALTERED	<created>
SQL_MODE	
ROUTINE_COMMENT	FN changed to DEFINER
DEFINER	root@localhost
368 369 370
CHARACTER_SET_CLIENT	latin1
COLLATION_CONNECTION	latin1_swedish_ci
DATABASE_COLLATION	latin1_swedish_ci
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392
SPECIFIC_NAME	sp_1
ROUTINE_CATALOG	NULL
ROUTINE_SCHEMA	db_storedproc
ROUTINE_NAME	sp_1
ROUTINE_TYPE	PROCEDURE
DTD_IDENTIFIER	NULL
ROUTINE_BODY	SQL
ROUTINE_DEFINITION	BEGIN
set @x=i1;
END
EXTERNAL_NAME	NULL
EXTERNAL_LANGUAGE	NULL
PARAMETER_STYLE	SQL
IS_DETERMINISTIC	NO
SQL_DATA_ACCESS	CONTAINS SQL
SQL_PATH	NULL
SECURITY_TYPE	INVOKER
CREATED	<modified>
LAST_ALTERED	<created>
SQL_MODE	
ROUTINE_COMMENT	new comment, SP changed to INVOKER
DEFINER	root@localhost
393 394 395
CHARACTER_SET_CLIENT	latin1
COLLATION_CONNECTION	latin1_swedish_ci
DATABASE_COLLATION	latin1_swedish_ci
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417
SPECIFIC_NAME	sp_2
ROUTINE_CATALOG	NULL
ROUTINE_SCHEMA	db_storedproc
ROUTINE_NAME	sp_2
ROUTINE_TYPE	PROCEDURE
DTD_IDENTIFIER	NULL
ROUTINE_BODY	SQL
ROUTINE_DEFINITION	BEGIN
set @x=i1;
END
EXTERNAL_NAME	NULL
EXTERNAL_LANGUAGE	NULL
PARAMETER_STYLE	SQL
IS_DETERMINISTIC	NO
SQL_DATA_ACCESS	READS SQL DATA
SQL_PATH	NULL
SECURITY_TYPE	DEFINER
CREATED	<modified>
LAST_ALTERED	<created>
SQL_MODE	
ROUTINE_COMMENT	SP changed to DEFINER
DEFINER	root@localhost
418 419 420
CHARACTER_SET_CLIENT	latin1
COLLATION_CONNECTION	latin1_swedish_ci
DATABASE_COLLATION	latin1_swedish_ci
421 422 423 424 425 426 427 428 429 430 431 432
SHOW CREATE FUNCTION  fn_1;
Function	fn_1
sql_mode	
Create Function	CREATE DEFINER=`root`@`localhost` FUNCTION `fn_1`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4)
    NO SQL
    SQL SECURITY INVOKER
    COMMENT 'new comment, FN changed to INVOKER'
BEGIN
set @x=i1;
set @y=@x;
return i4;
END
433 434 435
character_set_client	latin1
collation_connection	latin1_swedish_ci
Database Collation	latin1_swedish_ci
436 437 438 439 440 441 442 443 444 445 446
SHOW CREATE FUNCTION  fn_2;
Function	fn_2
sql_mode	
Create Function	CREATE DEFINER=`root`@`localhost` FUNCTION `fn_2`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4)
    MODIFIES SQL DATA
    COMMENT 'FN changed to DEFINER'
BEGIN
set @x=i1;
set @y=@x;
return i4;
END
447 448 449
character_set_client	latin1
collation_connection	latin1_swedish_ci
Database Collation	latin1_swedish_ci
450 451 452 453 454 455 456 457 458
SHOW CREATE PROCEDURE sp_1;
Procedure	sp_1
sql_mode	
Create Procedure	CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_1`(i1 int)
    SQL SECURITY INVOKER
    COMMENT 'new comment, SP changed to INVOKER'
BEGIN
set @x=i1;
END
459 460 461
character_set_client	latin1
collation_connection	latin1_swedish_ci
Database Collation	latin1_swedish_ci
462 463 464 465 466 467 468 469 470
SHOW CREATE PROCEDURE sp_2;
Procedure	sp_2
sql_mode	
Create Procedure	CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
    READS SQL DATA
    COMMENT 'SP changed to DEFINER'
BEGIN
set @x=i1;
END
471 472 473
character_set_client	latin1
collation_connection	latin1_swedish_ci
Database Collation	latin1_swedish_ci
474 475 476 477 478 479 480 481 482
SHOW FUNCTION STATUS LIKE 'fn_%';
Db	db_storedproc
Name	fn_1
Type	FUNCTION
Definer	root@localhost
Modified	<modified>
Created	<created>
Security_type	INVOKER
Comment	new comment, FN changed to INVOKER
483 484 485
character_set_client	latin1
collation_connection	latin1_swedish_ci
Database Collation	latin1_swedish_ci
486 487 488 489 490 491 492 493
Db	db_storedproc
Name	fn_2
Type	FUNCTION
Definer	root@localhost
Modified	<modified>
Created	<created>
Security_type	DEFINER
Comment	FN changed to DEFINER
494 495 496
character_set_client	latin1
collation_connection	latin1_swedish_ci
Database Collation	latin1_swedish_ci
497 498 499 500 501 502 503 504 505
SHOW PROCEDURE STATUS LIKE 'sp_%';
Db	db_storedproc
Name	sp_1
Type	PROCEDURE
Definer	root@localhost
Modified	<modified>
Created	<created>
Security_type	INVOKER
Comment	new comment, SP changed to INVOKER
506 507 508
character_set_client	latin1
collation_connection	latin1_swedish_ci
Database Collation	latin1_swedish_ci
509 510 511 512 513 514 515 516
Db	db_storedproc
Name	sp_2
Type	PROCEDURE
Definer	root@localhost
Modified	<modified>
Created	<created>
Security_type	DEFINER
Comment	SP changed to DEFINER
517 518 519
character_set_client	latin1
collation_connection	latin1_swedish_ci
Database Collation	latin1_swedish_ci
520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551

... change back to default and check result:
--------------------------------------------
ALTER FUNCTION  fn_2 CONTAINS SQL;

... now check what is stored:
-----------------------------
SELECT * FROM information_schema.routines;
SPECIFIC_NAME	fn_1
ROUTINE_CATALOG	NULL
ROUTINE_SCHEMA	db_storedproc
ROUTINE_NAME	fn_1
ROUTINE_TYPE	FUNCTION
DTD_IDENTIFIER	year(4)
ROUTINE_BODY	SQL
ROUTINE_DEFINITION	BEGIN
set @x=i1;
set @y=@x;
return i4;
END
EXTERNAL_NAME	NULL
EXTERNAL_LANGUAGE	NULL
PARAMETER_STYLE	SQL
IS_DETERMINISTIC	NO
SQL_DATA_ACCESS	NO SQL
SQL_PATH	NULL
SECURITY_TYPE	INVOKER
CREATED	<modified>
LAST_ALTERED	<created>
SQL_MODE	
ROUTINE_COMMENT	new comment, FN changed to INVOKER
DEFINER	root@localhost
552 553 554
CHARACTER_SET_CLIENT	latin1
COLLATION_CONNECTION	latin1_swedish_ci
DATABASE_COLLATION	latin1_swedish_ci
555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578
SPECIFIC_NAME	fn_2
ROUTINE_CATALOG	NULL
ROUTINE_SCHEMA	db_storedproc
ROUTINE_NAME	fn_2
ROUTINE_TYPE	FUNCTION
DTD_IDENTIFIER	year(4)
ROUTINE_BODY	SQL
ROUTINE_DEFINITION	BEGIN
set @x=i1;
set @y=@x;
return i4;
END
EXTERNAL_NAME	NULL
EXTERNAL_LANGUAGE	NULL
PARAMETER_STYLE	SQL
IS_DETERMINISTIC	NO
SQL_DATA_ACCESS	CONTAINS SQL
SQL_PATH	NULL
SECURITY_TYPE	DEFINER
CREATED	<modified>
LAST_ALTERED	<created>
SQL_MODE	
ROUTINE_COMMENT	FN changed to DEFINER
DEFINER	root@localhost
579 580 581
CHARACTER_SET_CLIENT	latin1
COLLATION_CONNECTION	latin1_swedish_ci
DATABASE_COLLATION	latin1_swedish_ci
582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603
SPECIFIC_NAME	sp_1
ROUTINE_CATALOG	NULL
ROUTINE_SCHEMA	db_storedproc
ROUTINE_NAME	sp_1
ROUTINE_TYPE	PROCEDURE
DTD_IDENTIFIER	NULL
ROUTINE_BODY	SQL
ROUTINE_DEFINITION	BEGIN
set @x=i1;
END
EXTERNAL_NAME	NULL
EXTERNAL_LANGUAGE	NULL
PARAMETER_STYLE	SQL
IS_DETERMINISTIC	NO
SQL_DATA_ACCESS	CONTAINS SQL
SQL_PATH	NULL
SECURITY_TYPE	INVOKER
CREATED	<modified>
LAST_ALTERED	<created>
SQL_MODE	
ROUTINE_COMMENT	new comment, SP changed to INVOKER
DEFINER	root@localhost
604 605 606
CHARACTER_SET_CLIENT	latin1
COLLATION_CONNECTION	latin1_swedish_ci
DATABASE_COLLATION	latin1_swedish_ci
607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628
SPECIFIC_NAME	sp_2
ROUTINE_CATALOG	NULL
ROUTINE_SCHEMA	db_storedproc
ROUTINE_NAME	sp_2
ROUTINE_TYPE	PROCEDURE
DTD_IDENTIFIER	NULL
ROUTINE_BODY	SQL
ROUTINE_DEFINITION	BEGIN
set @x=i1;
END
EXTERNAL_NAME	NULL
EXTERNAL_LANGUAGE	NULL
PARAMETER_STYLE	SQL
IS_DETERMINISTIC	NO
SQL_DATA_ACCESS	READS SQL DATA
SQL_PATH	NULL
SECURITY_TYPE	DEFINER
CREATED	<modified>
LAST_ALTERED	<created>
SQL_MODE	
ROUTINE_COMMENT	SP changed to DEFINER
DEFINER	root@localhost
629 630 631
CHARACTER_SET_CLIENT	latin1
COLLATION_CONNECTION	latin1_swedish_ci
DATABASE_COLLATION	latin1_swedish_ci
632 633 634 635 636 637 638 639 640 641 642 643
SHOW CREATE FUNCTION  fn_1;
Function	fn_1
sql_mode	
Create Function	CREATE DEFINER=`root`@`localhost` FUNCTION `fn_1`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4)
    NO SQL
    SQL SECURITY INVOKER
    COMMENT 'new comment, FN changed to INVOKER'
BEGIN
set @x=i1;
set @y=@x;
return i4;
END
644 645 646
character_set_client	latin1
collation_connection	latin1_swedish_ci
Database Collation	latin1_swedish_ci
647 648 649 650 651 652 653 654 655 656
SHOW CREATE FUNCTION  fn_2;
Function	fn_2
sql_mode	
Create Function	CREATE DEFINER=`root`@`localhost` FUNCTION `fn_2`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4)
    COMMENT 'FN changed to DEFINER'
BEGIN
set @x=i1;
set @y=@x;
return i4;
END
657 658 659
character_set_client	latin1
collation_connection	latin1_swedish_ci
Database Collation	latin1_swedish_ci
660 661 662 663 664 665 666 667 668
SHOW CREATE PROCEDURE sp_1;
Procedure	sp_1
sql_mode	
Create Procedure	CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_1`(i1 int)
    SQL SECURITY INVOKER
    COMMENT 'new comment, SP changed to INVOKER'
BEGIN
set @x=i1;
END
669 670 671
character_set_client	latin1
collation_connection	latin1_swedish_ci
Database Collation	latin1_swedish_ci
672 673 674 675 676 677 678 679 680
SHOW CREATE PROCEDURE sp_2;
Procedure	sp_2
sql_mode	
Create Procedure	CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
    READS SQL DATA
    COMMENT 'SP changed to DEFINER'
BEGIN
set @x=i1;
END
681 682 683
character_set_client	latin1
collation_connection	latin1_swedish_ci
Database Collation	latin1_swedish_ci
684 685 686 687 688 689 690 691 692
SHOW FUNCTION STATUS LIKE 'fn_%';
Db	db_storedproc
Name	fn_1
Type	FUNCTION
Definer	root@localhost
Modified	<modified>
Created	<created>
Security_type	INVOKER
Comment	new comment, FN changed to INVOKER
693 694 695
character_set_client	latin1
collation_connection	latin1_swedish_ci
Database Collation	latin1_swedish_ci
696 697 698 699 700 701 702 703
Db	db_storedproc
Name	fn_2
Type	FUNCTION
Definer	root@localhost
Modified	<modified>
Created	<created>
Security_type	DEFINER
Comment	FN changed to DEFINER
704 705 706
character_set_client	latin1
collation_connection	latin1_swedish_ci
Database Collation	latin1_swedish_ci
707 708 709 710 711 712 713 714 715
SHOW PROCEDURE STATUS LIKE 'sp_%';
Db	db_storedproc
Name	sp_1
Type	PROCEDURE
Definer	root@localhost
Modified	<modified>
Created	<created>
Security_type	INVOKER
Comment	new comment, SP changed to INVOKER
716 717 718
character_set_client	latin1
collation_connection	latin1_swedish_ci
Database Collation	latin1_swedish_ci
719 720 721 722 723 724 725 726
Db	db_storedproc
Name	sp_2
Type	PROCEDURE
Definer	root@localhost
Modified	<modified>
Created	<created>
Security_type	DEFINER
Comment	SP changed to DEFINER
727 728 729
character_set_client	latin1
collation_connection	latin1_swedish_ci
Database Collation	latin1_swedish_ci
730 731 732 733 734 735 736 737 738 739 740 741 742 743

... cleanup
-----------
DROP FUNCTION fn_1;
DROP FUNCTION fn_2;
DROP PROCEDURE sp_1;

--source suite/funcs_1/storedproc/cleanup_sp_tb.inc
--------------------------------------------------------------------------------
DROP DATABASE IF EXISTS db_storedproc;
DROP DATABASE IF EXISTS db_storedproc_1;

.                               +++ END OF SCRIPT +++
--------------------------------------------------------------------------------