mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 23:04:20 +01:00
94 lines
2.7 KiB
Text
94 lines
2.7 KiB
Text
# t/innodb_mysql.test
|
|
#
|
|
# Last update:
|
|
# 2006-07-26 ML test refactored (MySQL 5.1)
|
|
# main testing code t/innodb_mysql.test -> include/mix1.inc
|
|
#
|
|
|
|
-- source include/have_innodb.inc
|
|
let $engine_type= InnoDB;
|
|
let $other_engine_type= MEMORY;
|
|
# InnoDB does support FOREIGN KEYFOREIGN KEYs
|
|
let $test_foreign_keys= 1;
|
|
set global innodb_support_xa=default;
|
|
set session innodb_support_xa=default;
|
|
--source include/mix1.inc
|
|
|
|
--disable_warnings
|
|
drop table if exists t1, t2, t3;
|
|
--enable_warnings
|
|
#
|
|
# BUG#35850: Performance regression in 5.1.23/5.1.24
|
|
#
|
|
create table t1(a int);
|
|
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
|
create table t2 (a int, b int, pk int, key(a,b), primary key(pk)) engine=innodb;
|
|
insert into t2 select @a:=A.a+10*(B.a + 10*C.a),@a, @a from t1 A, t1 B, t1 C;
|
|
--echo this must use key 'a', not PRIMARY:
|
|
--replace_column 9 #
|
|
explain select a from t2 where a=b;
|
|
drop table t1, t2;
|
|
|
|
#
|
|
# Bug #40360: Binlog related errors with binlog off
|
|
#
|
|
# This bug is triggered when the binlog format is STATEMENT and the
|
|
# binary log is turned off. In this case, no error should be shown for
|
|
# the statement since there are no replication issues.
|
|
|
|
SET SESSION BINLOG_FORMAT=STATEMENT;
|
|
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
|
query_vertical select @@session.sql_log_bin, @@session.binlog_format, @@session.tx_isolation;
|
|
CREATE TABLE t1 ( a INT ) ENGINE=InnoDB;
|
|
INSERT INTO t1 VALUES(1);
|
|
DROP TABLE t1;
|
|
|
|
#
|
|
# Bug#37284 Crash in Field_string::type()
|
|
#
|
|
--disable_warnings
|
|
DROP TABLE IF EXISTS t1;
|
|
--enable_warnings
|
|
CREATE TABLE t1 (a char(50)) ENGINE=InnoDB;
|
|
CREATE INDEX i1 on t1 (a(3));
|
|
SELECT * FROM t1 WHERE a = 'abcde';
|
|
DROP TABLE t1;
|
|
|
|
#
|
|
# Bug #37742: HA_EXTRA_KEYREAD flag is set when key contains only prefix of
|
|
# requested column
|
|
#
|
|
|
|
CREATE TABLE foo (a int, b int, c char(10),
|
|
PRIMARY KEY (c(3)),
|
|
KEY b (b)
|
|
) engine=innodb;
|
|
|
|
CREATE TABLE foo2 (a int, b int, c char(10),
|
|
PRIMARY KEY (c),
|
|
KEY b (b)
|
|
) engine=innodb;
|
|
|
|
CREATE TABLE bar (a int, b int, c char(10),
|
|
PRIMARY KEY (c(3)),
|
|
KEY b (b)
|
|
) engine=myisam;
|
|
|
|
INSERT INTO foo VALUES
|
|
(1,2,'abcdefghij'), (2,3,''), (3,4,'klmnopqrst'),
|
|
(4,5,'uvwxyz'), (5,6,'meotnsyglt'), (4,5,'asfdewe');
|
|
|
|
INSERT INTO bar SELECT * FROM foo;
|
|
INSERT INTO foo2 SELECT * FROM foo;
|
|
|
|
--query_vertical EXPLAIN SELECT c FROM bar WHERE b>2;
|
|
--query_vertical EXPLAIN SELECT c FROM foo WHERE b>2;
|
|
--query_vertical EXPLAIN SELECT c FROM foo2 WHERE b>2;
|
|
|
|
--query_vertical EXPLAIN SELECT c FROM bar WHERE c>2;
|
|
--query_vertical EXPLAIN SELECT c FROM foo WHERE c>2;
|
|
--query_vertical EXPLAIN SELECT c FROM foo2 WHERE c>2;
|
|
|
|
DROP TABLE foo, bar, foo2;
|
|
|
|
--echo End of 5.1 tests
|