summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorunknown <bar@mysql.com>2006-04-19 09:22:04 +0500
committerunknown <bar@mysql.com>2006-04-19 09:22:04 +0500
commitc6590081c30697d62eac99f9be16fb1c952b51a9 (patch)
treee40bf85e8b4b06347d7b35673438840b2cfa0c96 /mysql-test/t
parent7280f8befb0c5b862edcd50f0797dc4b013afc16 (diff)
parent28980e7cc754d94ab93134ec147959908cc8b36a (diff)
downloadmariadb-git-c6590081c30697d62eac99f9be16fb1c952b51a9.tar.gz
Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into mysql.com:/usr/home/bar/mysql-5.1-new.b16319
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/archive.test3
-rw-r--r--mysql-test/t/innodb.test56
-rw-r--r--mysql-test/t/mysql.test6
-rw-r--r--mysql-test/t/ndb_blob_partition.test93
-rw-r--r--mysql-test/t/partition.test5
5 files changed, 163 insertions, 0 deletions
diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test
index 535402c2e13..7e091991475 100644
--- a/mysql-test/t/archive.test
+++ b/mysql-test/t/archive.test
@@ -1486,6 +1486,9 @@ select * from t1;
alter table t1 add unique key (i, v);
select * from t1 where i between 2 and 4 and v in ('def','3r4f','lmn');
+alter table t1 data directory="$MYSQLTEST_VARDIR/tmp";
+select * from t1;
+
#
# Cleanup, test is over
#
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index 0a8e46d694c..18b47c39a10 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -1142,6 +1142,41 @@ drop table t2, t1;
#
+# Let us test binlog_cache_use and binlog_cache_disk_use status vars.
+# Actually this test has nothing to do with innodb per se, it just requires
+# transactional table.
+#
+flush status;
+show status like "binlog_cache_use";
+show status like "binlog_cache_disk_use";
+
+create table t1 (a int) engine=innodb;
+
+# Now we are going to create transaction which is long enough so its
+# transaction binlog will be flushed to disk...
+let $1=2000;
+disable_query_log;
+begin;
+while ($1)
+{
+ eval insert into t1 values( $1 );
+ dec $1;
+}
+commit;
+enable_query_log;
+show status like "binlog_cache_use";
+show status like "binlog_cache_disk_use";
+
+# Transaction which should not be flushed to disk and so should not
+# increase binlog_cache_disk_use.
+begin;
+delete from t1;
+commit;
+show status like "binlog_cache_use";
+show status like "binlog_cache_disk_use";
+drop table t1;
+
+#
# Bug #6126: Duplicate columns in keys gives misleading error message
#
--error 1060
@@ -1255,6 +1290,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";
@@ -2138,3 +2182,15 @@ show create table t1;
#
drop table t1, t2;
+
+#
+# Bug #14360: problem with intervals
+#
+
+create table t1(a date) engine=innodb;
+create table t2(a date, key(a)) engine=innodb;
+insert into t1 values('2005-10-01');
+insert into t2 values('2005-10-01');
+select * from t1, t2
+ where t2.a between t1.a - interval 2 day and t1.a + interval 2 day;
+drop table t1, t2;
diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test
index dbf65845e6a..95cba2743da 100644
--- a/mysql-test/t/mysql.test
+++ b/mysql-test/t/mysql.test
@@ -61,3 +61,9 @@ drop table t1;
# Bug#16859 -- NULLs in columns must not truncate data as if a C-language "string".
#
--exec $MYSQL -t test -e "create table t1 (col1 binary(4), col2 varchar(10), col3 int); insert into t1 values ('a', 'b', 123421),('a ', '0123456789', 4), ('abcd', '', 4); select concat('>',col1,'<'), col2, col3 from t1; drop table t1;" 2>&1
+
+#
+# Bug#18265 -- mysql client: No longer right-justifies numeric columns
+#
+--exec $MYSQL -t --default-character-set utf8 test -e "create table t1 (i int, j int, k char(25) charset utf8); insert into t1 (i) values (1); insert into t1 (k) values ('<----------------------->'); insert into t1 (k) values ('<-----'); insert into t1 (k) values ('Τη γλώσσα'); insert into t1 (k) values ('ᛖᚴ ᚷᛖᛏ'); select * from t1; DROP TABLE t1;"
+
diff --git a/mysql-test/t/ndb_blob_partition.test b/mysql-test/t/ndb_blob_partition.test
new file mode 100644
index 00000000000..a3948cc9491
--- /dev/null
+++ b/mysql-test/t/ndb_blob_partition.test
@@ -0,0 +1,93 @@
+--source include/have_ndb.inc
+-- source include/not_embedded.inc
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+#
+# Minimal NDB blobs test with range partitions.
+#
+
+create table t1 (
+ a mediumint not null,
+ b text not null,
+ c int not null,
+ d longblob,
+ primary key using hash (a,c),
+ unique key (c)
+)
+ engine=ndb
+ partition by range (c)
+ partitions 3
+ ( partition p1 values less than (200),
+ partition p2 values less than (300),
+ partition p3 values less than (400));
+
+--disable_query_log
+sleep 1;
+
+# length 61
+set @s0 = 'rggurloniukyehuxdbfkkyzlceixzrehqhvxvxbpwizzvjzpucqmzrhzxzfau';
+set @s1 = 'ykyymbzqgqlcjhlhmyqelfoaaohvtbekvifukdtnvcrrjveevfakxarxexomz';
+set @s2 = 'dbnfqyzgtqxalcrwtfsqabknvtfcbpoonxsjiqvmhnfikxxhcgoexlkoezvah';
+
+set @v1 = repeat(@s0, 100); -- 1d42dd9090cf78314a06665d4ea938c35cc760f4
+set @v2 = repeat(@s1, 200); -- 10d3c783026b310218d10b7188da96a2401648c6
+set @v3 = repeat(@s2, 300); -- a33549d9844092289a58ac348dd59f09fc28406a
+set @v4 = repeat(@s0, 400); -- daa61c6de36a0526f0d47dc29d6b9de7e6d2630c
+set @v5 = repeat(@s1, 500); -- 70fc9a7d08beebc522258bfb02000a30c77a8f1d
+set @v6 = repeat(@s2, 600); -- 090565c580809efed3d369481a4bbb168b20713e
+set @v7 = repeat(@s0, 700); -- 1e0070bec426871a46291de27b9bd6e4255ab4e5
+set @v8 = repeat(@s1, 800); -- acbaba01bc2e682f015f40e79d9cbe475db3002e
+set @v9 = repeat(@s2, 900); -- 9ee30d99162574f79c66ae95cdf132dcf9cbc259
+--enable_query_log
+
+# -- insert --
+insert into t1 values (1, @v1, 101, @v2);
+insert into t1 values (1, @v2, 102, @v3);
+insert into t1 values (1, @v3, 103, @v4);
+insert into t1 values (2, @v4, 201, @v5);
+insert into t1 values (2, @v5, 202, @v6);
+insert into t1 values (2, @v6, 203, @v7);
+insert into t1 values (3, @v7, 301, @v8);
+insert into t1 values (3, @v8, 302, @v9);
+insert into t1 values (3, @v9, 303, @v1);
+select a, sha1(b), c, sha1(d) from t1 order by a;
+
+# -- pk read --
+select a, sha1(b), c, sha1(d) from t1 where a = 1 and c = 101;
+select a, sha1(b), c, sha1(d) from t1 where a = 2 and c = 201;
+select a, sha1(b), c, sha1(d) from t1 where a = 3 and c = 301;
+
+# -- pk update --
+update t1 set b = @v3, d = @v4 where a = 1 and c = 102;
+update t1 set b = @v6, d = @v7 where a = 2 and c = 202;
+update t1 set b = @v9, d = @v1 where a = 3 and c = 302;
+select a, sha1(b), c, sha1(d) from t1 order by a;
+
+# -- hash index update --
+update t1 set b = @v4, d = @v5 where c = 103;
+update t1 set b = @v7, d = @v8 where c = 203;
+update t1 set b = @v1, d = @v2 where c = 303;
+select a, sha1(b), c, sha1(d) from t1 order by a;
+
+# -- full scan update --
+update t1 set b = @v5, d = @v6;
+select a, sha1(b), c, sha1(d) from t1 order by a;
+
+# -- range scan update
+update t1 set b = @v1, d = @v2 where 100 < c and c < 200;
+update t1 set b = @v4, d = @v5 where 200 < c and c < 300;
+update t1 set b = @v7, d = @v8 where 300 < c and c < 400;
+select a, sha1(b), c, sha1(d) from t1 order by a;
+
+# -- delete --
+delete from t1 where a = 1 and c = 101;
+delete from t1 where c = 102;
+# delete from t1 where c < 300; # XXX coredump
+delete from t1;
+select a, sha1(b), c, sha1(d) from t1 order by a;
+
+# -- clean up --
+drop table t1;
diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test
index 536ab68a694..272cdc27af6 100644
--- a/mysql-test/t/partition.test
+++ b/mysql-test/t/partition.test
@@ -989,6 +989,11 @@ PARTITION BY LIST (a)
SHOW CREATE TABLE t1;
DROP TABLE t1;
+--error 1064
+CREATE TABLE t1 (a int)
+PARTITION BY RANGE(a)
+(PARTITION p0 VALUES LESS THAN (NULL));
+
#
# Bug#18753 Partitions: auto_increment fails
#