summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <ingo@mysql.com>2005-08-30 12:35:37 +0200
committerunknown <ingo@mysql.com>2005-08-30 12:35:37 +0200
commit68e31099b087819a5667751f017bed7cee166f25 (patch)
tree53c1440916313313e88f5095f3618810e0090262 /mysql-test
parentb9f94a911f274ca5a260850554698d78680a7768 (diff)
parente795dc207fd421fed02c9e21fa6dfc75932f11c4 (diff)
downloadmariadb-git-68e31099b087819a5667751f017bed7cee166f25.tar.gz
Merge mysql.com:/home/mydev/mysql-5.0
into mysql.com:/home/mydev/mysql-5.0-5000 mysql-test/r/innodb.result: Auto merged mysql-test/t/innodb.test: Auto merged sql/sql_parse.cc: Auto merged sql/sql_delete.cc: After merge fix.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/alter_table.result15
-rw-r--r--mysql-test/r/innodb.result18
-rw-r--r--mysql-test/r/key.result17
-rw-r--r--mysql-test/r/myisam.result20
-rw-r--r--mysql-test/t/alter_table.test31
-rw-r--r--mysql-test/t/innodb.test18
-rw-r--r--mysql-test/t/key.test17
-rw-r--r--mysql-test/t/myisam.test25
8 files changed, 160 insertions, 1 deletions
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index dd7c5ed4407..6a710a8de10 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -541,3 +541,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 9253c635cb0..d7f7536d401 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;
@@ -1749,7 +1765,7 @@ Variable_name Value
Innodb_rows_deleted 2070
show status like "Innodb_rows_inserted";
Variable_name Value
-Innodb_rows_inserted 31718
+Innodb_rows_inserted 31722
show status like "Innodb_rows_updated";
Variable_name Value
Innodb_rows_updated 29530
diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result
index bce02a1cb0f..bc9d3935bc4 100644
--- a/mysql-test/r/key.result
+++ b/mysql-test/r/key.result
@@ -329,6 +329,23 @@ 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
+drop table t1;
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 71cb76fe844..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 ---
@@ -1274,3 +1288,9 @@ show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 1 a 1 a A 8 NULL NULL YES BTREE
drop table t1;
+create table t1 (c1 int) engine=myisam pack_keys=0;
+create table t2 (c1 int) engine=myisam pack_keys=1;
+create table t3 (c1 int) engine=myisam pack_keys=default;
+create table t4 (c1 int) engine=myisam pack_keys=2;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '2' at line 1
+drop table t1, t2, t3;
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index 003662fc956..5695822be6b 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -369,4 +369,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 2ece3744524..18c27cee3ad 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..31763b84379 100644
--- a/mysql-test/t/key.test
+++ b/mysql-test/t/key.test
@@ -326,6 +326,23 @@ 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;
+drop table 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 dfb00d5686c..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
#
@@ -675,4 +690,14 @@ show keys from t1;
drop table t1;
+#
+# Bug#10056 - PACK_KEYS option take values greater than 1 while creating table
+#
+create table t1 (c1 int) engine=myisam pack_keys=0;
+create table t2 (c1 int) engine=myisam pack_keys=1;
+create table t3 (c1 int) engine=myisam pack_keys=default;
+--error 1064
+create table t4 (c1 int) engine=myisam pack_keys=2;
+drop table t1, t2, t3;
+
# End of 4.1 tests