From 0fae7e3b014f61dc645adcce6649f48ee1b34c88 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 Apr 2006 17:35:07 -0400 Subject: Bug#18265: mysql client: No longer right-justifies numeric columns Also fixes a new bug for which "NULL" wasn't printed (because the data it represents has length zero). (Discovered my Paul DuBois.) client/mysql.cc: Cleaned up the interactive-session table-printing function. - No longer rely on the length of the data to pad column boundries. - Be smarter about how we detect if the column is NULL. - Document how multibyte characters affect the output printing. - Use more descriptive variable names. More importantly, (re-)add these features that were crippled in an earlier change: - Print "NULL". - Right-justify numbers. mysql-test/r/mysql.result: Updated old result and added new case. mysql-test/t/mysql.test: Added new test case. --- mysql-test/t/mysql.test | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mysql-test/t') 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;" + -- cgit v1.2.1 From 79002cd02edcf855516838edc3a82cc4c97b6be6 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 Apr 2006 22:29:11 -0400 Subject: BUG#18752: Also handle NULL values in VALUES LESS THAN mysql-test/r/partition.result: Added test case to verify that VALUES LESS THAN (NULL) isn't allowed mysql-test/t/partition.test: Added test case to verify that VALUES LESS THAN (NULL) isn't allowed sql/share/errmsg.txt: Added new error message sql/sql_yacc.yy: Added error check for null value --- mysql-test/t/partition.test | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 4eb27765f5f..9c73c00d2df 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -965,4 +965,9 @@ 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)); + --echo End of 5.1 tests -- cgit v1.2.1 From 1ef739636a275f1c0e7bb56f891160b77d4cf43b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Apr 2006 16:13:57 +0500 Subject: Fix for bug #14360: Date Between Interval Broken. mysql-test/r/innodb.result: Fix for bug #14360: Date Between Interval Broken. - test case. mysql-test/t/innodb.test: Fix for bug #14360: Date Between Interval Broken. - test case. sql/item_timefunc.cc: Fix for bug #14360: Date Between Interval Broken. - Item_date_add_interval::eq() introduced. sql/item_timefunc.h: Fix for bug #14360: Date Between Interval Broken. - Item_date_add_interval::eq() introduced. --- mysql-test/t/innodb.test | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 832c4635815..b0835cd8419 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -2127,3 +2127,15 @@ drop table t1, t2, t3, t4, t5; connection default; disconnect a; disconnect b; + +# +# 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; -- cgit v1.2.1 From 3e21b9d0dad908d1e0b0d414bf2186fa24e05616 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Apr 2006 11:39:36 -0400 Subject: Hand-merged test. --- mysql-test/t/innodb.test | 54 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index b0835cd8419..63349adfd59 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -2128,6 +2128,60 @@ connection default; disconnect a; disconnect b; +# +# Test that cascading updates leading to duplicate keys give the correct +# error message (bug #9680) +# + +CREATE TABLE t1 ( + field1 varchar(8) NOT NULL DEFAULT '', + field2 varchar(8) NOT NULL DEFAULT '', + PRIMARY KEY (field1, field2) +) ENGINE=InnoDB; + +CREATE TABLE t2 ( + field1 varchar(8) NOT NULL DEFAULT '' PRIMARY KEY, + FOREIGN KEY (field1) REFERENCES t1 (field1) + ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB; + +INSERT INTO t1 VALUES ('old', 'somevalu'); +INSERT INTO t1 VALUES ('other', 'anyvalue'); + +INSERT INTO t2 VALUES ('old'); +INSERT INTO t2 VALUES ('other'); + +--error ER_FOREIGN_DUPLICATE_KEY +UPDATE t1 SET field1 = 'other' WHERE field2 = 'somevalu'; + +DROP TABLE t2; +DROP TABLE t1; + +# +# Bug#18477 - MySQL/InnoDB Ignoring Foreign Keys in ALTER TABLE +# +create table t1 ( + c1 bigint not null, + c2 bigint not null, + primary key (c1), + unique key (c2) +) engine=innodb; +# +create table t2 ( + c1 bigint not null, + primary key (c1) +) engine=innodb; +# +alter table t1 add constraint c2_fk foreign key (c2) + references t2(c1) on delete cascade; +show create table t1; +# +alter table t1 drop foreign key c2_fk; +show create table t1; +# +drop table t1, t2; + + # # Bug #14360: problem with intervals # -- cgit v1.2.1 From 1540407e60ef07225d7a0482c1546c2c833bc94e Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 16 Apr 2006 21:55:02 -0700 Subject: Fixed a few pieces around support for data directory. mysql-test/r/archive.result: Adding test case for data directory support in create table. mysql-test/t/archive.test: Added test for "data directory" support in archive. sql/ha_archive.cc: Updated comments, added printable bits for support of "data directory" sql/ha_archive.h: Added real_path to share (will come in handy in later code) --- mysql-test/t/archive.test | 3 +++ 1 file changed, 3 insertions(+) (limited to 'mysql-test/t') 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 # -- cgit v1.2.1 From feb80054f050f3d67c83fc27e9618d4194a1c78d Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Apr 2006 20:24:41 +0200 Subject: ndb - bug#16796 storage/ndb/src/ndbapi/NdbBlob.cpp: set part id from main table op (may not be complete fix) storage/ndb/src/ndbapi/NdbOperationSearch.cpp: log partition id set/get --- mysql-test/t/ndb_blob_partition.test | 93 ++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 mysql-test/t/ndb_blob_partition.test (limited to 'mysql-test/t') 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; -- cgit v1.2.1 From 73c03f8ae954c847996fde6327d2add3ef5682b0 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Apr 2006 18:57:01 -0400 Subject: Fixing a merge from a few days ago. Without a flush this test is nondeterministic for "row" binlog-format. mysql-test/r/innodb.result: Without a flush this test is nondeterministic for "row" binlog-format. mysql-test/t/innodb.test: Without a flush this test is nondeterministic for "row" binlog-format. --- mysql-test/t/innodb.test | 1 + 1 file changed, 1 insertion(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 63349adfd59..18b47c39a10 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1146,6 +1146,7 @@ drop table t2, t1; # 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"; -- cgit v1.2.1