Commit 23573074 authored by marko's avatar marko

Merge changes to test files from MySQL AB. The suite innodb.test fails

due to this MySQL change to row0mysql.c not being merged:

http://mysql.bkbits.net:8080/mysql-5.1/diffs/storage/innobase/row/row0mysql.c@1.126.1.1
parent b0d9c363
...@@ -1465,8 +1465,8 @@ Error 1146 Table 'test.t4' doesn't exist ...@@ -1465,8 +1465,8 @@ Error 1146 Table 'test.t4' doesn't exist
drop table t1,t2,t3; drop table t1,t2,t3;
create table t1 (id int, name char(10) not null, name2 char(10) not null) engine=innodb; create table t1 (id int, name char(10) not null, name2 char(10) not null) engine=innodb;
insert into t1 values(1,'first','fff'),(2,'second','sss'),(3,'third','ttt'); insert into t1 values(1,'first','fff'),(2,'second','sss'),(3,'third','ttt');
select name2 from t1 union all select name from t1 union all select id from t1; select trim(name2) from t1 union all select trim(name) from t1 union all select trim(id) from t1;
name2 trim(name2)
fff fff
sss sss
ttt ttt
...@@ -1767,6 +1767,21 @@ select count(*) from t1 where x = 18446744073709551601; ...@@ -1767,6 +1767,21 @@ select count(*) from t1 where x = 18446744073709551601;
count(*) count(*)
1 1
drop table t1; drop table t1;
show status like "Innodb_buffer_pool_pages_total";
Variable_name Value
Innodb_buffer_pool_pages_total 512
show status like "Innodb_page_size";
Variable_name Value
Innodb_page_size 16384
show status like "Innodb_rows_deleted";
Variable_name Value
Innodb_rows_deleted 2070
show status like "Innodb_rows_inserted";
Variable_name Value
Innodb_rows_inserted 31727
show status like "Innodb_rows_updated";
Variable_name Value
Innodb_rows_updated 29530
show status like "Innodb_row_lock_waits"; show status like "Innodb_row_lock_waits";
Variable_name Value Variable_name Value
Innodb_row_lock_waits 0 Innodb_row_lock_waits 0
...@@ -3397,3 +3412,47 @@ commit; ...@@ -3397,3 +3412,47 @@ commit;
drop table t1, t2, t3, t5, t6, t8, t9; drop table t1, t2, t3, t5, t6, t8, t9;
CREATE TABLE t1 (DB_ROW_ID int) engine=innodb; CREATE TABLE t1 (DB_ROW_ID int) engine=innodb;
ERROR HY000: Can't create table 'test.t1' (errno: -1) ERROR HY000: Can't create table 'test.t1' (errno: -1)
CREATE TABLE t1 (
a BIGINT(20) NOT NULL,
PRIMARY KEY (a)
) ENGINE=INNODB DEFAULT CHARSET=UTF8;
CREATE TABLE t2 (
a BIGINT(20) NOT NULL,
b VARCHAR(128) NOT NULL,
c TEXT NOT NULL,
PRIMARY KEY (a,b),
KEY idx_t2_b_c (b,c(200)),
CONSTRAINT t_fk FOREIGN KEY (a) REFERENCES t1 (a)
ON DELETE CASCADE
) ENGINE=INNODB DEFAULT CHARSET=UTF8;
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1, 'bar', 'vbar');
INSERT INTO t2 VALUES (1, 'BAR2', 'VBAR');
INSERT INTO t2 VALUES (1, 'bar_bar', 'bibi');
INSERT INTO t2 VALUES (1, 'customer_over', '1');
SELECT * FROM t2 WHERE b = 'customer_over';
a b c
1 customer_over 1
SELECT * FROM t2 WHERE BINARY b = 'customer_over';
a b c
1 customer_over 1
SELECT DISTINCT p0.a FROM t2 p0 WHERE p0.b = 'customer_over';
a
1
/* Bang: Empty result set, above was expected: */
SELECT DISTINCT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over';
a
1
SELECT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over';
a
1
drop table t2, t1;
create table t1 (g geometry not null, spatial gk(g)) engine=innodb;
ERROR HY000: The used table type doesn't support SPATIAL indexes
CREATE TABLE t1 ( a int ) ENGINE=innodb;
BEGIN;
INSERT INTO t1 VALUES (1);
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
DROP TABLE t1;
...@@ -1071,7 +1071,7 @@ drop table t1,t2,t3; ...@@ -1071,7 +1071,7 @@ drop table t1,t2,t3;
# #
create table t1 (id int, name char(10) not null, name2 char(10) not null) engine=innodb; create table t1 (id int, name char(10) not null, name2 char(10) not null) engine=innodb;
insert into t1 values(1,'first','fff'),(2,'second','sss'),(3,'third','ttt'); insert into t1 values(1,'first','fff'),(2,'second','sss'),(3,'third','ttt');
select name2 from t1 union all select name from t1 union all select id from t1; select trim(name2) from t1 union all select trim(name) from t1 union all select trim(id) from t1;
drop table t1; drop table t1;
# #
...@@ -1295,6 +1295,15 @@ select * from t1 where x > -16; ...@@ -1295,6 +1295,15 @@ select * from t1 where x > -16;
select count(*) from t1 where x = 18446744073709551601; select count(*) from t1 where x = 18446744073709551601;
drop table t1; drop table t1;
# Test for testable InnoDB status variables. This test
# uses previous ones(pages_created, rows_deleted, ...).
show status like "Innodb_buffer_pool_pages_total";
show status like "Innodb_page_size";
show status like "Innodb_rows_deleted";
show status like "Innodb_rows_inserted";
show status like "Innodb_rows_updated";
# Test for row locks InnoDB status variables. # Test for row locks InnoDB status variables.
show status like "Innodb_row_lock_waits"; show status like "Innodb_row_lock_waits";
show status like "Innodb_row_lock_current_waits"; show status like "Innodb_row_lock_current_waits";
...@@ -2443,3 +2452,66 @@ drop table t1, t2, t3, t5, t6, t8, t9; ...@@ -2443,3 +2452,66 @@ drop table t1, t2, t3, t5, t6, t8, t9;
# bug 18934, "InnoDB crashes when table uses column names like DB_ROW_ID" # bug 18934, "InnoDB crashes when table uses column names like DB_ROW_ID"
--error 1005 --error 1005
CREATE TABLE t1 (DB_ROW_ID int) engine=innodb; CREATE TABLE t1 (DB_ROW_ID int) engine=innodb;
#
# Bug #17152: Wrong result with BINARY comparison on aliased column
#
CREATE TABLE t1 (
a BIGINT(20) NOT NULL,
PRIMARY KEY (a)
) ENGINE=INNODB DEFAULT CHARSET=UTF8;
CREATE TABLE t2 (
a BIGINT(20) NOT NULL,
b VARCHAR(128) NOT NULL,
c TEXT NOT NULL,
PRIMARY KEY (a,b),
KEY idx_t2_b_c (b,c(200)),
CONSTRAINT t_fk FOREIGN KEY (a) REFERENCES t1 (a)
ON DELETE CASCADE
) ENGINE=INNODB DEFAULT CHARSET=UTF8;
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1, 'bar', 'vbar');
INSERT INTO t2 VALUES (1, 'BAR2', 'VBAR');
INSERT INTO t2 VALUES (1, 'bar_bar', 'bibi');
INSERT INTO t2 VALUES (1, 'customer_over', '1');
SELECT * FROM t2 WHERE b = 'customer_over';
SELECT * FROM t2 WHERE BINARY b = 'customer_over';
SELECT DISTINCT p0.a FROM t2 p0 WHERE p0.b = 'customer_over';
/* Bang: Empty result set, above was expected: */
SELECT DISTINCT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over';
SELECT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over';
drop table t2, t1;
#
# Bug #15680 (SPATIAL key in innodb)
#
--error ER_TABLE_CANT_HANDLE_SPKEYS
create table t1 (g geometry not null, spatial gk(g)) engine=innodb;
#
# Test optimize on table with open transaction
#
CREATE TABLE t1 ( a int ) ENGINE=innodb;
BEGIN;
INSERT INTO t1 VALUES (1);
OPTIMIZE TABLE t1;
DROP TABLE t1;
#######################################################################
# #
# Please, DO NOT TOUCH this file as well as the innodb.result file. #
# These files are to be modified ONLY BY INNOBASE guys. #
# #
# Use innodb_mysql.[test|result] files instead. #
# #
# If nevertheless you need to make some changes here, please, forward #
# your commit message To: dev@innodb.com Cc: dev-innodb@mysql.com #
# (otherwise your changes may be erased). #
# #
#######################################################################
drop table if exists t1,t2,t1m,t1i,t2m,t2i,t4; drop table if exists t1,t2,t1m,t1i,t2m,t2i,t4;
create table t1(f1 varchar(800) binary not null, key(f1)) engine = innodb
character set utf8 collate utf8_general_ci;
Warnings:
Warning 1071 Specified key was too long; max key length is 765 bytes
insert into t1 values('aaa');
drop table t1;
create table t1 ( create table t1 (
c_id int(11) not null default '0', c_id int(11) not null default '0',
org_id int(11) default null, org_id int(11) default null,
...@@ -54,6 +60,35 @@ c.c_id = 218 and expiredate is null; ...@@ -54,6 +60,35 @@ c.c_id = 218 and expiredate is null;
slai_id slai_id
12 12
drop table t1, t2; drop table t1, t2;
CREATE TABLE t1 (a int, b int, KEY b (b)) Engine=InnoDB;
CREATE TABLE t2 (a int, b int, PRIMARY KEY (a,b)) Engine=InnoDB;
CREATE TABLE t3 (a int, b int, c int, PRIMARY KEY (a),
UNIQUE KEY b (b,c), KEY a (a,b,c)) Engine=InnoDB;
INSERT INTO t1 VALUES (1, 1);
INSERT INTO t1 SELECT a + 1, b + 1 FROM t1;
INSERT INTO t1 SELECT a + 2, b + 2 FROM t1;
INSERT INTO t2 VALUES (1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8);
INSERT INTO t2 SELECT a + 1, b FROM t2;
DELETE FROM t2 WHERE a = 1 AND b < 2;
INSERT INTO t3 VALUES (1,1,1),(2,1,2);
INSERT INTO t3 SELECT a + 2, a + 2, 3 FROM t3;
INSERT INTO t3 SELECT a + 4, a + 4, 3 FROM t3;
SELECT STRAIGHT_JOIN SQL_NO_CACHE t1.b, t1.a FROM t1, t3, t2 WHERE
t3.a = t2.a AND t2.b = t1.a AND t3.b = 1 AND t3.c IN (1, 2)
ORDER BY t1.b LIMIT 2;
b a
1 1
2 2
SELECT STRAIGHT_JOIN SQL_NO_CACHE t1.b, t1.a FROM t1, t3, t2 WHERE
t3.a = t2.a AND t2.b = t1.a AND t3.b = 1 AND t3.c IN (1, 2)
ORDER BY t1.b LIMIT 5;
b a
1 1
2 2
2 2
3 3
3 3
DROP TABLE t1, t2, t3;
create table t1m (a int) engine=myisam; create table t1m (a int) engine=myisam;
create table t1i (a int) engine=innodb; create table t1i (a int) engine=innodb;
create table t2m (a int) engine=myisam; create table t2m (a int) engine=myisam;
...@@ -326,3 +361,9 @@ ERROR 23000: Duplicate entry '1' for key 'PRIMARY' ...@@ -326,3 +361,9 @@ ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
SELECT * from t2; SELECT * from t2;
a b a b
drop table t1,t2; drop table t1,t2;
create table t1(f1 varchar(800) binary not null, key(f1)) engine = innodb
character set utf8 collate utf8_general_ci;
Warnings:
Warning 1071 Specified key was too long; max key length is 765 bytes
insert into t1 values('aaa');
drop table t1;
...@@ -4,6 +4,14 @@ ...@@ -4,6 +4,14 @@
drop table if exists t1,t2,t1m,t1i,t2m,t2i,t4; drop table if exists t1,t2,t1m,t1i,t2m,t2i,t4;
--enable_warnings --enable_warnings
#
# Bug#17530: Incorrect key truncation on table creation caused server crash.
#
create table t1(f1 varchar(800) binary not null, key(f1)) engine = innodb
character set utf8 collate utf8_general_ci;
insert into t1 values('aaa');
drop table t1;
# BUG#16798: Uninitialized row buffer reads in ref-or-null optimizer # BUG#16798: Uninitialized row buffer reads in ref-or-null optimizer
# (repeatable only w/innodb). # (repeatable only w/innodb).
create table t1 ( create table t1 (
...@@ -58,6 +66,38 @@ where ...@@ -58,6 +66,38 @@ where
drop table t1, t2; drop table t1, t2;
#
# Bug#17212: results not sorted correctly by ORDER BY when using index
# (repeatable only w/innodb because of index props)
#
CREATE TABLE t1 (a int, b int, KEY b (b)) Engine=InnoDB;
CREATE TABLE t2 (a int, b int, PRIMARY KEY (a,b)) Engine=InnoDB;
CREATE TABLE t3 (a int, b int, c int, PRIMARY KEY (a),
UNIQUE KEY b (b,c), KEY a (a,b,c)) Engine=InnoDB;
INSERT INTO t1 VALUES (1, 1);
INSERT INTO t1 SELECT a + 1, b + 1 FROM t1;
INSERT INTO t1 SELECT a + 2, b + 2 FROM t1;
INSERT INTO t2 VALUES (1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8);
INSERT INTO t2 SELECT a + 1, b FROM t2;
DELETE FROM t2 WHERE a = 1 AND b < 2;
INSERT INTO t3 VALUES (1,1,1),(2,1,2);
INSERT INTO t3 SELECT a + 2, a + 2, 3 FROM t3;
INSERT INTO t3 SELECT a + 4, a + 4, 3 FROM t3;
# demonstrate a problem when a must-use-sort table flag
# (sort_by_table=1) is being neglected.
SELECT STRAIGHT_JOIN SQL_NO_CACHE t1.b, t1.a FROM t1, t3, t2 WHERE
t3.a = t2.a AND t2.b = t1.a AND t3.b = 1 AND t3.c IN (1, 2)
ORDER BY t1.b LIMIT 2;
# demonstrate the problem described in the bug report
SELECT STRAIGHT_JOIN SQL_NO_CACHE t1.b, t1.a FROM t1, t3, t2 WHERE
t3.a = t2.a AND t2.b = t1.a AND t3.b = 1 AND t3.c IN (1, 2)
ORDER BY t1.b LIMIT 5;
DROP TABLE t1, t2, t3;
# #
# Bug #12882 min/max inconsistent on empty table # Bug #12882 min/max inconsistent on empty table
# #
...@@ -272,3 +312,11 @@ TRUNCATE table t2; ...@@ -272,3 +312,11 @@ TRUNCATE table t2;
INSERT INTO t2 select * from t1; INSERT INTO t2 select * from t1;
SELECT * from t2; SELECT * from t2;
drop table t1,t2; drop table t1,t2;
#
# Bug#17530: Incorrect key truncation on table creation caused server crash.
#
create table t1(f1 varchar(800) binary not null, key(f1)) engine = innodb
character set utf8 collate utf8_general_ci;
insert into t1 values('aaa');
drop table t1;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment