diff options
author | unknown <ingo@mysql.com> | 2005-08-29 18:18:30 +0200 |
---|---|---|
committer | unknown <ingo@mysql.com> | 2005-08-29 18:18:30 +0200 |
commit | 194a520d215ff8a3f5fd672e3bb1fc991ec38dc8 (patch) | |
tree | d775a19ce336b9046b4bba8758999a325c8182fe /mysql-test | |
parent | 27201ccb064b7b2e851ada4610d7b20ffc37679d (diff) | |
parent | ea363750277d129ff466c51fd7e278d09c85a709 (diff) | |
download | mariadb-git-194a520d215ff8a3f5fd672e3bb1fc991ec38dc8.tar.gz |
Merge mysql.com:/home/mydev/mysql-4.1-4100
into mysql.com:/home/mydev/mysql-5.0-5000
myisam/mi_search.c:
Auto merged
mysql-test/r/alter_table.result:
Auto merged
mysql-test/t/alter_table.test:
Auto merged
mysql-test/t/innodb.test:
Auto merged
sql/sql_table.cc:
Auto merged
mysql-test/r/innodb.result:
Hand merged.
mysql-test/r/key.result:
Hand merged.
mysql-test/r/myisam.result:
Hand merged.
mysql-test/t/key.test:
Hand merged.
mysql-test/t/myisam.test:
Hand merged.
sql/sql_delete.cc:
Hand merged.
sql/sql_parse.cc:
Hand merged.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/alter_table.result | 15 | ||||
-rw-r--r-- | mysql-test/r/innodb.result | 16 | ||||
-rw-r--r-- | mysql-test/r/key.result | 16 | ||||
-rw-r--r-- | mysql-test/r/myisam.result | 14 | ||||
-rw-r--r-- | mysql-test/t/alter_table.test | 31 | ||||
-rw-r--r-- | mysql-test/t/innodb.test | 18 | ||||
-rw-r--r-- | mysql-test/t/key.test | 14 | ||||
-rw-r--r-- | mysql-test/t/myisam.test | 15 |
8 files changed, 139 insertions, 0 deletions
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 9f127181fc2..5723ae115f2 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -537,3 +537,18 @@ create table t1 ( a timestamp ); alter table t1 add unique ( a(1) ); ERROR HY000: Incorrect sub part key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique sub keys drop table t1; +create database mysqltest1; +create table t1 (c1 int); +alter table t1 rename mysqltest1.t1; +drop table t1; +ERROR 42S02: Unknown table 't1' +alter table mysqltest1.t1 rename t1; +drop table t1; +create table t1 (c1 int); +use mysqltest1; +drop database mysqltest1; +alter table test.t1 rename t1; +ERROR 3D000: No database selected +alter table test.t1 rename test.t1; +use test; +drop table t1; diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 4b62e63c49b..5114b2ead0e 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1703,6 +1703,22 @@ a_id b_list 3 NULL DROP TABLE t2; DROP TABLE t1; +create temporary table t1 (a int) engine=innodb; +insert into t1 values (4711); +truncate t1; +insert into t1 values (42); +select * from t1; +a +42 +drop table t1; +create table t1 (a int) engine=innodb; +insert into t1 values (4711); +truncate t1; +insert into t1 values (42); +select * from t1; +a +42 +drop table t1; create table t1 (x bigint unsigned not null primary key) engine=innodb; insert into t1(x) values (0xfffffffffffffff0),(0xfffffffffffffff1); select * from t1; diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result index bce02a1cb0f..643ba2b4dee 100644 --- a/mysql-test/r/key.result +++ b/mysql-test/r/key.result @@ -329,6 +329,22 @@ ERROR 42S21: Duplicate column name 'c1' alter table t1 add key (c1,c1,c2); ERROR 42S21: Duplicate column name 'c1' drop table t1; +create table t1 ( +c1 int, +c2 varchar(20) not null, +primary key (c1), +key (c2(10)) +) engine=myisam; +insert into t1 values (1,''); +insert into t1 values (2,' \t\tTest String'); +insert into t1 values (3,' \n\tTest String'); +update t1 set c2 = 'New Test String' where c1 = 1; +select * from t1; +c1 c2 +1 New Test String +2 Test String +3 + Test String create table t1 (a varchar(10), b varchar(10), key(a(10),b(10))); show create table t1; Table Create Table diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index 3501283cc62..ce215d6a7d8 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -594,6 +594,20 @@ check table t1; Table Op Msg_type Msg_text test.t1 check status OK drop table t1; +create table t1 (c1 int); +insert into t1 values (1),(2),(3),(4); +checksum table t1; +Table Checksum +test.t1 149057747 +delete from t1 where c1 = 1; +create table t2 as select * from t1; +checksum table t1; +Table Checksum +test.t1 984116287 +checksum table t2; +Table Checksum +test.t2 984116287 +drop table t1, t2; set storage_engine=MyISAM; drop table if exists t1,t2,t3; --- Testing varchar --- diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index a237b21f403..9bd34c2a610 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -361,4 +361,35 @@ create table t1 ( a timestamp ); alter table t1 add unique ( a(1) ); drop table t1; +# +# Bug#11493 - Alter table rename to default database does not work without +# db name qualifying +# +create database mysqltest1; +create table t1 (c1 int); +# Move table to other database. +alter table t1 rename mysqltest1.t1; +# Assure that it has moved. +--error 1051 +drop table t1; +# Move table back. +alter table mysqltest1.t1 rename t1; +# Assure that it is back. +drop table t1; +# Now test for correct message if no database is selected. +# Create t1 in 'test'. +create table t1 (c1 int); +# Change to other db. +use mysqltest1; +# Drop the current db. This de-selects any db. +drop database mysqltest1; +# Now test for correct message. +--error 1046 +alter table test.t1 rename t1; +# Check that explicit qualifying works even with no selected db. +alter table test.t1 rename test.t1; +# Go back to standard 'test' db. +use test; +drop table t1; + # End of 4.1 tests diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index bf094dd0e5d..b12ddc830ad 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1231,6 +1231,24 @@ SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t DROP TABLE t2; DROP TABLE t1; +# +# Bug#11816 - Truncate table doesn't work with temporary innodb tables +# This is not an innodb bug, but we test it using innodb. +# +create temporary table t1 (a int) engine=innodb; +insert into t1 values (4711); +truncate t1; +insert into t1 values (42); +select * from t1; +drop table t1; +# Show that it works with permanent tables too. +create table t1 (a int) engine=innodb; +insert into t1 values (4711); +truncate t1; +insert into t1 values (42); +select * from t1; +drop table t1; + # End of 4.1 tests # diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test index 91bd1ada8a4..ed9e15aa7cb 100644 --- a/mysql-test/t/key.test +++ b/mysql-test/t/key.test @@ -326,6 +326,20 @@ alter table t1 add key (c1,c1,c2); drop table t1; # +# Bug#12565 - ERROR 1034 when running simple UPDATE or DELETE +# on large MyISAM table +# +create table t1 ( + c1 int, + c2 varchar(20) not null, + primary key (c1), + key (c2(10)) +) engine=myisam; +insert into t1 values (1,''); +insert into t1 values (2,' \t\tTest String'); +insert into t1 values (3,' \n\tTest String'); +update t1 set c2 = 'New Test String' where c1 = 1; +select * from t1; # If we use a partial field for a key that is actually the length of the # field, and we extend the field, we end up with a key that includes the # whole new length of the field. diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index a1ccdccb8c3..eeac2971788 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -563,6 +563,21 @@ update t1 set c2='A B' where c1=2; check table t1; drop table t1; + +# +# Bug#12296 - CHECKSUM TABLE reports 0 for the table +# This happened if the first record was marked as deleted. +# +create table t1 (c1 int); +insert into t1 values (1),(2),(3),(4); +checksum table t1; +delete from t1 where c1 = 1; +create table t2 as select * from t1; +# The following returns 0 with the bug in place. +checksum table t1; +# The above should give the same number as the following. +checksum table t2; +drop table t1, t2; # # Test varchar # |