summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <rburnett@bk-internal.mysql.com>2006-05-25 17:47:26 +0200
committerunknown <rburnett@bk-internal.mysql.com>2006-05-25 17:47:26 +0200
commit20334ba61e153605cfb2b38580cd748927b7dde7 (patch)
tree92c752e2c69bc3e1ccd5016ab62677ec2b5148ae /mysql-test
parenta7beb302226ec5de810df1f231fa5265cb432fae (diff)
parent2e0f0d2d5cbc6ec3fc18bd433926f598e06366ce (diff)
downloadmariadb-git-20334ba61e153605cfb2b38580cd748927b7dde7.tar.gz
Merge bk-internal.mysql.com:/data0/bk/mysql-5.1-new
into bk-internal.mysql.com:/data0/bk/mysql-5.1-kt sql/share/errmsg.txt: Auto merged
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/information_schema.result13
-rw-r--r--mysql-test/r/ndb_alter_table.result23
-rw-r--r--mysql-test/r/ndb_basic.result48
-rw-r--r--mysql-test/r/partition.result14
-rw-r--r--mysql-test/r/strict.result10
-rw-r--r--mysql-test/r/type_ranges.result4
-rw-r--r--mysql-test/r/view.result42
-rw-r--r--mysql-test/t/information_schema.test18
-rw-r--r--mysql-test/t/ndb_alter_table.test17
-rw-r--r--mysql-test/t/partition.test21
-rw-r--r--mysql-test/t/strict.test10
-rw-r--r--mysql-test/t/view.test29
12 files changed, 221 insertions, 28 deletions
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index 9aeaae6c6c1..603b7815d5b 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -1162,3 +1162,16 @@ select user,db from information_schema.processlist;
user db
user3148 test
drop user user3148@localhost;
+grant select on test.* to mysqltest_1@localhost;
+create table t1 (id int);
+create view v1 as select * from t1;
+create definer = mysqltest_1@localhost
+sql security definer view v2 as select 1;
+select * from information_schema.views
+where table_name='v1' or table_name='v2';
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
+NULL test v1 NONE YES root@localhost DEFINER
+NULL test v2 select 1 AS `1` NONE NO mysqltest_1@localhost DEFINER
+drop view v1, v2;
+drop table t1;
+drop user mysqltest_1@localhost;
diff --git a/mysql-test/r/ndb_alter_table.result b/mysql-test/r/ndb_alter_table.result
index 7c687ff33a1..e506973f347 100644
--- a/mysql-test/r/ndb_alter_table.result
+++ b/mysql-test/r/ndb_alter_table.result
@@ -1,4 +1,4 @@
-DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t1, t2;
drop database if exists mysqltest;
CREATE TABLE t1 (
a INT NOT NULL,
@@ -328,3 +328,24 @@ select 'no_copy' from ndb_show_tables where id = @t1_id and name like '%t1%';
no_copy
no_copy
DROP TABLE t1, ndb_show_tables;
+create table t1 (a int primary key auto_increment, b int) engine=ndb;
+insert into t1 (b) values (101),(102),(103);
+select * from t1 where a = 3;
+a b
+3 103
+alter table t1 rename t2;
+insert into t2 (b) values (201),(202),(203);
+select * from t2 where a = 6;
+a b
+6 203
+alter table t2 add c int;
+insert into t2 (b) values (301),(302),(303);
+select * from t2 where a = 9;
+a b c
+9 303 NULL
+alter table t2 rename t1;
+insert into t1 (b) values (401),(402),(403);
+select * from t1 where a = 12;
+a b c
+12 403 NULL
+drop table t1;
diff --git a/mysql-test/r/ndb_basic.result b/mysql-test/r/ndb_basic.result
index 4a1f5f587df..b8bafd398fe 100644
--- a/mysql-test/r/ndb_basic.result
+++ b/mysql-test/r/ndb_basic.result
@@ -642,30 +642,30 @@ counter datavalue
6 newval
7 newval
8 newval
-35 newval
-36 newval
-37 newval
-38 newval
-39 newval
-40 newval
-41 newval
-42 newval
-43 newval
-44 newval
-45 newval
-46 newval
-47 newval
-48 newval
-49 newval
-50 newval
-51 newval
-52 newval
-53 newval
-54 newval
-55 newval
-56 newval
-57 newval
-58 newval
+9 newval
+10 newval
+11 newval
+12 newval
+13 newval
+14 newval
+15 newval
+16 newval
+17 newval
+18 newval
+19 newval
+20 newval
+21 newval
+22 newval
+23 newval
+24 newval
+25 newval
+26 newval
+27 newval
+28 newval
+29 newval
+30 newval
+31 newval
+32 newval
drop table t1;
CREATE TABLE t1 ( b INT ) PACK_KEYS = 0 ENGINE = ndb;
select * from t1;
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index a4dd5f9a64e..3be9f3edee2 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -895,6 +895,10 @@ partition by key(a);
insert into t1 values (1);
create index inx1 on t1(a);
drop table t1;
+create table t1 (a int)
+partition by key (a)
+(partition p0 engine = MERGE);
+ERROR HY000: MyISAM Merge handler cannot be used in partitioned tables
create table t1 (a varchar(1))
partition by key (a)
as select 'a';
@@ -922,4 +926,14 @@ CREATE TABLE t1 (a int, index(a)) PARTITION BY KEY(a);
ALTER TABLE t1 DISABLE KEYS;
ALTER TABLE t1 ENABLE KEYS;
DROP TABLE t1;
+create table t1 (a int)
+engine=MEMORY
+partition by key (a);
+REPAIR TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 repair note The storage engine for the table doesn't support repair
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note The storage engine for the table doesn't support optimize
+drop table t1;
End of 5.1 tests
diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result
index 92f1ba3a23e..5ca185d6abc 100644
--- a/mysql-test/r/strict.result
+++ b/mysql-test/r/strict.result
@@ -1288,3 +1288,13 @@ ERROR 22001: Data too long for column 'a' at row 1
select * from t1;
a
drop table t1;
+set sql_mode='traditional';
+create table t1 (date date not null);
+create table t2 select date from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `date` date NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t2,t1;
+set @@sql_mode= @org_mode;
diff --git a/mysql-test/r/type_ranges.result b/mysql-test/r/type_ranges.result
index 0ba8916f5b1..ba401a22945 100644
--- a/mysql-test/r/type_ranges.result
+++ b/mysql-test/r/type_ranges.result
@@ -241,7 +241,7 @@ Field Type Collation Null Key Default Extra Privileges Comment
auto int(5) unsigned NULL NO 0 #
string char(10) latin1_swedish_ci YES newdefault #
tiny tinyint(4) NULL NO 0 #
-short smallint(6) NULL NO 0 #
+short smallint(6) NULL NO #
medium mediumint(8) NULL NO 0 #
long_int int(11) NULL NO 0 #
longlong bigint(13) NULL NO 0 #
@@ -259,7 +259,7 @@ date_time datetime NULL YES NULL #
new_blob_col varchar(20) latin1_swedish_ci YES NULL #
tinyblob_col tinyblob NULL YES NULL #
mediumblob_col mediumblob NULL NO #
-options enum('one','two','tree') latin1_swedish_ci NO one #
+options enum('one','two','tree') latin1_swedish_ci NO #
flags set('one','two','tree') latin1_swedish_ci NO #
new_field char(10) latin1_swedish_ci NO new #
select t1.auto,t2.auto from t1,t2 where t1.auto=t2.auto and ((t1.string<>t2.string and (t1.string is not null or t2.string is not null)) or (t1.tiny<>t2.tiny and (t1.tiny is not null or t2.tiny is not null)) or (t1.short<>t2.short and (t1.short is not null or t2.short is not null)) or (t1.medium<>t2.medium and (t1.medium is not null or t2.medium is not null)) or (t1.long_int<>t2.long_int and (t1.long_int is not null or t2.long_int is not null)) or (t1.longlong<>t2.longlong and (t1.longlong is not null or t2.longlong is not null)) or (t1.real_float<>t2.real_float and (t1.real_float is not null or t2.real_float is not null)) or (t1.real_double<>t2.real_double and (t1.real_double is not null or t2.real_double is not null)) or (t1.utiny<>t2.utiny and (t1.utiny is not null or t2.utiny is not null)) or (t1.ushort<>t2.ushort and (t1.ushort is not null or t2.ushort is not null)) or (t1.umedium<>t2.umedium and (t1.umedium is not null or t2.umedium is not null)) or (t1.ulong<>t2.ulong and (t1.ulong is not null or t2.ulong is not null)) or (t1.ulonglong<>t2.ulonglong and (t1.ulonglong is not null or t2.ulonglong is not null)) or (t1.time_stamp<>t2.time_stamp and (t1.time_stamp is not null or t2.time_stamp is not null)) or (t1.date_field<>t2.date_field and (t1.date_field is not null or t2.date_field is not null)) or (t1.time_field<>t2.time_field and (t1.time_field is not null or t2.time_field is not null)) or (t1.date_time<>t2.date_time and (t1.date_time is not null or t2.date_time is not null)) or (t1.new_blob_col<>t2.new_blob_col and (t1.new_blob_col is not null or t2.new_blob_col is not null)) or (t1.tinyblob_col<>t2.tinyblob_col and (t1.tinyblob_col is not null or t2.tinyblob_col is not null)) or (t1.mediumblob_col<>t2.mediumblob_col and (t1.mediumblob_col is not null or t2.mediumblob_col is not null)) or (t1.options<>t2.options and (t1.options is not null or t2.options is not null)) or (t1.flags<>t2.flags and (t1.flags is not null or t2.flags is not null)) or (t1.new_field<>t2.new_field and (t1.new_field is not null or t2.new_field is not null)));
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 9dba51c26d9..10a9ac87748 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -2694,3 +2694,45 @@ Age
38
DROP VIEW v1;
DROP TABLE t1;
+CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, a char(6) DEFAULT 'xxx');
+INSERT INTO t1(id) VALUES (1), (2), (3), (4);
+INSERT INTO t1 VALUES (5,'yyy'), (6,'yyy');
+SELECT * FROM t1;
+id a
+1 xxx
+2 xxx
+3 xxx
+4 xxx
+5 yyy
+6 yyy
+CREATE VIEW v1(a, m) AS SELECT a, MIN(id) FROM t1 GROUP BY a;
+SELECT * FROM v1;
+a m
+xxx 1
+yyy 5
+CREATE TABLE t2 SELECT * FROM v1;
+INSERT INTO t2(m) VALUES (0);
+SELECT * FROM t2;
+a m
+xxx 1
+yyy 5
+xxx 0
+DROP VIEW v1;
+DROP TABLE t1,t2;
+CREATE TABLE t1 (id int PRIMARY KEY, e ENUM('a','b') NOT NULL DEFAULT 'b');
+INSERT INTO t1(id) VALUES (1), (2), (3);
+INSERT INTO t1 VALUES (4,'a');
+SELECT * FROM t1;
+id e
+1 b
+2 b
+3 b
+4 a
+CREATE VIEW v1(m, e) AS SELECT MIN(id), e FROM t1 GROUP BY e;
+CREATE TABLE t2 SELECT * FROM v1;
+SELECT * FROM t2;
+m e
+4 a
+1 b
+DROP VIEW v1;
+DROP TABLE IF EXISTS t1,t2;
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index 274b4eae71f..4db108e1b40 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -846,4 +846,22 @@ select user,db from information_schema.processlist;
connection default;
drop user user3148@localhost;
+#
+# Bug#16681 information_schema shows forbidden VIEW details
+#
+grant select on test.* to mysqltest_1@localhost;
+create table t1 (id int);
+create view v1 as select * from t1;
+create definer = mysqltest_1@localhost
+sql security definer view v2 as select 1;
+
+connect (con16681,localhost,mysqltest_1,,test);
+connection con16681;
+
+select * from information_schema.views
+where table_name='v1' or table_name='v2';
+connection default;
+drop view v1, v2;
+drop table t1;
+drop user mysqltest_1@localhost;
diff --git a/mysql-test/t/ndb_alter_table.test b/mysql-test/t/ndb_alter_table.test
index 29deea4aa0d..8e3b4a6ca89 100644
--- a/mysql-test/t/ndb_alter_table.test
+++ b/mysql-test/t/ndb_alter_table.test
@@ -3,7 +3,7 @@
-- source include/not_embedded.inc
--disable_warnings
-DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t1, t2;
drop database if exists mysqltest;
--enable_warnings
@@ -383,3 +383,18 @@ LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
select 'no_copy' from ndb_show_tables where id = @t1_id and name like '%t1%';
DROP TABLE t1, ndb_show_tables;
+
+# simple test that auto incr is not lost at rename or alter
+create table t1 (a int primary key auto_increment, b int) engine=ndb;
+insert into t1 (b) values (101),(102),(103);
+select * from t1 where a = 3;
+alter table t1 rename t2;
+insert into t2 (b) values (201),(202),(203);
+select * from t2 where a = 6;
+alter table t2 add c int;
+insert into t2 (b) values (301),(302),(303);
+select * from t2 where a = 9;
+alter table t2 rename t1;
+insert into t1 (b) values (401),(402),(403);
+select * from t1 where a = 12;
+drop table t1;
diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test
index 1a64537b6fc..a24124d3fb5 100644
--- a/mysql-test/t/partition.test
+++ b/mysql-test/t/partition.test
@@ -1024,6 +1024,14 @@ create index inx1 on t1(a);
drop table t1;
#
+# BUG 19304 Partitions: MERGE handler not allowed in partitioned tables
+#
+--error ER_PARTITION_MERGE_ERROR
+create table t1 (a int)
+partition by key (a)
+(partition p0 engine = MERGE);
+
+#
# BUG 19062 Partition clause ignored if CREATE TABLE ... AS SELECT ...;
#
create table t1 (a varchar(1))
@@ -1056,4 +1064,17 @@ ALTER TABLE t1 DISABLE KEYS;
ALTER TABLE t1 ENABLE KEYS;
DROP TABLE t1;
+#
+# Bug 17455 Partitions: Wrong message and error when using Repair/Optimize
+# table on partitioned table
+#
+create table t1 (a int)
+engine=MEMORY
+partition by key (a);
+
+REPAIR TABLE t1;
+OPTIMIZE TABLE t1;
+
+drop table t1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/strict.test b/mysql-test/t/strict.test
index 54260b09331..212150e057c 100644
--- a/mysql-test/t/strict.test
+++ b/mysql-test/t/strict.test
@@ -1145,3 +1145,13 @@ create table t1(a bit(2));
insert into t1 values(b'101');
select * from t1;
drop table t1;
+
+#
+# Bug#17626 CREATE TABLE ... SELECT failure with TRADITIONAL SQL mode
+#
+set sql_mode='traditional';
+create table t1 (date date not null);
+create table t2 select date from t1;
+show create table t2;
+drop table t2,t1;
+set @@sql_mode= @org_mode;
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index ae633b2cc38..535ba3da7fa 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -2571,4 +2571,33 @@ SELECT * FROM v1;
DROP VIEW v1;
DROP TABLE t1;
+#
+# Bug #19089: wrong inherited dafault values in temp table views
+#
+
+CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, a char(6) DEFAULT 'xxx');
+INSERT INTO t1(id) VALUES (1), (2), (3), (4);
+INSERT INTO t1 VALUES (5,'yyy'), (6,'yyy');
+SELECT * FROM t1;
+
+CREATE VIEW v1(a, m) AS SELECT a, MIN(id) FROM t1 GROUP BY a;
+SELECT * FROM v1;
+
+CREATE TABLE t2 SELECT * FROM v1;
+INSERT INTO t2(m) VALUES (0);
+SELECT * FROM t2;
+DROP VIEW v1;
+DROP TABLE t1,t2;
+
+CREATE TABLE t1 (id int PRIMARY KEY, e ENUM('a','b') NOT NULL DEFAULT 'b');
+INSERT INTO t1(id) VALUES (1), (2), (3);
+INSERT INTO t1 VALUES (4,'a');
+SELECT * FROM t1;
+
+CREATE VIEW v1(m, e) AS SELECT MIN(id), e FROM t1 GROUP BY e;
+CREATE TABLE t2 SELECT * FROM v1;
+SELECT * FROM t2;
+
+DROP VIEW v1;
+DROP TABLE IF EXISTS t1,t2;