AnonSec Shell
Server IP : 185.86.78.101  /  Your IP : 216.73.216.124
Web Server : Apache
System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /www/server/mysql/mysql-test/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /www/server/mysql/mysql-test/t/sp_stress_case.test
#
# Bug#19194 (Right recursion in parser for CASE causes excessive stack
#   usage, limitation)
#

--disable_warnings
DROP PROCEDURE IF EXISTS proc_19194_codegen;
DROP PROCEDURE IF EXISTS bug_19194_simple;
DROP PROCEDURE IF EXISTS bug_19194_searched;
--enable_warnings

delimiter |;

CREATE PROCEDURE proc_19194_codegen(
  IN proc_name VARCHAR(50),
  IN count INTEGER,
  IN simple INTEGER,
  OUT body MEDIUMTEXT)
BEGIN
  DECLARE code MEDIUMTEXT;
  DECLARE i INT DEFAULT 1;

  SET code = concat("CREATE PROCEDURE ", proc_name, "(i INT)\n");
  SET code = concat(code, "BEGIN\n");
  SET code = concat(code, "  DECLARE str CHAR(10);\n");

  IF (simple)
  THEN
    SET code = concat(code, "  CASE i\n");
  ELSE
    SET code = concat(code, "  CASE\n");
  END IF;

  WHILE (i <= count)
  DO
    IF (simple)
    THEN
      SET code = concat(code, "    WHEN ", i, " THEN SET str=\"", i, "\";\n");
    ELSE
      SET code = concat(code, "    WHEN i=", i, " THEN SET str=\"", i, "\";\n");
    END IF;

    SET i = i + 1;
  END WHILE;

  SET code = concat(code, "    ELSE SET str=\"unknown\";\n");
  SET code = concat(code, "  END CASE;\n");
  SET code = concat(code, "  SELECT str;\n");

  SET code = concat(code, "END\n");

  SET body = code;
END|

delimiter ;|

set @body="";
call proc_19194_codegen("test_simple", 10, 1, @body);
select @body;
call proc_19194_codegen("test_searched", 10, 0, @body);
select @body;

--disable_query_log
call proc_19194_codegen("bug_19194_simple", 5000, 1, @body);
let $proc_body = `select @body`;
eval $proc_body;
call proc_19194_codegen("bug_19194_searched", 5000, 1, @body);
let $proc_body = `select @body`;
eval $proc_body;
--enable_query_log

CALL bug_19194_simple(1);
CALL bug_19194_simple(2);
CALL bug_19194_simple(1000);
CALL bug_19194_simple(4998);
CALL bug_19194_simple(4999);
CALL bug_19194_simple(9999);

CALL bug_19194_searched(1);
CALL bug_19194_searched(2);
CALL bug_19194_searched(1000);
CALL bug_19194_searched(4998);
CALL bug_19194_searched(4999);
CALL bug_19194_searched(9999);

DROP PROCEDURE proc_19194_codegen;
DROP PROCEDURE bug_19194_simple;
DROP PROCEDURE bug_19194_searched;


Anon7 - 2022
AnonSec Team