File: innodb-use-sys-malloc.test

package info (click to toggle)
mysql-5.5 5.5.60-0%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 201,012 kB
  • sloc: cpp: 648,063; ansic: 552,041; perl: 48,017; pascal: 25,099; sh: 15,065; yacc: 13,088; cs: 4,647; xml: 4,178; sql: 3,380; makefile: 1,368; lex: 639; awk: 54
file content (45 lines) | stat: -rw-r--r-- 1,560 bytes parent folder | download | duplicates (5)
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
-- source include/have_innodb.inc

#display current value of innodb_use_sys_malloc
SELECT @@GLOBAL.innodb_use_sys_malloc;
--echo 1 Expected

#try changing it. Should fail.
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@GLOBAL.innodb_use_sys_malloc=0;
--echo Expected error 'Read only variable'

SELECT @@GLOBAL.innodb_use_sys_malloc;
--echo 1 Expected


# Do some stuff to see if it works.
# Also, test the code paths of
# Bug #12699505 MEMORY LEAK IN ROW_CREATE_INDEX_FOR_MYSQL()
# (the leak would only be triggered if
# ha_innobase::max_supported_key_part_length() were set
# higher than the limit used in row_create_index_for_mysql())

--error ER_DUP_FIELDNAME
create table t1(a int not null,key(a,a)) engine=innodb DEFAULT CHARSET=latin1;
# thanks to --innodb-large-prefix=1 this will not be truncated to b(767)
-- error ER_INDEX_COLUMN_TOO_LONG
create table t1(a int,b text,key(b(768))) engine=innodb DEFAULT CHARSET=latin1;
create table t1(a int not null,b text) engine=innodb DEFAULT CHARSET=latin1;
insert into t1 values (1,''),(2,''),(3,''),(4,''),(5,''),(6,''),(7,'');
--error ER_DUP_FIELDNAME
create index t1aa on t1(a,a);
-- error ER_INDEX_COLUMN_TOO_LONG
create index t1b on t1(b(768));
SHOW CREATE TABLE t1;
select * from t1;

drop table t1;
CREATE TABLE t2(a int primary key, b text) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO t2 VALUES (1,''),(2,''),(3,''),(4,''),(5,''),(6,''),(7,'');
--error ER_DUP_FIELDNAME
CREATE INDEX t2aa on t2(a,a);
-- error ER_INDEX_COLUMN_TOO_LONG
CREATE INDEX t2b on t2(b(768));
SELECT * FROM t2;
DROP TABLE t2;