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
drop table t1,t2,t3;
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');
select name2 from t1 union all select name from t1 union all select id from t1;
name2
select trim(name2) from t1 union all select trim(name) from t1 union all select trim(id) from t1;
trim(name2)
fff
sss
ttt
......@@ -1767,6 +1767,21 @@ select count(*) from t1 where x = 18446744073709551601;
count(*)
1
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";
Variable_name Value
Innodb_row_lock_waits 0
......@@ -3397,3 +3412,47 @@ commit;
drop table t1, t2, t3, t5, t6, t8, t9;
CREATE TABLE t1 (DB_ROW_ID int) engine=innodb;
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;
#
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');
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;
#
......@@ -1295,6 +1295,15 @@ select * from t1 where x > -16;
select count(*) from t1 where x = 18446744073709551601;
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.
show status like "Innodb_row_lock_waits";
show status like "Innodb_row_lock_current_waits";
......@@ -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"
--error 1005
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;
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 (
c_id int(11) not null default '0',
org_id int(11) default null,
......@@ -54,6 +60,35 @@ c.c_id = 218 and expiredate is null;
slai_id
12
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 t1i (a int) engine=innodb;
create table t2m (a int) engine=myisam;
......@@ -326,3 +361,9 @@ ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
SELECT * from t2;
a b
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 @@
drop table if exists t1,t2,t1m,t1i,t2m,t2i,t4;
--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
# (repeatable only w/innodb).
create table t1 (
......@@ -58,6 +66,38 @@ where
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
#
......@@ -272,3 +312,11 @@ TRUNCATE table t2;
INSERT INTO t2 select * from t1;
SELECT * from 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;
--innodb_locks_unsafe_for_binlog=true --innodb_lock_wait_timeout=1
\ No newline at end of file
--innodb_locks_unsafe_for_binlog=true --innodb_lock_wait_timeout=1
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