403Webshell
Server IP : 172.67.216.182  /  Your IP : 172.71.81.177
Web Server : Apache
System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 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 : ON
Directory :  /www/server/mysql/src/mysql-test/suite/innodb/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/src/mysql-test/suite/innodb/t/sp_temp_table.test
--source include/have_innodb.inc
--source include/big_test.inc

--echo #
--echo # Bug #19306524 FAILING ASSERTION WITH TEMP TABLE FOR A PROCEDURE
--echo # CALLED FROM A FUNCTION
--echo #

call mtr.add_suppression("MySQL is trying to drop table");

DELIMITER $$;
CREATE PROCEDURE cachedata(
  IN obj_id BIGINT UNSIGNED,
  IN start  DATETIME,
  IN end    DATETIME
)

cachedata:BEGIN
  DECLARE cache_count BIGINT;

  SET @timestamp := NOW();

  CREATE TEMPORARY TABLE IF NOT EXISTS cachedata (
    timestamp    DATETIME,
    object_id    BIGINT UNSIGNED NOT NULL,
    start        DATETIME,
    end          DATETIME,
    seqno        BIGINT AUTO_INCREMENT,
    value        FLOAT,
    PRIMARY KEY (seqno),
    INDEX (timestamp),
    INDEX (object_id, start, end)
  ) ENGINE=INNODB;

  DELETE FROM cachedata WHERE
    timestamp < DATE_SUB(@timestamp, INTERVAL 15 SECOND);

  SELECT count(*) INTO cache_count FROM cachedata WHERE
    object_id = obj_id
    AND start = start
    AND end = end;

  IF cache_count > 0 THEN LEAVE cachedata;
  END IF;

  INSERT INTO cachedata (timestamp, object_id, start, end, value) VALUES
    (@timestamp, obj_id, start, end, 1234),
    (@timestamp, obj_id, start, end, 4567),
    (@timestamp, obj_id, start, end, 8901),
    (@timestamp, obj_id, start, end, 1234),
    (@timestamp, obj_id, start, end, 4567),
    (@timestamp, obj_id, start, end, 8901),
    (@timestamp, obj_id, start, end, 1234),
    (@timestamp, obj_id, start, end, 4567),
    (@timestamp, obj_id, start, end, 8901),
    (@timestamp, obj_id, start, end, 1234),
    (@timestamp, obj_id, start, end, 4567),
    (@timestamp, obj_id, start, end, 8901),
    (@timestamp, obj_id, start, end, 2345),
    (@timestamp, obj_id, start, end, 1234),
    (@timestamp, obj_id, start, end, 4567),
    (@timestamp, obj_id, start, end, 8901),
    (@timestamp, obj_id, start, end, 2345),
    (@timestamp, obj_id, start, end, 1234),
    (@timestamp, obj_id, start, end, 4567),
    (@timestamp, obj_id, start, end, 8901),
    (@timestamp, obj_id, start, end, 2345);

END$$


CREATE FUNCTION get_cache(
  obj_id   BIGINT UNSIGNED,
  start    DATETIME,
  end      DATETIME
)
  RETURNS FLOAT
  READS SQL DATA
BEGIN
  DECLARE result FLOAT;

  CALL cachedata(obj_id, start, end);

  SELECT SUM(value) INTO result FROM cachedata WHERE
    object_id = obj_id
    AND start = start
    AND end = end;

  RETURN result;
END$$

DELIMITER ;$$

let $i = 30;
while ($i)
{
 SELECT get_cache(1, '2014-01-01', '2014-02-01');
 select sleep(1);
 dec $i;
}

DROP FUNCTION get_cache;
DROP PROCEDURE cachedata;

Youez - 2016 - github.com/yon3zu
LinuXploit