~ubuntu-branches/ubuntu/trusty/mariadb-5.5/trusty-security

« back to all changes in this revision

Viewing changes to mysql-test/suite/innodb/t/sp_temp_table.test

  • Committer: Package Import Robot
  • Author(s): Otto Kekäläinen
  • Date: 2015-01-27 21:15:00 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20150127211500-vbci4ew2bs7j4zwk
Tags: 5.5.41-0ubuntu0.14.04.2
* SECURITY UPDATE: Update to 5.5.41 to fix security issues (LP: #1414755)
  - CVE-2015-0411
  - CVE-2015-0382
  - CVE-2015-0381
  - CVE-2015-0432
  - CVE-2014-6568
  - CVE-2015-0374
* As approved by Seth Arnold, this security update also imports the latest
  mariadb-5.5 packaging from Debian which includes useful and low-risk
  fixes:
  - Updated Dutch translation by Frans Spiesschaert
  - Updated control file so that mariadb-client-5.5 breaks and replaces
    the package mariadb-server-5.5 to allow overwriting the innochecksum
    man page file which has changed location (LP: #1368124) as per
    doc https://www.debian.org/doc/debian-policy/ch-relationships.html#s7.6.1
  - Backported the fix of #770177 from 10.0 to 5.5 so that the migration
    question will not be asked repeatedly. (LP: #1392539)
 * Close delta between 14.10 and 14.04 in regards of packaging.
 * Backported new cacert.pem etc from 5.5 the replace the expired ones

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--source include/have_innodb.inc
 
2
--source include/big_test.inc
 
3
 
 
4
if (`select plugin_auth_version <= "5.5.40-MariaDB-36.1" from information_schema.plugins where plugin_name='innodb'`)
 
5
{
 
6
  --skip Not fixed in XtraDB as of 5.5.40-MariaDB-36.1 or earlier
 
7
}
 
8
 
 
9
--echo #
 
10
--echo # Bug #19306524 FAILING ASSERTION WITH TEMP TABLE FOR A PROCEDURE
 
11
--echo # CALLED FROM A FUNCTION
 
12
--echo #
 
13
 
 
14
call mtr.add_suppression("MySQL is trying to drop table");
 
15
 
 
16
DELIMITER $$;
 
17
CREATE PROCEDURE cachedata(
 
18
  IN obj_id BIGINT UNSIGNED,
 
19
  IN start  DATETIME,
 
20
  IN end    DATETIME
 
21
)
 
22
 
 
23
cachedata:BEGIN
 
24
  DECLARE cache_count BIGINT;
 
25
 
 
26
  SET @timestamp := NOW();
 
27
 
 
28
  CREATE TEMPORARY TABLE IF NOT EXISTS cachedata (
 
29
    timestamp    DATETIME,
 
30
    object_id    BIGINT UNSIGNED NOT NULL,
 
31
    start        DATETIME,
 
32
    end          DATETIME,
 
33
    seqno        BIGINT AUTO_INCREMENT,
 
34
    value        FLOAT,
 
35
    PRIMARY KEY (seqno),
 
36
    INDEX (timestamp),
 
37
    INDEX (object_id, start, end)
 
38
  ) ENGINE=INNODB;
 
39
 
 
40
  DELETE FROM cachedata WHERE
 
41
    timestamp < DATE_SUB(@timestamp, INTERVAL 15 SECOND);
 
42
 
 
43
  SELECT count(*) INTO cache_count FROM cachedata WHERE
 
44
    object_id = obj_id
 
45
    AND start = start
 
46
    AND end = end;
 
47
 
 
48
  IF cache_count > 0 THEN LEAVE cachedata;
 
49
  END IF;
 
50
 
 
51
  INSERT INTO cachedata (timestamp, object_id, start, end, value) VALUES
 
52
    (@timestamp, obj_id, start, end, 1234),
 
53
    (@timestamp, obj_id, start, end, 4567),
 
54
    (@timestamp, obj_id, start, end, 8901),
 
55
    (@timestamp, obj_id, start, end, 1234),
 
56
    (@timestamp, obj_id, start, end, 4567),
 
57
    (@timestamp, obj_id, start, end, 8901),
 
58
    (@timestamp, obj_id, start, end, 1234),
 
59
    (@timestamp, obj_id, start, end, 4567),
 
60
    (@timestamp, obj_id, start, end, 8901),
 
61
    (@timestamp, obj_id, start, end, 1234),
 
62
    (@timestamp, obj_id, start, end, 4567),
 
63
    (@timestamp, obj_id, start, end, 8901),
 
64
    (@timestamp, obj_id, start, end, 2345),
 
65
    (@timestamp, obj_id, start, end, 1234),
 
66
    (@timestamp, obj_id, start, end, 4567),
 
67
    (@timestamp, obj_id, start, end, 8901),
 
68
    (@timestamp, obj_id, start, end, 2345),
 
69
    (@timestamp, obj_id, start, end, 1234),
 
70
    (@timestamp, obj_id, start, end, 4567),
 
71
    (@timestamp, obj_id, start, end, 8901),
 
72
    (@timestamp, obj_id, start, end, 2345);
 
73
 
 
74
END$$
 
75
 
 
76
 
 
77
CREATE FUNCTION get_cache(
 
78
  obj_id   BIGINT UNSIGNED,
 
79
  start    DATETIME,
 
80
  end      DATETIME
 
81
)
 
82
  RETURNS FLOAT
 
83
  READS SQL DATA
 
84
BEGIN
 
85
  DECLARE result FLOAT;
 
86
 
 
87
  CALL cachedata(obj_id, start, end);
 
88
 
 
89
  SELECT SUM(value) INTO result FROM cachedata WHERE
 
90
    object_id = obj_id
 
91
    AND start = start
 
92
    AND end = end;
 
93
 
 
94
  RETURN result;
 
95
END$$
 
96
 
 
97
DELIMITER ;$$
 
98
 
 
99
let $i = 30;
 
100
while ($i)
 
101
{
 
102
 SELECT get_cache(1, '2014-01-01', '2014-02-01');
 
103
 select sleep(1);
 
104
 dec $i;
 
105
}
 
106
 
 
107
DROP FUNCTION get_cache;
 
108
DROP PROCEDURE cachedata;