1CREATE TABLE t (c1 INT, 2c2 DATE, 3c3 VARCHAR(128)); 4# Creating procedures 5CREATE PROCEDURE proc() 6BEGIN 7INSERT INTO t VALUES (1, '2015-07-06', 'abc'); 8INSERT INTO t VALUES (2, '2015-07-07', 'def'); 9INSERT INTO t VALUES (3, '2015-07-08', 'ijk'); 10INSERT INTO t VALUES (4, '2015-07-09', 'lmn'); 11INSERT INTO t VALUES (5, '2015-07-10', 'opq'); 12END | 13CREATE PROCEDURE sp_no_results() 14BEGIN 15END| 16CREATE PROCEDURE sp_one_result() 17BEGIN 18select 1; 19END| 20CREATE PROCEDURE sp_two_results() 21BEGIN 22select 1; 23select 2; 24END| 25CREATE PROCEDURE sp_no_results_out(OUT a int) 26BEGIN 27set a=123; 28END| 29CREATE PROCEDURE sp_one_result_out(OUT a int) 30BEGIN 31set a=234; 32select 1; 33END| 34CREATE PROCEDURE sp_two_results_out(OUT a int) 35BEGIN 36set a=456; 37select 1; 38select 2; 39END| 40CREATE PROCEDURE sp_with_error() 41BEGIN 42show tables from `invalid`; 43END| 44CREATE PROCEDURE sp_result_error() 45BEGIN 46select 5; 47show tables from `invalid`; 48END| 49# Creating a function 50CREATE FUNCTION avg_func(n1 INT, n2 INT) RETURNS INT 51DETERMINISTIC 52BEGIN 53DECLARE avg INT; 54SET avg = (n1 + n2)/2; 55RETURN avg; 56END | 57########################################## 58# Run plugin 59########################################## 60INSTALL PLUGIN test_sql_stored_procedures_functions SONAME 'TEST_SQL_STORED_PROCEDURES_FUNCTIONS'; 61########################################## 62# Stop plugin 63########################################## 64UNINSTALL PLUGIN test_sql_stored_procedures_functions; 65########################################## 66# Plugin log 67########################################## 68======================================================================== 69Test in a server thread 70[srv_session_open] 71------------------------------------------------------------------ 72EXECUTING:[35][SELECT 'first complex command' as a] 73[CS_TEXT_REPRESENTATION] 74 [meta] rows: 1 75 [meta] cols: 1 76 [meta] server status: 2 77 [meta] server status: AUTOCOMMIT 78 [meta] warning count: 0 79 80 [meta][field] db name: 81 [meta][field] table name: 82 [meta][field] org table name: 83 [meta][field] col name: a 84 [meta][field] org col name: 85 [meta][field] length: 63 86 [meta][field] charsetnr: 33 87 [meta][field] flags: 1 (NOT_NULL ) 88 [meta][field] decimals: 31 89 [meta][field] type: VARCHAR (15) 90 91 92 [meta][charset result] number: 33 93 [meta][charset result] name: utf8 94 [meta][charset result] collation: utf8_general_ci 95 [meta][charset result] sort order: 96 97 [data][.a][ 21][first complex command] 98 99 [end] server status: 2 100 [end] server status: AUTOCOMMIT 101 [end] warning count: 0 102 [end] affected rows: 0 103 [end] insert id : 0 104 [end] message: 105[CS_BINARY_REPRESENTATION] 106 [meta] rows: 1 107 [meta] cols: 1 108 [meta] server status: 2 109 [meta] server status: AUTOCOMMIT 110 [meta] warning count: 0 111 112 [meta][field] db name: 113 [meta][field] table name: 114 [meta][field] org table name: 115 [meta][field] col name: a 116 [meta][field] org col name: 117 [meta][field] length: 63 118 [meta][field] charsetnr: 33 119 [meta][field] flags: 1 (NOT_NULL ) 120 [meta][field] decimals: 31 121 [meta][field] type: VARCHAR (15) 122 123 124 [meta][charset result] number: 33 125 [meta][charset result] name: utf8 126 [meta][charset result] collation: utf8_general_ci 127 [meta][charset result] sort order: 128 129 [data][.a][ 21][first complex command] 130 131 [end] server status: 2 132 [end] server status: AUTOCOMMIT 133 [end] warning count: 0 134 [end] affected rows: 0 135 [end] insert id : 0 136 [end] message: 137------------------------------------------------------------------ 138EXECUTING:[COM_INIT_DB][test] 139------------------------------------------------------------------ 140EXECUTING:[16][CALL test.proc()] 141[CS_TEXT_REPRESENTATION] 142 [meta] rows: 0 143 [meta] cols: 0 144 [meta] server status: 0 145 [meta] server status: 146 [meta] warning count: 0 147 148 [meta] no columns 149 150 [meta] no charset 151 152 [data] no rows 153 154 [end] server status: 2 155 [end] server status: AUTOCOMMIT 156 [end] warning count: 0 157 [end] affected rows: 1 158 [end] insert id : 0 159 [end] message: 160------------------------------------------------------------------ 161EXECUTING:[COM_INIT_DB][test] 162------------------------------------------------------------------ 163EXECUTING:[25][CALL test.sp_no_results()] 164[CS_TEXT_REPRESENTATION] 165 [meta] rows: 0 166 [meta] cols: 0 167 [meta] server status: 0 168 [meta] server status: 169 [meta] warning count: 0 170 171 [meta] no columns 172 173 [meta] no charset 174 175 [data] no rows 176 177 [end] server status: 2 178 [end] server status: AUTOCOMMIT 179 [end] warning count: 0 180 [end] affected rows: 0 181 [end] insert id : 0 182 [end] message: 183------------------------------------------------------------------ 184EXECUTING:[COM_INIT_DB][test] 185------------------------------------------------------------------ 186EXECUTING:[25][CALL test.sp_one_result()] 187[CS_TEXT_REPRESENTATION] 188 [meta] rows: 1 189 [meta] cols: 1 190 [meta] server status: 10 191 [meta] server status: AUTOCOMMIT MORE_RESULTS_EXISTS 192 [meta] warning count: 0 193 194 [meta][field] db name: 195 [meta][field] table name: 196 [meta][field] org table name: 197 [meta][field] col name: 1 198 [meta][field] org col name: 199 [meta][field] length: 1 200 [meta][field] charsetnr: 8 201 [meta][field] flags: 129 (NOT_NULL BINARY ) 202 [meta][field] decimals: 0 203 [meta][field] type: LONGLONG (8) 204 205 206 [meta][charset result] number: 33 207 [meta][charset result] name: utf8 208 [meta][charset result] collation: utf8_general_ci 209 [meta][charset result] sort order: 210 211 [data][.1][ 1][1] 212 213 [end] server status: 2 214 [end] server status: AUTOCOMMIT 215 [end] warning count: 0 216 [end] affected rows: 0 217 [end] insert id : 0 218 [end] message: 219------------------------------------------------------------------ 220EXECUTING:[COM_INIT_DB][test] 221------------------------------------------------------------------ 222EXECUTING:[26][CALL test.sp_two_results()] 223[CS_TEXT_REPRESENTATION] 224 [meta] rows: 1 225 [meta] cols: 1 226 [meta] server status: 10 227 [meta] server status: AUTOCOMMIT MORE_RESULTS_EXISTS 228 [meta] warning count: 0 229 230 [meta][field] db name: 231 [meta][field] table name: 232 [meta][field] org table name: 233 [meta][field] col name: 2 234 [meta][field] org col name: 235 [meta][field] length: 1 236 [meta][field] charsetnr: 8 237 [meta][field] flags: 129 (NOT_NULL BINARY ) 238 [meta][field] decimals: 0 239 [meta][field] type: LONGLONG (8) 240 241 242 [meta][charset result] number: 33 243 [meta][charset result] name: utf8 244 [meta][charset result] collation: utf8_general_ci 245 [meta][charset result] sort order: 246 247 [data][.2][ 1][2] 248 249 [end] server status: 2 250 [end] server status: AUTOCOMMIT 251 [end] warning count: 0 252 [end] affected rows: 0 253 [end] insert id : 0 254 [end] message: 255------------------------------------------------------------------ 256EXECUTING:[COM_INIT_DB][test] 257------------------------------------------------------------------ 258EXECUTING:[31][CALL test.sp_no_results_out(@a)] 259[CS_TEXT_REPRESENTATION] 260 [meta] rows: 0 261 [meta] cols: 0 262 [meta] server status: 0 263 [meta] server status: 264 [meta] warning count: 0 265 266 [meta] no columns 267 268 [meta] no charset 269 270 [data] no rows 271 272 [end] server status: 2 273 [end] server status: AUTOCOMMIT 274 [end] warning count: 0 275 [end] affected rows: 0 276 [end] insert id : 0 277 [end] message: 278------------------------------------------------------------------ 279EXECUTING:[COM_INIT_DB][test] 280------------------------------------------------------------------ 281EXECUTING:[31][CALL test.sp_one_result_out(@a)] 282[CS_TEXT_REPRESENTATION] 283 [meta] rows: 1 284 [meta] cols: 1 285 [meta] server status: 10 286 [meta] server status: AUTOCOMMIT MORE_RESULTS_EXISTS 287 [meta] warning count: 0 288 289 [meta][field] db name: 290 [meta][field] table name: 291 [meta][field] org table name: 292 [meta][field] col name: 1 293 [meta][field] org col name: 294 [meta][field] length: 1 295 [meta][field] charsetnr: 8 296 [meta][field] flags: 129 (NOT_NULL BINARY ) 297 [meta][field] decimals: 0 298 [meta][field] type: LONGLONG (8) 299 300 301 [meta][charset result] number: 33 302 [meta][charset result] name: utf8 303 [meta][charset result] collation: utf8_general_ci 304 [meta][charset result] sort order: 305 306 [data][.1][ 1][1] 307 308 [end] server status: 2 309 [end] server status: AUTOCOMMIT 310 [end] warning count: 0 311 [end] affected rows: 0 312 [end] insert id : 0 313 [end] message: 314------------------------------------------------------------------ 315EXECUTING:[COM_INIT_DB][test] 316------------------------------------------------------------------ 317EXECUTING:[32][CALL test.sp_two_results_out(@a)] 318[CS_TEXT_REPRESENTATION] 319 [meta] rows: 1 320 [meta] cols: 1 321 [meta] server status: 10 322 [meta] server status: AUTOCOMMIT MORE_RESULTS_EXISTS 323 [meta] warning count: 0 324 325 [meta][field] db name: 326 [meta][field] table name: 327 [meta][field] org table name: 328 [meta][field] col name: 2 329 [meta][field] org col name: 330 [meta][field] length: 1 331 [meta][field] charsetnr: 8 332 [meta][field] flags: 129 (NOT_NULL BINARY ) 333 [meta][field] decimals: 0 334 [meta][field] type: LONGLONG (8) 335 336 337 [meta][charset result] number: 33 338 [meta][charset result] name: utf8 339 [meta][charset result] collation: utf8_general_ci 340 [meta][charset result] sort order: 341 342 [data][.2][ 1][2] 343 344 [end] server status: 2 345 [end] server status: AUTOCOMMIT 346 [end] warning count: 0 347 [end] affected rows: 0 348 [end] insert id : 0 349 [end] message: 350------------------------------------------------------------------ 351EXECUTING:[COM_INIT_DB][test] 352------------------------------------------------------------------ 353EXECUTING:[25][CALL test.sp_with_error()] 354[CS_TEXT_REPRESENTATION] 355[1049][42000][Unknown database 'invalid'] 356 [meta] rows: 0 357 [meta] cols: 0 358 [meta] server status: 0 359 [meta] server status: 360 [meta] warning count: 0 361 362 [meta] no columns 363 364 [meta] no charset 365 366 [data] no rows 367 368 [end] server status: 0 369 [end] server status: 370 [end] warning count: 0 371 [end] affected rows: 0 372 [end] insert id : 0 373 [end] message: 374[CS_BINARY_REPRESENTATION] 375[1049][42000][Unknown database 'invalid'] 376 [meta] rows: 0 377 [meta] cols: 0 378 [meta] server status: 0 379 [meta] server status: 380 [meta] warning count: 0 381 382 [meta] no columns 383 384 [meta] no charset 385 386 [data] no rows 387 388 [end] server status: 0 389 [end] server status: 390 [end] warning count: 0 391 [end] affected rows: 0 392 [end] insert id : 0 393 [end] message: 394------------------------------------------------------------------ 395EXECUTING:[COM_INIT_DB][test] 396------------------------------------------------------------------ 397EXECUTING:[27][CALL test.sp_result_error()] 398[CS_TEXT_REPRESENTATION] 399[1049][42000][Unknown database 'invalid'] 400 [meta] rows: 0 401 [meta] cols: 1 402 [meta] server status: 10 403 [meta] server status: AUTOCOMMIT MORE_RESULTS_EXISTS 404 [meta] warning count: 0 405 406 [meta][field] db name: 407 [meta][field] table name: 408 [meta][field] org table name: 409 [meta][field] col name: 5 410 [meta][field] org col name: 411 [meta][field] length: 1 412 [meta][field] charsetnr: 8 413 [meta][field] flags: 129 (NOT_NULL BINARY ) 414 [meta][field] decimals: 0 415 [meta][field] type: LONGLONG (8) 416 417 418 [meta][charset result] number: 33 419 [meta][charset result] name: utf8 420 [meta][charset result] collation: utf8_general_ci 421 [meta][charset result] sort order: 422 423 [data] no rows 424 425 [end] server status: 10 426 [end] server status: AUTOCOMMIT MORE_RESULTS_EXISTS 427 [end] warning count: 0 428 [end] affected rows: 0 429 [end] insert id : 0 430 [end] message: 431[CS_BINARY_REPRESENTATION] 432[1049][42000][Unknown database 'invalid'] 433 [meta] rows: 0 434 [meta] cols: 1 435 [meta] server status: 10 436 [meta] server status: AUTOCOMMIT MORE_RESULTS_EXISTS 437 [meta] warning count: 0 438 439 [meta][field] db name: 440 [meta][field] table name: 441 [meta][field] org table name: 442 [meta][field] col name: 5 443 [meta][field] org col name: 444 [meta][field] length: 1 445 [meta][field] charsetnr: 8 446 [meta][field] flags: 129 (NOT_NULL BINARY ) 447 [meta][field] decimals: 0 448 [meta][field] type: LONGLONG (8) 449 450 451 [meta][charset result] number: 33 452 [meta][charset result] name: utf8 453 [meta][charset result] collation: utf8_general_ci 454 [meta][charset result] sort order: 455 456 [data] no rows 457 458 [end] server status: 10 459 [end] server status: AUTOCOMMIT MORE_RESULTS_EXISTS 460 [end] warning count: 0 461 [end] affected rows: 0 462 [end] insert id : 0 463 [end] message: 464------------------------------------------------------------------ 465EXECUTING:[112][SELECT SPECIFIC_NAME FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_TYPE = 'PROCEDURE' AND ROUTINE_NAME = 'proc'] 466[CS_TEXT_REPRESENTATION] 467 [meta] rows: 1 468 [meta] cols: 1 469 [meta] server status: 34 470 [meta] server status: AUTOCOMMIT QUERY_NO_INDEX_USED 471 [meta] warning count: 0 472 473 [meta][field] db name: information_schema 474 [meta][field] table name: ROUTINES 475 [meta][field] org table name: ROUTINES 476 [meta][field] col name: SPECIFIC_NAME 477 [meta][field] org col name: SPECIFIC_NAME 478 [meta][field] length: 192 479 [meta][field] charsetnr: 33 480 [meta][field] flags: 1 (NOT_NULL ) 481 [meta][field] decimals: 0 482 [meta][field] type: VARCHAR (15) 483 484 485 [meta][charset result] number: 33 486 [meta][charset result] name: utf8 487 [meta][charset result] collation: utf8_general_ci 488 [meta][charset result] sort order: 489 490 [data][ROUTINES.SPECIFIC_NAME][ 4][proc] 491 492 [end] server status: 34 493 [end] server status: AUTOCOMMIT QUERY_NO_INDEX_USED 494 [end] warning count: 0 495 [end] affected rows: 0 496 [end] insert id : 0 497 [end] message: 498[CS_BINARY_REPRESENTATION] 499 [meta] rows: 1 500 [meta] cols: 1 501 [meta] server status: 34 502 [meta] server status: AUTOCOMMIT QUERY_NO_INDEX_USED 503 [meta] warning count: 0 504 505 [meta][field] db name: information_schema 506 [meta][field] table name: ROUTINES 507 [meta][field] org table name: ROUTINES 508 [meta][field] col name: SPECIFIC_NAME 509 [meta][field] org col name: SPECIFIC_NAME 510 [meta][field] length: 192 511 [meta][field] charsetnr: 33 512 [meta][field] flags: 1 (NOT_NULL ) 513 [meta][field] decimals: 0 514 [meta][field] type: VARCHAR (15) 515 516 517 [meta][charset result] number: 33 518 [meta][charset result] name: utf8 519 [meta][charset result] collation: utf8_general_ci 520 [meta][charset result] sort order: 521 522 [data][ROUTINES.SPECIFIC_NAME][ 4][proc] 523 524 [end] server status: 34 525 [end] server status: AUTOCOMMIT QUERY_NO_INDEX_USED 526 [end] warning count: 0 527 [end] affected rows: 0 528 [end] insert id : 0 529 [end] message: 530------------------------------------------------------------------ 531EXECUTING:[COM_INIT_DB][test] 532------------------------------------------------------------------ 533EXECUTING:[23][SELECT avg_func(10, 20)] 534[CS_TEXT_REPRESENTATION] 535 [meta] rows: 1 536 [meta] cols: 1 537 [meta] server status: 2 538 [meta] server status: AUTOCOMMIT 539 [meta] warning count: 0 540 541 [meta][field] db name: 542 [meta][field] table name: 543 [meta][field] org table name: 544 [meta][field] col name: avg_func(10, 20) 545 [meta][field] org col name: avg_func(10, 20) 546 [meta][field] length: 11 547 [meta][field] charsetnr: 8 548 [meta][field] flags: 0 549 [meta][field] decimals: 0 550 [meta][field] type: LONG (3) 551 552 553 [meta][charset result] number: 33 554 [meta][charset result] name: utf8 555 [meta][charset result] collation: utf8_general_ci 556 [meta][charset result] sort order: 557 558 [data][.avg_func(10, 20)][ 2][15] 559 560 [end] server status: 2 561 [end] server status: AUTOCOMMIT 562 [end] warning count: 0 563 [end] affected rows: 0 564 [end] insert id : 0 565 [end] message: 566[CS_BINARY_REPRESENTATION] 567 [meta] rows: 1 568 [meta] cols: 1 569 [meta] server status: 2 570 [meta] server status: AUTOCOMMIT 571 [meta] warning count: 0 572 573 [meta][field] db name: 574 [meta][field] table name: 575 [meta][field] org table name: 576 [meta][field] col name: avg_func(10, 20) 577 [meta][field] org col name: avg_func(10, 20) 578 [meta][field] length: 11 579 [meta][field] charsetnr: 8 580 [meta][field] flags: 0 581 [meta][field] decimals: 0 582 [meta][field] type: LONG (3) 583 584 585 [meta][charset result] number: 33 586 [meta][charset result] name: utf8 587 [meta][charset result] collation: utf8_general_ci 588 [meta][charset result] sort order: 589 590 [data][.avg_func(10, 20)][ 2][15] 591 592 [end] server status: 2 593 [end] server status: AUTOCOMMIT 594 [end] warning count: 0 595 [end] affected rows: 0 596 [end] insert id : 0 597 [end] message: 598------------------------------------------------------------------ 599EXECUTING:[115][SELECT SPECIFIC_NAME FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_TYPE = 'FUNCTION' AND ROUTINE_NAME = 'avg_func'] 600[CS_TEXT_REPRESENTATION] 601 [meta] rows: 1 602 [meta] cols: 1 603 [meta] server status: 34 604 [meta] server status: AUTOCOMMIT QUERY_NO_INDEX_USED 605 [meta] warning count: 0 606 607 [meta][field] db name: information_schema 608 [meta][field] table name: ROUTINES 609 [meta][field] org table name: ROUTINES 610 [meta][field] col name: SPECIFIC_NAME 611 [meta][field] org col name: SPECIFIC_NAME 612 [meta][field] length: 192 613 [meta][field] charsetnr: 33 614 [meta][field] flags: 1 (NOT_NULL ) 615 [meta][field] decimals: 0 616 [meta][field] type: VARCHAR (15) 617 618 619 [meta][charset result] number: 33 620 [meta][charset result] name: utf8 621 [meta][charset result] collation: utf8_general_ci 622 [meta][charset result] sort order: 623 624 [data][ROUTINES.SPECIFIC_NAME][ 8][avg_func] 625 626 [end] server status: 34 627 [end] server status: AUTOCOMMIT QUERY_NO_INDEX_USED 628 [end] warning count: 0 629 [end] affected rows: 0 630 [end] insert id : 0 631 [end] message: 632[CS_BINARY_REPRESENTATION] 633 [meta] rows: 1 634 [meta] cols: 1 635 [meta] server status: 34 636 [meta] server status: AUTOCOMMIT QUERY_NO_INDEX_USED 637 [meta] warning count: 0 638 639 [meta][field] db name: information_schema 640 [meta][field] table name: ROUTINES 641 [meta][field] org table name: ROUTINES 642 [meta][field] col name: SPECIFIC_NAME 643 [meta][field] org col name: SPECIFIC_NAME 644 [meta][field] length: 192 645 [meta][field] charsetnr: 33 646 [meta][field] flags: 1 (NOT_NULL ) 647 [meta][field] decimals: 0 648 [meta][field] type: VARCHAR (15) 649 650 651 [meta][charset result] number: 33 652 [meta][charset result] name: utf8 653 [meta][charset result] collation: utf8_general_ci 654 [meta][charset result] sort order: 655 656 [data][ROUTINES.SPECIFIC_NAME][ 8][avg_func] 657 658 [end] server status: 34 659 [end] server status: AUTOCOMMIT QUERY_NO_INDEX_USED 660 [end] warning count: 0 661 [end] affected rows: 0 662 [end] insert id : 0 663 [end] message: 664------------------------------------------------------------------ 665[srv_session_close] 666Follows threaded run 667======================================================================== 668init thread 669[srv_session_open] 670------------------------------------------------------------------ 671EXECUTING:[35][SELECT 'first complex command' as a] 672[CS_TEXT_REPRESENTATION] 673 [meta] rows: 1 674 [meta] cols: 1 675 [meta] server status: 2 676 [meta] server status: AUTOCOMMIT 677 [meta] warning count: 0 678 679 [meta][field] db name: 680 [meta][field] table name: 681 [meta][field] org table name: 682 [meta][field] col name: a 683 [meta][field] org col name: 684 [meta][field] length: 63 685 [meta][field] charsetnr: 33 686 [meta][field] flags: 1 (NOT_NULL ) 687 [meta][field] decimals: 31 688 [meta][field] type: VARCHAR (15) 689 690 691 [meta][charset result] number: 33 692 [meta][charset result] name: utf8 693 [meta][charset result] collation: utf8_general_ci 694 [meta][charset result] sort order: 695 696 [data][.a][ 21][first complex command] 697 698 [end] server status: 2 699 [end] server status: AUTOCOMMIT 700 [end] warning count: 0 701 [end] affected rows: 0 702 [end] insert id : 0 703 [end] message: 704[CS_BINARY_REPRESENTATION] 705 [meta] rows: 1 706 [meta] cols: 1 707 [meta] server status: 2 708 [meta] server status: AUTOCOMMIT 709 [meta] warning count: 0 710 711 [meta][field] db name: 712 [meta][field] table name: 713 [meta][field] org table name: 714 [meta][field] col name: a 715 [meta][field] org col name: 716 [meta][field] length: 63 717 [meta][field] charsetnr: 33 718 [meta][field] flags: 1 (NOT_NULL ) 719 [meta][field] decimals: 31 720 [meta][field] type: VARCHAR (15) 721 722 723 [meta][charset result] number: 33 724 [meta][charset result] name: utf8 725 [meta][charset result] collation: utf8_general_ci 726 [meta][charset result] sort order: 727 728 [data][.a][ 21][first complex command] 729 730 [end] server status: 2 731 [end] server status: AUTOCOMMIT 732 [end] warning count: 0 733 [end] affected rows: 0 734 [end] insert id : 0 735 [end] message: 736------------------------------------------------------------------ 737EXECUTING:[COM_INIT_DB][test] 738------------------------------------------------------------------ 739EXECUTING:[16][CALL test.proc()] 740[CS_TEXT_REPRESENTATION] 741 [meta] rows: 0 742 [meta] cols: 0 743 [meta] server status: 0 744 [meta] server status: 745 [meta] warning count: 0 746 747 [meta] no columns 748 749 [meta] no charset 750 751 [data] no rows 752 753 [end] server status: 2 754 [end] server status: AUTOCOMMIT 755 [end] warning count: 0 756 [end] affected rows: 1 757 [end] insert id : 0 758 [end] message: 759------------------------------------------------------------------ 760EXECUTING:[COM_INIT_DB][test] 761------------------------------------------------------------------ 762EXECUTING:[25][CALL test.sp_no_results()] 763[CS_TEXT_REPRESENTATION] 764 [meta] rows: 0 765 [meta] cols: 0 766 [meta] server status: 0 767 [meta] server status: 768 [meta] warning count: 0 769 770 [meta] no columns 771 772 [meta] no charset 773 774 [data] no rows 775 776 [end] server status: 2 777 [end] server status: AUTOCOMMIT 778 [end] warning count: 0 779 [end] affected rows: 0 780 [end] insert id : 0 781 [end] message: 782------------------------------------------------------------------ 783EXECUTING:[COM_INIT_DB][test] 784------------------------------------------------------------------ 785EXECUTING:[25][CALL test.sp_one_result()] 786[CS_TEXT_REPRESENTATION] 787 [meta] rows: 1 788 [meta] cols: 1 789 [meta] server status: 10 790 [meta] server status: AUTOCOMMIT MORE_RESULTS_EXISTS 791 [meta] warning count: 0 792 793 [meta][field] db name: 794 [meta][field] table name: 795 [meta][field] org table name: 796 [meta][field] col name: 1 797 [meta][field] org col name: 798 [meta][field] length: 1 799 [meta][field] charsetnr: 8 800 [meta][field] flags: 129 (NOT_NULL BINARY ) 801 [meta][field] decimals: 0 802 [meta][field] type: LONGLONG (8) 803 804 805 [meta][charset result] number: 33 806 [meta][charset result] name: utf8 807 [meta][charset result] collation: utf8_general_ci 808 [meta][charset result] sort order: 809 810 [data][.1][ 1][1] 811 812 [end] server status: 2 813 [end] server status: AUTOCOMMIT 814 [end] warning count: 0 815 [end] affected rows: 0 816 [end] insert id : 0 817 [end] message: 818------------------------------------------------------------------ 819EXECUTING:[COM_INIT_DB][test] 820------------------------------------------------------------------ 821EXECUTING:[26][CALL test.sp_two_results()] 822[CS_TEXT_REPRESENTATION] 823 [meta] rows: 1 824 [meta] cols: 1 825 [meta] server status: 10 826 [meta] server status: AUTOCOMMIT MORE_RESULTS_EXISTS 827 [meta] warning count: 0 828 829 [meta][field] db name: 830 [meta][field] table name: 831 [meta][field] org table name: 832 [meta][field] col name: 2 833 [meta][field] org col name: 834 [meta][field] length: 1 835 [meta][field] charsetnr: 8 836 [meta][field] flags: 129 (NOT_NULL BINARY ) 837 [meta][field] decimals: 0 838 [meta][field] type: LONGLONG (8) 839 840 841 [meta][charset result] number: 33 842 [meta][charset result] name: utf8 843 [meta][charset result] collation: utf8_general_ci 844 [meta][charset result] sort order: 845 846 [data][.2][ 1][2] 847 848 [end] server status: 2 849 [end] server status: AUTOCOMMIT 850 [end] warning count: 0 851 [end] affected rows: 0 852 [end] insert id : 0 853 [end] message: 854------------------------------------------------------------------ 855EXECUTING:[COM_INIT_DB][test] 856------------------------------------------------------------------ 857EXECUTING:[31][CALL test.sp_no_results_out(@a)] 858[CS_TEXT_REPRESENTATION] 859 [meta] rows: 0 860 [meta] cols: 0 861 [meta] server status: 0 862 [meta] server status: 863 [meta] warning count: 0 864 865 [meta] no columns 866 867 [meta] no charset 868 869 [data] no rows 870 871 [end] server status: 2 872 [end] server status: AUTOCOMMIT 873 [end] warning count: 0 874 [end] affected rows: 0 875 [end] insert id : 0 876 [end] message: 877------------------------------------------------------------------ 878EXECUTING:[COM_INIT_DB][test] 879------------------------------------------------------------------ 880EXECUTING:[31][CALL test.sp_one_result_out(@a)] 881[CS_TEXT_REPRESENTATION] 882 [meta] rows: 1 883 [meta] cols: 1 884 [meta] server status: 10 885 [meta] server status: AUTOCOMMIT MORE_RESULTS_EXISTS 886 [meta] warning count: 0 887 888 [meta][field] db name: 889 [meta][field] table name: 890 [meta][field] org table name: 891 [meta][field] col name: 1 892 [meta][field] org col name: 893 [meta][field] length: 1 894 [meta][field] charsetnr: 8 895 [meta][field] flags: 129 (NOT_NULL BINARY ) 896 [meta][field] decimals: 0 897 [meta][field] type: LONGLONG (8) 898 899 900 [meta][charset result] number: 33 901 [meta][charset result] name: utf8 902 [meta][charset result] collation: utf8_general_ci 903 [meta][charset result] sort order: 904 905 [data][.1][ 1][1] 906 907 [end] server status: 2 908 [end] server status: AUTOCOMMIT 909 [end] warning count: 0 910 [end] affected rows: 0 911 [end] insert id : 0 912 [end] message: 913------------------------------------------------------------------ 914EXECUTING:[COM_INIT_DB][test] 915------------------------------------------------------------------ 916EXECUTING:[32][CALL test.sp_two_results_out(@a)] 917[CS_TEXT_REPRESENTATION] 918 [meta] rows: 1 919 [meta] cols: 1 920 [meta] server status: 10 921 [meta] server status: AUTOCOMMIT MORE_RESULTS_EXISTS 922 [meta] warning count: 0 923 924 [meta][field] db name: 925 [meta][field] table name: 926 [meta][field] org table name: 927 [meta][field] col name: 2 928 [meta][field] org col name: 929 [meta][field] length: 1 930 [meta][field] charsetnr: 8 931 [meta][field] flags: 129 (NOT_NULL BINARY ) 932 [meta][field] decimals: 0 933 [meta][field] type: LONGLONG (8) 934 935 936 [meta][charset result] number: 33 937 [meta][charset result] name: utf8 938 [meta][charset result] collation: utf8_general_ci 939 [meta][charset result] sort order: 940 941 [data][.2][ 1][2] 942 943 [end] server status: 2 944 [end] server status: AUTOCOMMIT 945 [end] warning count: 0 946 [end] affected rows: 0 947 [end] insert id : 0 948 [end] message: 949------------------------------------------------------------------ 950EXECUTING:[COM_INIT_DB][test] 951------------------------------------------------------------------ 952EXECUTING:[25][CALL test.sp_with_error()] 953[CS_TEXT_REPRESENTATION] 954[1049][42000][Unknown database 'invalid'] 955 [meta] rows: 0 956 [meta] cols: 0 957 [meta] server status: 0 958 [meta] server status: 959 [meta] warning count: 0 960 961 [meta] no columns 962 963 [meta] no charset 964 965 [data] no rows 966 967 [end] server status: 0 968 [end] server status: 969 [end] warning count: 0 970 [end] affected rows: 0 971 [end] insert id : 0 972 [end] message: 973[CS_BINARY_REPRESENTATION] 974[1049][42000][Unknown database 'invalid'] 975 [meta] rows: 0 976 [meta] cols: 0 977 [meta] server status: 0 978 [meta] server status: 979 [meta] warning count: 0 980 981 [meta] no columns 982 983 [meta] no charset 984 985 [data] no rows 986 987 [end] server status: 0 988 [end] server status: 989 [end] warning count: 0 990 [end] affected rows: 0 991 [end] insert id : 0 992 [end] message: 993------------------------------------------------------------------ 994EXECUTING:[COM_INIT_DB][test] 995------------------------------------------------------------------ 996EXECUTING:[27][CALL test.sp_result_error()] 997[CS_TEXT_REPRESENTATION] 998[1049][42000][Unknown database 'invalid'] 999 [meta] rows: 0 1000 [meta] cols: 1 1001 [meta] server status: 10 1002 [meta] server status: AUTOCOMMIT MORE_RESULTS_EXISTS 1003 [meta] warning count: 0 1004 1005 [meta][field] db name: 1006 [meta][field] table name: 1007 [meta][field] org table name: 1008 [meta][field] col name: 5 1009 [meta][field] org col name: 1010 [meta][field] length: 1 1011 [meta][field] charsetnr: 8 1012 [meta][field] flags: 129 (NOT_NULL BINARY ) 1013 [meta][field] decimals: 0 1014 [meta][field] type: LONGLONG (8) 1015 1016 1017 [meta][charset result] number: 33 1018 [meta][charset result] name: utf8 1019 [meta][charset result] collation: utf8_general_ci 1020 [meta][charset result] sort order: 1021 1022 [data] no rows 1023 1024 [end] server status: 10 1025 [end] server status: AUTOCOMMIT MORE_RESULTS_EXISTS 1026 [end] warning count: 0 1027 [end] affected rows: 0 1028 [end] insert id : 0 1029 [end] message: 1030[CS_BINARY_REPRESENTATION] 1031[1049][42000][Unknown database 'invalid'] 1032 [meta] rows: 0 1033 [meta] cols: 1 1034 [meta] server status: 10 1035 [meta] server status: AUTOCOMMIT MORE_RESULTS_EXISTS 1036 [meta] warning count: 0 1037 1038 [meta][field] db name: 1039 [meta][field] table name: 1040 [meta][field] org table name: 1041 [meta][field] col name: 5 1042 [meta][field] org col name: 1043 [meta][field] length: 1 1044 [meta][field] charsetnr: 8 1045 [meta][field] flags: 129 (NOT_NULL BINARY ) 1046 [meta][field] decimals: 0 1047 [meta][field] type: LONGLONG (8) 1048 1049 1050 [meta][charset result] number: 33 1051 [meta][charset result] name: utf8 1052 [meta][charset result] collation: utf8_general_ci 1053 [meta][charset result] sort order: 1054 1055 [data] no rows 1056 1057 [end] server status: 10 1058 [end] server status: AUTOCOMMIT MORE_RESULTS_EXISTS 1059 [end] warning count: 0 1060 [end] affected rows: 0 1061 [end] insert id : 0 1062 [end] message: 1063------------------------------------------------------------------ 1064EXECUTING:[112][SELECT SPECIFIC_NAME FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_TYPE = 'PROCEDURE' AND ROUTINE_NAME = 'proc'] 1065[CS_TEXT_REPRESENTATION] 1066 [meta] rows: 1 1067 [meta] cols: 1 1068 [meta] server status: 34 1069 [meta] server status: AUTOCOMMIT QUERY_NO_INDEX_USED 1070 [meta] warning count: 0 1071 1072 [meta][field] db name: information_schema 1073 [meta][field] table name: ROUTINES 1074 [meta][field] org table name: ROUTINES 1075 [meta][field] col name: SPECIFIC_NAME 1076 [meta][field] org col name: SPECIFIC_NAME 1077 [meta][field] length: 192 1078 [meta][field] charsetnr: 33 1079 [meta][field] flags: 1 (NOT_NULL ) 1080 [meta][field] decimals: 0 1081 [meta][field] type: VARCHAR (15) 1082 1083 1084 [meta][charset result] number: 33 1085 [meta][charset result] name: utf8 1086 [meta][charset result] collation: utf8_general_ci 1087 [meta][charset result] sort order: 1088 1089 [data][ROUTINES.SPECIFIC_NAME][ 4][proc] 1090 1091 [end] server status: 34 1092 [end] server status: AUTOCOMMIT QUERY_NO_INDEX_USED 1093 [end] warning count: 0 1094 [end] affected rows: 0 1095 [end] insert id : 0 1096 [end] message: 1097[CS_BINARY_REPRESENTATION] 1098 [meta] rows: 1 1099 [meta] cols: 1 1100 [meta] server status: 34 1101 [meta] server status: AUTOCOMMIT QUERY_NO_INDEX_USED 1102 [meta] warning count: 0 1103 1104 [meta][field] db name: information_schema 1105 [meta][field] table name: ROUTINES 1106 [meta][field] org table name: ROUTINES 1107 [meta][field] col name: SPECIFIC_NAME 1108 [meta][field] org col name: SPECIFIC_NAME 1109 [meta][field] length: 192 1110 [meta][field] charsetnr: 33 1111 [meta][field] flags: 1 (NOT_NULL ) 1112 [meta][field] decimals: 0 1113 [meta][field] type: VARCHAR (15) 1114 1115 1116 [meta][charset result] number: 33 1117 [meta][charset result] name: utf8 1118 [meta][charset result] collation: utf8_general_ci 1119 [meta][charset result] sort order: 1120 1121 [data][ROUTINES.SPECIFIC_NAME][ 4][proc] 1122 1123 [end] server status: 34 1124 [end] server status: AUTOCOMMIT QUERY_NO_INDEX_USED 1125 [end] warning count: 0 1126 [end] affected rows: 0 1127 [end] insert id : 0 1128 [end] message: 1129------------------------------------------------------------------ 1130EXECUTING:[COM_INIT_DB][test] 1131------------------------------------------------------------------ 1132EXECUTING:[23][SELECT avg_func(10, 20)] 1133[CS_TEXT_REPRESENTATION] 1134 [meta] rows: 1 1135 [meta] cols: 1 1136 [meta] server status: 2 1137 [meta] server status: AUTOCOMMIT 1138 [meta] warning count: 0 1139 1140 [meta][field] db name: 1141 [meta][field] table name: 1142 [meta][field] org table name: 1143 [meta][field] col name: avg_func(10, 20) 1144 [meta][field] org col name: avg_func(10, 20) 1145 [meta][field] length: 11 1146 [meta][field] charsetnr: 8 1147 [meta][field] flags: 0 1148 [meta][field] decimals: 0 1149 [meta][field] type: LONG (3) 1150 1151 1152 [meta][charset result] number: 33 1153 [meta][charset result] name: utf8 1154 [meta][charset result] collation: utf8_general_ci 1155 [meta][charset result] sort order: 1156 1157 [data][.avg_func(10, 20)][ 2][15] 1158 1159 [end] server status: 2 1160 [end] server status: AUTOCOMMIT 1161 [end] warning count: 0 1162 [end] affected rows: 0 1163 [end] insert id : 0 1164 [end] message: 1165[CS_BINARY_REPRESENTATION] 1166 [meta] rows: 1 1167 [meta] cols: 1 1168 [meta] server status: 2 1169 [meta] server status: AUTOCOMMIT 1170 [meta] warning count: 0 1171 1172 [meta][field] db name: 1173 [meta][field] table name: 1174 [meta][field] org table name: 1175 [meta][field] col name: avg_func(10, 20) 1176 [meta][field] org col name: avg_func(10, 20) 1177 [meta][field] length: 11 1178 [meta][field] charsetnr: 8 1179 [meta][field] flags: 0 1180 [meta][field] decimals: 0 1181 [meta][field] type: LONG (3) 1182 1183 1184 [meta][charset result] number: 33 1185 [meta][charset result] name: utf8 1186 [meta][charset result] collation: utf8_general_ci 1187 [meta][charset result] sort order: 1188 1189 [data][.avg_func(10, 20)][ 2][15] 1190 1191 [end] server status: 2 1192 [end] server status: AUTOCOMMIT 1193 [end] warning count: 0 1194 [end] affected rows: 0 1195 [end] insert id : 0 1196 [end] message: 1197------------------------------------------------------------------ 1198EXECUTING:[115][SELECT SPECIFIC_NAME FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_TYPE = 'FUNCTION' AND ROUTINE_NAME = 'avg_func'] 1199[CS_TEXT_REPRESENTATION] 1200 [meta] rows: 1 1201 [meta] cols: 1 1202 [meta] server status: 34 1203 [meta] server status: AUTOCOMMIT QUERY_NO_INDEX_USED 1204 [meta] warning count: 0 1205 1206 [meta][field] db name: information_schema 1207 [meta][field] table name: ROUTINES 1208 [meta][field] org table name: ROUTINES 1209 [meta][field] col name: SPECIFIC_NAME 1210 [meta][field] org col name: SPECIFIC_NAME 1211 [meta][field] length: 192 1212 [meta][field] charsetnr: 33 1213 [meta][field] flags: 1 (NOT_NULL ) 1214 [meta][field] decimals: 0 1215 [meta][field] type: VARCHAR (15) 1216 1217 1218 [meta][charset result] number: 33 1219 [meta][charset result] name: utf8 1220 [meta][charset result] collation: utf8_general_ci 1221 [meta][charset result] sort order: 1222 1223 [data][ROUTINES.SPECIFIC_NAME][ 8][avg_func] 1224 1225 [end] server status: 34 1226 [end] server status: AUTOCOMMIT QUERY_NO_INDEX_USED 1227 [end] warning count: 0 1228 [end] affected rows: 0 1229 [end] insert id : 0 1230 [end] message: 1231[CS_BINARY_REPRESENTATION] 1232 [meta] rows: 1 1233 [meta] cols: 1 1234 [meta] server status: 34 1235 [meta] server status: AUTOCOMMIT QUERY_NO_INDEX_USED 1236 [meta] warning count: 0 1237 1238 [meta][field] db name: information_schema 1239 [meta][field] table name: ROUTINES 1240 [meta][field] org table name: ROUTINES 1241 [meta][field] col name: SPECIFIC_NAME 1242 [meta][field] org col name: SPECIFIC_NAME 1243 [meta][field] length: 192 1244 [meta][field] charsetnr: 33 1245 [meta][field] flags: 1 (NOT_NULL ) 1246 [meta][field] decimals: 0 1247 [meta][field] type: VARCHAR (15) 1248 1249 1250 [meta][charset result] number: 33 1251 [meta][charset result] name: utf8 1252 [meta][charset result] collation: utf8_general_ci 1253 [meta][charset result] sort order: 1254 1255 [data][ROUTINES.SPECIFIC_NAME][ 8][avg_func] 1256 1257 [end] server status: 34 1258 [end] server status: AUTOCOMMIT QUERY_NO_INDEX_USED 1259 [end] warning count: 0 1260 [end] affected rows: 0 1261 [end] insert id : 0 1262 [end] message: 1263------------------------------------------------------------------ 1264[srv_session_close] 1265deinit thread 1266# Checking whether procedure is executed when called in the plugin 1267SELECT * FROM t; 1268c1 c2 c3 12691 2015-07-06 abc 12702 2015-07-07 def 12713 2015-07-08 ijk 12724 2015-07-09 lmn 12735 2015-07-10 opq 12741 2015-07-06 abc 12752 2015-07-07 def 12763 2015-07-08 ijk 12774 2015-07-09 lmn 12785 2015-07-10 opq 1279# Calling the procedure 1280CALL proc; 1281SELECT * FROM t; 1282c1 c2 c3 12831 2015-07-06 abc 12842 2015-07-07 def 12853 2015-07-08 ijk 12864 2015-07-09 lmn 12875 2015-07-10 opq 12881 2015-07-06 abc 12892 2015-07-07 def 12903 2015-07-08 ijk 12914 2015-07-09 lmn 12925 2015-07-10 opq 12931 2015-07-06 abc 12942 2015-07-07 def 12953 2015-07-08 ijk 12964 2015-07-09 lmn 12975 2015-07-10 opq 1298# Calling the function 1299SELECT avg_func(10, 20); 1300avg_func(10, 20) 130115 1302########################################## 1303# Cleanup 1304########################################## 1305# Dropping the created procedures 1306DROP PROCEDURE proc; 1307DROP PROCEDURE sp_no_results; 1308DROP PROCEDURE sp_one_result; 1309DROP PROCEDURE sp_two_results; 1310DROP PROCEDURE sp_no_results_out; 1311DROP PROCEDURE sp_one_result_out; 1312DROP PROCEDURE sp_two_results_out; 1313DROP PROCEDURE sp_with_error; 1314DROP PROCEDURE sp_result_error; 1315# Dropping the created function 1316DROP FUNCTION avg_func; 1317# Dropping the created table 1318DROP TABLE t; 1319