summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <rburnett@bk-internal.mysql.com>2006-08-17 17:19:41 +0200
committerunknown <rburnett@bk-internal.mysql.com>2006-08-17 17:19:41 +0200
commitb32b2ce7afa830257a1052f70b57eb3f3a38710f (patch)
treedbb8d11912bd8c6bbb4edc32d540effe9cce852b /mysql-test
parent0073d9be28f42e7d6856e6c6e9496b4fa65d0868 (diff)
parent90b069ed34c293f7eb55f7827dd9fd086ff78015 (diff)
downloadmariadb-git-b32b2ce7afa830257a1052f70b57eb3f3a38710f.tar.gz
Merge bk-internal.mysql.com:/data0/bk/tmp_reg
into bk-internal.mysql.com:/data0/bk/mysql-5.1 client/mysql.cc: Auto merged mysql-test/r/ctype_utf8.result: Auto merged mysql-test/r/gis.result: Auto merged mysql-test/r/grant.result: Auto merged mysql-test/r/im_life_cycle.result: Auto merged mysql-test/r/information_schema_db.result: Auto merged mysql-test/r/type_newdecimal.result: Auto merged mysql-test/r/type_ranges.result: Auto merged mysql-test/r/type_timestamp.result: Auto merged mysql-test/t/ctype_utf8.test: Auto merged mysql-test/t/gis.test: Auto merged mysql-test/t/im_life_cycle.imtest: Auto merged mysql-test/t/type_newdecimal.test: Auto merged mysql-test/t/type_timestamp.test: Auto merged server-tools/instance-manager/messages.cc: Auto merged sql/item_geofunc.h: Auto merged sql/mysqld.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_view.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/table.h: Auto merged sql/share/errmsg.txt: Auto merged tests/mysql_client_test.c: Auto merged
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/ctype_utf8.result12
-rw-r--r--mysql-test/r/gis.result9
-rw-r--r--mysql-test/r/grant.result2
-rw-r--r--mysql-test/r/im_life_cycle.result3
-rw-r--r--mysql-test/r/information_schema_db.result47
-rw-r--r--mysql-test/r/type_newdecimal.result6
-rw-r--r--mysql-test/r/type_ranges.result6
-rw-r--r--mysql-test/r/type_timestamp.result33
-rw-r--r--mysql-test/t/ctype_utf8.test11
-rw-r--r--mysql-test/t/gis.test8
-rw-r--r--mysql-test/t/im_life_cycle.imtest8
-rw-r--r--mysql-test/t/information_schema_db.test57
-rw-r--r--mysql-test/t/type_newdecimal.test8
-rw-r--r--mysql-test/t/type_timestamp.test11
14 files changed, 202 insertions, 19 deletions
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 6e75e447763..c4c322ae2d0 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -1066,6 +1066,18 @@ LENGTH(bug)
100
DROP TABLE t2;
DROP TABLE t1;
+CREATE TABLE t1 (item varchar(255)) default character set utf8;
+INSERT INTO t1 VALUES (N'\\');
+INSERT INTO t1 VALUES (_utf8'\\');
+INSERT INTO t1 VALUES (N'Cote d\'Ivoire');
+INSERT INTO t1 VALUES (_utf8'Cote d\'Ivoire');
+SELECT item FROM t1 ORDER BY item;
+item
+Cote d'Ivoire
+Cote d'Ivoire
+\
+\
+DROP TABLE t1;
SET NAMES utf8;
DROP TABLE IF EXISTS t1;
Warnings:
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index 8fff04508d1..76e1bd323ae 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -574,11 +574,11 @@ INSERT INTO t1 VALUES(GeomFromText('POINT(367894677 368542487)'));
INSERT INTO t1 VALUES(GeomFromText('POINT(580848489 219587743)'));
INSERT INTO t1 VALUES(GeomFromText('POINT(11247614 782797569)'));
drop table t1;
-create table t1 select POINT(1,3);
+create table t1 select GeomFromWKB(POINT(1,3));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `POINT(1,3)` longblob NOT NULL
+ `GeomFromWKB(POINT(1,3))` geometry NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
CREATE TABLE `t1` (`object_id` bigint(20) unsigned NOT NULL default '0', `geo`
@@ -706,3 +706,8 @@ Catalog Database Table Table_alias Column Column_alias Type Length Max length Is
def asbinary(g) 252 8192 0 Y 128 0 63
asbinary(g)
drop table t1;
+create table t1 select GeomFromText('point(1 1)');
+desc t1;
+Field Type Null Key Default Extra
+GeomFromText('point(1 1)') geometry NO
+drop table t1;
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
index 2a95b8effcf..07bd352fb65 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -528,7 +528,7 @@ Db char(64) NO PRI
User char(16) NO PRI
Table_name char(64) NO PRI
Grantor char(77) NO MUL
-Timestamp timestamp YES CURRENT_TIMESTAMP
+Timestamp timestamp NO CURRENT_TIMESTAMP
Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') NO
Column_priv set('Select','Insert','Update','References') NO
use test;
diff --git a/mysql-test/r/im_life_cycle.result b/mysql-test/r/im_life_cycle.result
index b861248dccb..46579d4afa1 100644
--- a/mysql-test/r/im_life_cycle.result
+++ b/mysql-test/r/im_life_cycle.result
@@ -69,3 +69,6 @@ START INSTANCE mysqld1,mysqld2,mysqld3;
ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use
STOP INSTANCE mysqld1,mysqld2,mysqld3;
ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use
+STOP INSTANCE mysqld2;
+ERROR HY000: Cannot stop instance. Perhaps the instance is not started, or was started manually, so IM cannot find the pidfile.
+End of 5.0 tests
diff --git a/mysql-test/r/information_schema_db.result b/mysql-test/r/information_schema_db.result
index 5919e0f071d..faba5e8d83c 100644
--- a/mysql-test/r/information_schema_db.result
+++ b/mysql-test/r/information_schema_db.result
@@ -104,3 +104,50 @@ v2 VIEW View 'test.v2' references invalid table(s) or column(s) or function(s) o
drop function f1;
drop function f2;
drop view v1, v2;
+create database testdb_1;
+create user testdb_1@localhost;
+grant all on testdb_1.* to testdb_1@localhost with grant option;
+create user testdb_2@localhost;
+grant all on test.* to testdb_2@localhost with grant option;
+use testdb_1;
+create table t1 (f1 char(4));
+create view v1 as select f1 from t1;
+grant insert on v1 to testdb_2@localhost;
+create table t3 (f1 char(4), f2 char(4));
+create view v3 as select f1,f2 from t3;
+grant insert(f1), insert(f2) on v3 to testdb_2@localhost;
+create view v2 as select f1 from testdb_1.v1;
+create view v4 as select f1,f2 from testdb_1.v3;
+revoke insert(f1) on v3 from testdb_2@localhost;
+show create view v4;
+ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+show fields from v4;
+ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+show fields from v2;
+Field Type Null Key Default Extra
+f1 char(4) YES NULL
+show fields from testdb_1.v1;
+Field Type Null Key Default Extra
+f1 char(4) YES NULL
+show create view v2;
+View Create View
+v2 CREATE ALGORITHM=UNDEFINED DEFINER=`testdb_2`@`localhost` SQL SECURITY DEFINER VIEW `test`.`v2` AS select `v1`.`f1` AS `f1` from `testdb_1`.`v1`
+show create view testdb_1.v1;
+ERROR 42000: SHOW VIEW command denied to user 'testdb_2'@'localhost' for table 'v1'
+select table_name from information_schema.columns a
+where a.table_name = 'v2';
+table_name
+v2
+select view_definition from information_schema.views a
+where a.table_name = 'v2';
+view_definition
+/* ALGORITHM=UNDEFINED */ select `v1`.`f1` AS `f1` from `testdb_1`.`v1`
+select view_definition from information_schema.views a
+where a.table_name = 'testdb_1.v1';
+view_definition
+select * from v2;
+ERROR HY000: View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+drop view testdb_1.v1,v2, testdb_1.v3, v4;
+drop database testdb_1;
+drop user testdb_1@localhost;
+drop user testdb_2@localhost;
diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result
index 9755083ab1c..a72d9a7b650 100644
--- a/mysql-test/r/type_newdecimal.result
+++ b/mysql-test/r/type_newdecimal.result
@@ -915,9 +915,13 @@ drop table t1;
select cast('1.00000001335143196001808973960578441619873046875E-10' as decimal(30,15));
cast('1.00000001335143196001808973960578441619873046875E-10' as decimal(30,15))
0.000000000100000
-select ln(14000) c1, convert(ln(14000),decimal(2,3)) c2, cast(ln(14000) as decimal(2,3)) c3;
+select ln(14000) c1, convert(ln(14000),decimal(5,3)) c2, cast(ln(14000) as decimal(5,3)) c3;
c1 c2 c3
9.5468126085974 9.547 9.547
+select convert(ln(14000),decimal(2,3)) c1;
+ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '').
+select cast(ln(14000) as decimal(2,3)) c1;
+ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '').
create table t1 (sl decimal(70,30));
ERROR 42000: Too big precision 70 specified for column 'sl'. Maximum is 65.
create table t1 (sl decimal(32,31));
diff --git a/mysql-test/r/type_ranges.result b/mysql-test/r/type_ranges.result
index 50867219fd8..ce5bb9ceb2f 100644
--- a/mysql-test/r/type_ranges.result
+++ b/mysql-test/r/type_ranges.result
@@ -57,7 +57,7 @@ ushort smallint(5) unsigned zerofill NULL NO MUL 00000 #
umedium mediumint(8) unsigned NULL NO MUL 0 #
ulong int(11) unsigned NULL NO MUL 0 #
ulonglong bigint(13) unsigned NULL NO MUL 0 #
-time_stamp timestamp NULL YES CURRENT_TIMESTAMP #
+time_stamp timestamp NULL NO CURRENT_TIMESTAMP #
date_field date NULL YES NULL #
time_field time NULL YES NULL #
date_time datetime NULL YES NULL #
@@ -229,7 +229,7 @@ ushort smallint(5) unsigned zerofill NULL NO 00000 #
umedium mediumint(8) unsigned NULL NO MUL 0 #
ulong int(11) unsigned NULL NO MUL 0 #
ulonglong bigint(13) unsigned NULL NO MUL 0 #
-time_stamp timestamp NULL YES CURRENT_TIMESTAMP #
+time_stamp timestamp NULL NO CURRENT_TIMESTAMP #
date_field char(10) latin1_swedish_ci YES NULL #
time_field time NULL YES NULL #
date_time datetime NULL YES NULL #
@@ -255,7 +255,7 @@ ushort smallint(5) unsigned zerofill NULL NO 00000 #
umedium mediumint(8) unsigned NULL NO 0 #
ulong int(11) unsigned NULL NO 0 #
ulonglong bigint(13) unsigned NULL NO 0 #
-time_stamp timestamp NULL YES 0000-00-00 00:00:00 #
+time_stamp timestamp NULL NO 0000-00-00 00:00:00 #
date_field char(10) latin1_swedish_ci YES NULL #
time_field time NULL YES NULL #
date_time datetime NULL YES NULL #
diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result
index be31b5272d8..281a5f3fab6 100644
--- a/mysql-test/r/type_timestamp.result
+++ b/mysql-test/r/type_timestamp.result
@@ -201,9 +201,9 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show columns from t1;
Field Type Null Key Default Extra
-t1 timestamp YES 2003-01-01 00:00:00
+t1 timestamp NO 2003-01-01 00:00:00
t2 datetime YES NULL
-t3 timestamp YES 0000-00-00 00:00:00
+t3 timestamp NO 0000-00-00 00:00:00
drop table t1;
create table t1 (t1 timestamp default now(), t2 datetime, t3 timestamp);
SET TIMESTAMP=1000000002;
@@ -225,9 +225,9 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show columns from t1;
Field Type Null Key Default Extra
-t1 timestamp YES CURRENT_TIMESTAMP
+t1 timestamp NO CURRENT_TIMESTAMP
t2 datetime YES NULL
-t3 timestamp YES 0000-00-00 00:00:00
+t3 timestamp NO 0000-00-00 00:00:00
drop table t1;
create table t1 (t1 timestamp default '2003-01-01 00:00:00' on update now(), t2 datetime);
SET TIMESTAMP=1000000004;
@@ -251,7 +251,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show columns from t1;
Field Type Null Key Default Extra
-t1 timestamp YES 2003-01-01 00:00:00
+t1 timestamp NO 2003-01-01 00:00:00
t2 datetime YES NULL
drop table t1;
create table t1 (t1 timestamp default now() on update now(), t2 datetime);
@@ -276,7 +276,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show columns from t1;
Field Type Null Key Default Extra
-t1 timestamp YES CURRENT_TIMESTAMP
+t1 timestamp NO CURRENT_TIMESTAMP
t2 datetime YES NULL
drop table t1;
create table t1 (t1 timestamp, t2 datetime, t3 timestamp);
@@ -302,9 +302,9 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show columns from t1;
Field Type Null Key Default Extra
-t1 timestamp YES CURRENT_TIMESTAMP
+t1 timestamp NO CURRENT_TIMESTAMP
t2 datetime YES NULL
-t3 timestamp YES 0000-00-00 00:00:00
+t3 timestamp NO 0000-00-00 00:00:00
drop table t1;
create table t1 (t1 timestamp default current_timestamp on update current_timestamp, t2 datetime);
SET TIMESTAMP=1000000009;
@@ -328,7 +328,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show columns from t1;
Field Type Null Key Default Extra
-t1 timestamp YES CURRENT_TIMESTAMP
+t1 timestamp NO CURRENT_TIMESTAMP
t2 datetime YES NULL
truncate table t1;
insert into t1 values ('2004-04-01 00:00:00', '2004-04-01 00:00:00');
@@ -493,3 +493,18 @@ a b c
6 NULL 2006-06-06 06:06:06
drop table t1;
set time_zone= @@global.time_zone;
+CREATE TABLE t1 (
+`id` int(11) NOT NULL auto_increment,
+`username` varchar(80) NOT NULL default '',
+`posted_on` timestamp NOT NULL default '0000-00-00 00:00:00',
+PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
+show fields from t1;
+Field Type Null Key Default Extra
+id int(11) NO PRI NULL auto_increment
+username varchar(80) NO
+posted_on timestamp NO 0000-00-00 00:00:00
+select is_nullable from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='t1' and COLUMN_NAME='posted_on';
+is_nullable
+NO
+drop table t1;
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index 30dab7c5170..6c4bc4fff1a 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -879,6 +879,17 @@ DROP TABLE t2;
DROP TABLE t1;
#
+# Bug#17313: N'xxx' and _utf8'xxx' are not equivalent
+#
+CREATE TABLE t1 (item varchar(255)) default character set utf8;
+INSERT INTO t1 VALUES (N'\\');
+INSERT INTO t1 VALUES (_utf8'\\');
+INSERT INTO t1 VALUES (N'Cote d\'Ivoire');
+INSERT INTO t1 VALUES (_utf8'Cote d\'Ivoire');
+SELECT item FROM t1 ORDER BY item;
+DROP TABLE t1;
+
+#
# Bug#17705: Corruption of compressed index when index length changes between
# 254 and 256
#
diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test
index 4c6ff9b2fe7..7bba34be3ff 100644
--- a/mysql-test/t/gis.test
+++ b/mysql-test/t/gis.test
@@ -281,7 +281,7 @@ INSERT INTO t1 VALUES(GeomFromText('POINT(580848489 219587743)'));
INSERT INTO t1 VALUES(GeomFromText('POINT(11247614 782797569)'));
drop table t1;
-create table t1 select POINT(1,3);
+create table t1 select GeomFromWKB(POINT(1,3));
show create table t1;
drop table t1;
@@ -416,3 +416,9 @@ select * from t1;
select asbinary(g) from t1;
--disable_metadata
drop table t1;
+
+
+create table t1 select GeomFromText('point(1 1)');
+desc t1;
+drop table t1;
+
diff --git a/mysql-test/t/im_life_cycle.imtest b/mysql-test/t/im_life_cycle.imtest
index 35258396415..16cf25a8f35 100644
--- a/mysql-test/t/im_life_cycle.imtest
+++ b/mysql-test/t/im_life_cycle.imtest
@@ -194,3 +194,11 @@ START INSTANCE mysqld1,mysqld2,mysqld3;
--error ER_SYNTAX_ERROR
STOP INSTANCE mysqld1,mysqld2,mysqld3;
+
+#
+# Bug #12673: Instance Manager: allows to stop the instance many times
+#
+--error 3001
+STOP INSTANCE mysqld2;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/information_schema_db.test b/mysql-test/t/information_schema_db.test
index 2cfa766d799..4dfe1ad56b5 100644
--- a/mysql-test/t/information_schema_db.test
+++ b/mysql-test/t/information_schema_db.test
@@ -98,3 +98,60 @@ where table_schema='test';
drop function f1;
drop function f2;
drop view v1, v2;
+
+#
+# Bug#20543: select on information_schema strange warnings, view, different
+# schemas/users
+#
+#
+create database testdb_1;
+create user testdb_1@localhost;
+grant all on testdb_1.* to testdb_1@localhost with grant option;
+
+create user testdb_2@localhost;
+grant all on test.* to testdb_2@localhost with grant option;
+
+connect (testdb_1,localhost,testdb_1,,test);
+use testdb_1;
+create table t1 (f1 char(4));
+create view v1 as select f1 from t1;
+grant insert on v1 to testdb_2@localhost;
+
+create table t3 (f1 char(4), f2 char(4));
+create view v3 as select f1,f2 from t3;
+grant insert(f1), insert(f2) on v3 to testdb_2@localhost;
+
+connect (testdb_2,localhost,testdb_2,,test);
+create view v2 as select f1 from testdb_1.v1;
+create view v4 as select f1,f2 from testdb_1.v3;
+
+connection testdb_1;
+revoke insert(f1) on v3 from testdb_2@localhost;
+connection testdb_2;
+
+--error 1345
+show create view v4;
+--error 1345
+show fields from v4;
+
+show fields from v2;
+show fields from testdb_1.v1;
+show create view v2;
+--error 1142
+show create view testdb_1.v1;
+
+select table_name from information_schema.columns a
+where a.table_name = 'v2';
+select view_definition from information_schema.views a
+where a.table_name = 'v2';
+select view_definition from information_schema.views a
+where a.table_name = 'testdb_1.v1';
+
+--error 1356
+select * from v2;
+
+connection default;
+drop view testdb_1.v1,v2, testdb_1.v3, v4;
+drop database testdb_1;
+drop user testdb_1@localhost;
+drop user testdb_2@localhost;
diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test
index 7afdb857ca2..ebf15ac23f0 100644
--- a/mysql-test/t/type_newdecimal.test
+++ b/mysql-test/t/type_newdecimal.test
@@ -947,8 +947,12 @@ select cast('1.00000001335143196001808973960578441619873046875E-10' as decimal(3
#
# Bug #11708 (conversion to decimal fails in decimal part)
#
-select ln(14000) c1, convert(ln(14000),decimal(2,3)) c2, cast(ln(14000) as decimal(2,3)) c3;
-
+select ln(14000) c1, convert(ln(14000),decimal(5,3)) c2, cast(ln(14000) as decimal(5,3)) c3;
+--error 1427
+select convert(ln(14000),decimal(2,3)) c1;
+--error 1427
+select cast(ln(14000) as decimal(2,3)) c1;
+
#
# Bug #8449 (Silent column changes)
#
diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test
index 6873569d0e9..27922a16a37 100644
--- a/mysql-test/t/type_timestamp.test
+++ b/mysql-test/t/type_timestamp.test
@@ -328,3 +328,14 @@ drop table t1;
# Restore timezone to default
set time_zone= @@global.time_zone;
+
+CREATE TABLE t1 (
+`id` int(11) NOT NULL auto_increment,
+`username` varchar(80) NOT NULL default '',
+`posted_on` timestamp NOT NULL default '0000-00-00 00:00:00',
+PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
+
+show fields from t1;
+select is_nullable from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='t1' and COLUMN_NAME='posted_on';
+drop table t1;