Commit 9b6a012c authored by Matthias Leich mleich@mysql.com's avatar Matthias Leich mleich@mysql.com

Fix for

     Bug#37167 funcs_1: Many tests fail if the embedded server is used.
     Bug#37164 funcs_1: Some tests fail if an optional character set is missing.
+ some cleanup within the testsuite related to the fixes above
+ some adjustments to open bugs on Mac OS X
parents 22bd6d9d 00c19cd8
......@@ -84,4 +84,3 @@ SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
FROM information_schema.columns
$my_where
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
# suite/funcs_1/datadict/tables.inc
#
# Auxiliary script to be sourced by
# is_tables_<engine>.test
#
# The variable $engine_type has to be assigned before sourcing ths script.
#
# Author:
# 2008-06-04 mleich Create this script based on older scripts and new code.
#
# Just have some tables within different databases.
--disable_warnings
DROP DATABASE IF EXISTS test1;
DROP DATABASE IF EXISTS test2;
--enable_warnings
CREATE DATABASE test1;
CREATE DATABASE test2;
--replace_result $engine_type <engine_to_be_used>
eval CREATE TABLE test1.t1 (f1 VARCHAR(20)) ENGINE = $engine_type;
--replace_result $engine_type <engine_to_be_used>
eval CREATE TABLE test1.t2 (f1 VARCHAR(20)) ENGINE = $engine_type;
--replace_result $engine_type <engine_to_be_used>
eval CREATE TABLE test2.t1 (f1 VARCHAR(20)) ENGINE = $engine_type;
--source suite/funcs_1/datadict/tables2.inc
SHOW TABLES FROM test1;
SHOW TABLES FROM test2;
# Create a low privileged user.
# Note: The database db_datadict is just a "home" for the low privileged user
# and not in the focus of testing.
--error 0,ER_CANNOT_USER
DROP USER testuser1@localhost;
CREATE USER testuser1@localhost;
GRANT SELECT ON test1.* TO testuser1@localhost;
--echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1,localhost,testuser1,,test1);
--source suite/funcs_1/datadict/tables2.inc
SHOW TABLES FROM test1;
# The lowprivileged user testuser1 will get here an error.
--disable_abort_on_error
SHOW TABLES FROM test2;
--enable_abort_on_error
--echo # Switch to connection default and close connection testuser1
connection default;
disconnect testuser1;
DROP USER testuser1@localhost;
DROP DATABASE test1;
DROP DATABASE test2;
......@@ -2,8 +2,8 @@
#
# Auxiliary script to be sourced by
# is_tables_mysql.test
# is_tables_mysql_embedded.test
# is_tables_is.test
# is_tables_<engine>.test
#
# Author:
# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
......@@ -12,28 +12,27 @@
#
--disable_warnings
DROP DATABASE IF EXISTS db_datadict;
DROP DATABASE IF EXISTS test1;
--enable_warnings
CREATE DATABASE db_datadict;
CREATE DATABASE test1;
--source suite/funcs_1/datadict/tables2.inc
# Create a low privileged user.
# Note: The database db_datadict is just a "home" for the low privileged user
# Note: The database test1 is just a "home" for the low privileged user
# and not in the focus of testing.
--error 0,ER_CANNOT_USER
DROP USER testuser1@localhost;
CREATE USER testuser1@localhost;
GRANT SELECT ON db_datadict.* TO testuser1@localhost;
GRANT SELECT ON test1.* TO testuser1@localhost;
--echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1,localhost,testuser1,,db_datadict);
connect (testuser1,localhost,testuser1,,test1);
--source suite/funcs_1/datadict/tables2.inc
--echo # Switch to connection default and close connection testuser1
connection default;
disconnect testuser1;
DROP USER testuser1@localhost;
DROP DATABASE db_datadict;
DROP DATABASE test1;
......@@ -29,6 +29,8 @@
let $innodb_pattern = 'InnoDB free';
let $ndb_pattern = 'number_of_replicas';
--vertical_results
# We do not unify the engine name here, because the rowformat is
# specific to the engine.
--replace_column 8 "#TBLR#" 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "#CRT#" 16 "#UT#" 17 "#CT#" 20 "#CO#" 21 "#TC#"
eval
SELECT *,
......@@ -44,4 +46,3 @@ FROM information_schema.tables
$my_where
ORDER BY table_schema,table_name;
--horizontal_results
# Skip tests which suffer from
# Bug#28309 First insert violates unique constraint
# - was "memory" table empty?
# if the folowing conditions are fulfilled:
# - MySQL Version is 5.0 (Bug is fixed in 5.1 and up)
# - use of embedded server
# - run on a case insensitive filesystem
#
let $value= query_get_value(SHOW VARIABLES LIKE 'lower_case_file_system', Value, 1);
if (`SELECT '$value' = 'ON' AND VERSION() LIKE '5.0%embedded%'`)
{
skip # Test requires backport of fix for Bug#28309 First insert violates unique constraint - was "memory" table empty ?;
}
......@@ -7,7 +7,7 @@ create table tb1 (
f1 char(0),
f2 char(0) binary,
f3 char(0) ascii,
f4 tinytext unicode,
f4 tinytext,
f5 text,
f6 mediumtext,
f7 longtext,
......
......@@ -10,7 +10,7 @@ f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f124 longtext,
f125 tinyblob,
f126 blob,
f127 mediumblob,
......
......@@ -55,13 +55,13 @@ f223 year(3),
f224 year(4),
f225 enum("1enum","2enum"),
f226 set("1set","2set"),
f235 char(0) unicode,
f235 char(0),
f236 char(90),
f237 char(255) ascii,
f238 varchar(0),
f239 varchar(20000) binary,
f240 varchar(2000) unicode,
f241 char(100) unicode
f240 varchar(2000),
f241 char(100)
) engine = innodb;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
......
......@@ -55,12 +55,12 @@ f223 year(3),
f224 year(4),
f225 enum("1enum","2enum"),
f226 set("1set","2set"),
f236 char(95) unicode,
f241 char(255) unicode,
f236 char(95),
f241 char(255),
f237 char(130) binary,
f238 varchar(25000) binary,
f239 varbinary(0),
f240 varchar(1200) unicode
f240 varchar(1200)
) engine = memory;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
......
......@@ -7,7 +7,7 @@ create table tb1 (
f1 char,
f2 char binary,
f3 char ascii,
f4 tinytext unicode,
f4 tinytext,
f5 text,
f6 mediumtext,
f7 longtext,
......
......@@ -10,7 +10,7 @@ f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f124 longtext,
f125 tinyblob,
f126 blob,
f127 mediumblob,
......
......@@ -63,13 +63,13 @@ f231 VARBINARY(192),
f232 VARBINARY(27),
f233 VARBINARY(64),
f234 VARBINARY(192),
f235 char(255) unicode,
f235 char(255),
f236 char(60) ascii,
f237 char(255) binary,
f238 varchar(0) binary,
f239 varbinary(1000),
f240 varchar(120) unicode,
f241 char(100) unicode,
f240 varchar(120),
f241 char(100),
f242 bit(30)
) engine = myisam;
......
USE test;
drop table if exists tb3 ;
create table tb3 (
f118 char not null DEFAULT 'a',
f119 char binary not null DEFAULT b'101',
f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f125 tinyblob,
f126 blob,
f127 mediumblob,
f128 longblob,
f129 binary not null DEFAULT b'101',
f130 tinyint not null DEFAULT 99,
f131 tinyint unsigned not null DEFAULT 99,
f132 tinyint zerofill not null DEFAULT 99,
f133 tinyint unsigned zerofill not null DEFAULT 99,
f134 smallint not null DEFAULT 999,
f135 smallint unsigned not null DEFAULT 999,
f136 smallint zerofill not null DEFAULT 999,
f137 smallint unsigned zerofill not null DEFAULT 999,
f138 mediumint not null DEFAULT 9999,
f139 mediumint unsigned not null DEFAULT 9999,
f140 mediumint zerofill not null DEFAULT 9999,
f141 mediumint unsigned zerofill not null DEFAULT 9999,
f142 int not null DEFAULT 99999,
f143 int unsigned not null DEFAULT 99999,
f144 int zerofill not null DEFAULT 99999,
f145 int unsigned zerofill not null DEFAULT 99999,
f146 bigint not null DEFAULT 999999,
f147 bigint unsigned not null DEFAULT 999999,
f148 bigint zerofill not null DEFAULT 999999,
f149 bigint unsigned zerofill not null DEFAULT 999999,
f150 decimal not null DEFAULT 999.999,
f151 decimal unsigned not null DEFAULT 999.17,
f152 decimal zerofill not null DEFAULT 999.999,
f153 decimal unsigned zerofill,
f154 decimal (0),
f155 decimal (64),
f156 decimal (0) unsigned,
f157 decimal (64) unsigned,
f158 decimal (0) zerofill,
f159 decimal (64) zerofill,
f160 decimal (0) unsigned zerofill,
f161 decimal (64) unsigned zerofill,
f162 decimal (0,0),
f163 decimal (63,30),
f164 decimal (0,0) unsigned,
f165 decimal (63,30) unsigned,
f166 decimal (0,0) zerofill,
f167 decimal (63,30) zerofill,
f168 decimal (0,0) unsigned zerofill,
f169 decimal (63,30) unsigned zerofill,
f170 numeric,
f171 numeric unsigned,
f172 numeric zerofill,
f173 numeric unsigned zerofill,
f174 numeric (0),
f175 numeric (64)
) engine = innodb;
Warnings:
Note 1265 Data truncated for column 'f150' at row 1
Note 1265 Data truncated for column 'f151' at row 1
Note 1265 Data truncated for column 'f152' at row 1
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb3.txt'
into table tb3;
Testcase x.x.x.1:
-----------------
DROP TABLE IF EXISTS t0, t1, t2;
CREATE TABLE t0 (col1 char(50)) ENGINE=innodb;
CREATE TABLE t1 (id INT NOT NULL, col1 char(50),
PRIMARY KEY (id)) ENGINE=innodb;
CREATE TABLE t0 (col1 CHAR(50))
ENGINE = <engine_to_be_tested>;
CREATE TABLE t1 (id INT NOT NULL, col1 CHAR(50), PRIMARY KEY (id))
ENGINE = <engine_to_be_tested>;
CREATE TABLE t2 (id INT PRIMARY KEY, f_id INT,
INDEX par_ind (f_id), col1 char(50),
FOREIGN KEY (f_id) REFERENCES t1(id)
ON DELETE SET NULL) ENGINE=innodb;
insert into t1 values (1,'Department A');
insert into t1 values (2,'Department B');
insert into t1 values (3,'Department C');
insert into t2 values (1,2,'Emp 1');
insert into t2 values (2,2,'Emp 2');
insert into t2 values (3,2,'Emp 3');
create trigger trig after insert on t0 for each row
delete from t1 where col1=new.col1;
select * from t2;
INDEX par_ind (f_id), col1 CHAR(50),
FOREIGN KEY (f_id) REFERENCES t1(id) ON DELETE SET NULL)
ENGINE = <engine_to_be_tested>;
INSERT INTO t1 VALUES (1,'Department A');
INSERT INTO t1 VALUES (2,'Department B');
INSERT INTO t1 VALUES (3,'Department C');
INSERT INTO t2 VALUES (1,2,'Emp 1');
INSERT INTO t2 VALUES (2,2,'Emp 2');
INSERT INTO t2 VALUES (3,2,'Emp 3');
CREATE TRIGGER trig AFTER INSERT ON t0 FOR EACH ROW
DELETE FROM t1 WHERE col1 = new.col1;
SELECT * FROM t2;
id f_id col1
1 2 Emp 1
2 2 Emp 2
3 2 Emp 3
lock tables t0 write, t1 write;
insert into t0 values ('Department B');
unlock tables;
select * from t2;
LOCK TABLES t0 WRITE, t1 WRITE;
INSERT INTO t0 VALUES ('Department B');
UNLOCK TABLES;
SELECT * FROM t2;
id f_id col1
1 NULL Emp 1
2 NULL Emp 2
3 NULL Emp 3
drop trigger trig;
drop table t2, t1;
DROP TRIGGER trig;
DROP TABLE t2, t1;
Testcase x.x.x.2:
-----------------
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (id INT NOT NULL, col1 char(50),
PRIMARY KEY (id)) ENGINE=innodb;
CREATE TABLE t1 (id INT NOT NULL, col1 CHAR(50), PRIMARY KEY (id))
ENGINE = <engine_to_be_tested>;
CREATE TABLE t2 (id INT PRIMARY KEY, f_id INT,
INDEX par_ind (f_id), col1 char(50),
FOREIGN KEY (f_id) REFERENCES t1(id)
ON UPDATE CASCADE) ENGINE=innodb;
insert into t1 values (1,'Department A');
insert into t1 values (2,'Department B');
insert into t1 values (3,'Department C');
insert into t2 values (1,2,'Emp 1');
insert into t2 values (2,3,'Emp 2');
insert into t2 values (3,4,'Emp 3');
INDEX par_ind (f_id), col1 CHAR(50),
FOREIGN KEY (f_id) REFERENCES t1(id) ON UPDATE CASCADE)
ENGINE = <engine_to_be_tested>;
INSERT INTO t1 VALUES (1,'Department A');
INSERT INTO t1 VALUES (2,'Department B');
INSERT INTO t1 VALUES (3,'Department C');
INSERT INTO t2 VALUES (1,2,'Emp 1');
INSERT INTO t2 VALUES (2,3,'Emp 2');
insert into t2 VALUES (3,4,'Emp 3');
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test/t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`f_id`) REFERENCES `t1` (`id`) ON UPDATE CASCADE)
create trigger tr_t2 before insert on t2 for each row
insert into t1 values(new.f_id, concat('New Department ', new.f_id));
lock tables t1 write, t2 write;
insert into t2 values (3,4,'Emp 3');
unlock tables;
select * from t1;
CREATE TRIGGER tr_t2 BEFORE INSERT ON t2 FOR EACH ROW
INSERT INTO t1 VALUES(new.f_id, CONCAT('New Department ', new.f_id));
LOCK TABLES t1 WRITE, t2 WRITE;
INSERT INTO t2 VALUES (3,4,'Emp 3');
UNLOCK TABLES;
SELECT * FROM t1;
id col1
1 Department A
2 Department B
3 Department C
4 New Department 4
select * from t2;
SELECT * FROM t2;
id f_id col1
1 2 Emp 1
2 3 Emp 2
3 4 Emp 3
drop trigger tr_t2;
drop table t2, t1, t0;
DROP TRIGGER tr_t2;
DROP TABLE t2, t1, t0;
Foreign Key tests disabled (bug 11472 - stored in trig_frkey2.test)
-------------------------------------------------------------------
DROP TABLE test.tb3;
USE test;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1
(
f1 CHAR UNICODE,
f2 CHAR(0) UNICODE,
f3 CHAR(10) UNICODE,
f5 VARCHAR(0) UNICODE,
f6 VARCHAR(255) UNICODE,
f7 VARCHAR(260) UNICODE,
f8 TEXT UNICODE,
f9 TINYTEXT UNICODE,
f10 MEDIUMTEXT UNICODE,
f11 LONGTEXT UNICODE
) ENGINE = InnoDB;
SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
NULL test t1 f1 1 NULL YES char 1 2 NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references
NULL test t1 f10 9 NULL YES mediumtext 8388607 16777215 NULL NULL ucs2 ucs2_general_ci mediumtext select,insert,update,references
NULL test t1 f11 10 NULL YES longtext 2147483647 4294967295 NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references
NULL test t1 f2 2 NULL YES char 0 0 NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references
NULL test t1 f3 3 NULL YES char 10 20 NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references
NULL test t1 f5 4 NULL YES varchar 0 0 NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references
NULL test t1 f6 5 NULL YES varchar 255 510 NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references
NULL test t1 f7 6 NULL YES varchar 260 520 NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references
NULL test t1 f8 7 NULL YES text 32767 65535 NULL NULL ucs2 ucs2_general_ci text select,insert,update,references
NULL test t1 f9 8 NULL YES tinytext 127 255 NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
CHARACTER_SET_NAME,
COLLATION_NAME
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
CHARACTER_SET_NAME,
COLLATION_NAME
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
2.0000 char ucs2 ucs2_general_ci
2.0000 longtext ucs2 ucs2_general_ci
2.0000 mediumtext ucs2 ucs2_general_ci
2.0000 text ucs2 ucs2_general_ci
2.0000 varchar ucs2 ucs2_general_ci
2.0079 tinytext ucs2 ucs2_general_ci
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
CHARACTER_SET_NAME,
COLLATION_NAME
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
NULL char ucs2 ucs2_general_ci
NULL varchar ucs2 ucs2_general_ci
--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values
--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL
SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
TABLE_SCHEMA,
TABLE_NAME,
COLUMN_NAME,
DATA_TYPE,
CHARACTER_MAXIMUM_LENGTH,
CHARACTER_OCTET_LENGTH,
CHARACTER_SET_NAME,
COLLATION_NAME,
COLUMN_TYPE
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE
2.0000 test t1 f1 char 1 2 ucs2 ucs2_general_ci char(1)
NULL test t1 f2 char 0 0 ucs2 ucs2_general_ci char(0)
2.0000 test t1 f3 char 10 20 ucs2 ucs2_general_ci char(10)
NULL test t1 f5 varchar 0 0 ucs2 ucs2_general_ci varchar(0)
2.0000 test t1 f6 varchar 255 510 ucs2 ucs2_general_ci varchar(255)
2.0000 test t1 f7 varchar 260 520 ucs2 ucs2_general_ci varchar(260)
2.0000 test t1 f8 text 32767 65535 ucs2 ucs2_general_ci text
2.0079 test t1 f9 tinytext 127 255 ucs2 ucs2_general_ci tinytext
2.0000 test t1 f10 mediumtext 8388607 16777215 ucs2 ucs2_general_ci mediumtext
2.0000 test t1 f11 longtext 2147483647 4294967295 ucs2 ucs2_general_ci longtext
DROP TABLE t1;
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
USE test;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1
(
f1 CHAR UNICODE,
f2 CHAR(0) UNICODE,
f3 CHAR(10) UNICODE,
f5 VARCHAR(0) UNICODE,
f6 VARCHAR(255) UNICODE,
f7 VARCHAR(260) UNICODE
) ENGINE = MEMORY;
SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
NULL test t1 f1 1 NULL YES char 1 2 NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references
NULL test t1 f2 2 NULL YES char 0 0 NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references
NULL test t1 f3 3 NULL YES char 10 20 NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references
NULL test t1 f5 4 NULL YES varchar 0 0 NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references
NULL test t1 f6 5 NULL YES varchar 255 510 NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references
NULL test t1 f7 6 NULL YES varchar 260 520 NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
CHARACTER_SET_NAME,
COLLATION_NAME
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
CHARACTER_SET_NAME,
COLLATION_NAME
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
2.0000 char ucs2 ucs2_general_ci
2.0000 varchar ucs2 ucs2_general_ci
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
CHARACTER_SET_NAME,
COLLATION_NAME
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
NULL char ucs2 ucs2_general_ci
NULL varchar ucs2 ucs2_general_ci
--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values
--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL
SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
TABLE_SCHEMA,
TABLE_NAME,
COLUMN_NAME,
DATA_TYPE,
CHARACTER_MAXIMUM_LENGTH,
CHARACTER_OCTET_LENGTH,
CHARACTER_SET_NAME,
COLLATION_NAME,
COLUMN_TYPE
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE
2.0000 test t1 f1 char 1 2 ucs2 ucs2_general_ci char(1)
NULL test t1 f2 char 0 0 ucs2 ucs2_general_ci char(0)
2.0000 test t1 f3 char 10 20 ucs2 ucs2_general_ci char(10)
NULL test t1 f5 varchar 0 0 ucs2 ucs2_general_ci varchar(0)
2.0000 test t1 f6 varchar 255 510 ucs2 ucs2_general_ci varchar(255)
2.0000 test t1 f7 varchar 260 520 ucs2 ucs2_general_ci varchar(260)
DROP TABLE t1;
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
USE test;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1
(
f1 CHAR UNICODE,
f2 CHAR(0) UNICODE,
f3 CHAR(10) UNICODE,
f5 VARCHAR(0) UNICODE,
f6 VARCHAR(255) UNICODE,
f7 VARCHAR(260) UNICODE,
f8 TEXT UNICODE,
f9 TINYTEXT UNICODE,
f10 MEDIUMTEXT UNICODE,
f11 LONGTEXT UNICODE
) ENGINE = MyISAM;
SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
NULL test t1 f1 1 NULL YES char 1 2 NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references
NULL test t1 f10 9 NULL YES mediumtext 8388607 16777215 NULL NULL ucs2 ucs2_general_ci mediumtext select,insert,update,references
NULL test t1 f11 10 NULL YES longtext 2147483647 4294967295 NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references
NULL test t1 f2 2 NULL YES char 0 0 NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references
NULL test t1 f3 3 NULL YES char 10 20 NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references
NULL test t1 f5 4 NULL YES varchar 0 0 NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references
NULL test t1 f6 5 NULL YES varchar 255 510 NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references
NULL test t1 f7 6 NULL YES varchar 260 520 NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references
NULL test t1 f8 7 NULL YES text 32767 65535 NULL NULL ucs2 ucs2_general_ci text select,insert,update,references
NULL test t1 f9 8 NULL YES tinytext 127 255 NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
CHARACTER_SET_NAME,
COLLATION_NAME
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
CHARACTER_SET_NAME,
COLLATION_NAME
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
2.0000 char ucs2 ucs2_general_ci
2.0000 longtext ucs2 ucs2_general_ci
2.0000 mediumtext ucs2 ucs2_general_ci
2.0000 text ucs2 ucs2_general_ci
2.0000 varchar ucs2 ucs2_general_ci
2.0079 tinytext ucs2 ucs2_general_ci
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
CHARACTER_SET_NAME,
COLLATION_NAME
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
NULL char ucs2 ucs2_general_ci
NULL varchar ucs2 ucs2_general_ci
--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values
--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL
SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
TABLE_SCHEMA,
TABLE_NAME,
COLUMN_NAME,
DATA_TYPE,
CHARACTER_MAXIMUM_LENGTH,
CHARACTER_OCTET_LENGTH,
CHARACTER_SET_NAME,
COLLATION_NAME,
COLUMN_TYPE
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE
2.0000 test t1 f1 char 1 2 ucs2 ucs2_general_ci char(1)
NULL test t1 f2 char 0 0 ucs2 ucs2_general_ci char(0)
2.0000 test t1 f3 char 10 20 ucs2 ucs2_general_ci char(10)
NULL test t1 f5 varchar 0 0 ucs2 ucs2_general_ci varchar(0)
2.0000 test t1 f6 varchar 255 510 ucs2 ucs2_general_ci varchar(255)
2.0000 test t1 f7 varchar 260 520 ucs2 ucs2_general_ci varchar(260)
2.0000 test t1 f8 text 32767 65535 ucs2 ucs2_general_ci text
2.0079 test t1 f9 tinytext 127 255 ucs2 ucs2_general_ci tinytext
2.0000 test t1 f10 mediumtext 8388607 16777215 ucs2 ucs2_general_ci mediumtext
2.0000 test t1 f11 longtext 2147483647 4294967295 ucs2 ucs2_general_ci longtext
DROP TABLE t1;
USE test;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1
(
f1 CHAR UNICODE,
f2 CHAR(0) UNICODE,
f3 CHAR(10) UNICODE,
f5 VARCHAR(0) UNICODE,
f6 VARCHAR(255) UNICODE,
f7 VARCHAR(260) UNICODE,
f8 TEXT UNICODE,
f9 TINYTEXT UNICODE,
f10 MEDIUMTEXT UNICODE,
f11 LONGTEXT UNICODE
) ENGINE = NDB;
SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
NULL test t1 f1 1 NULL YES char 1 2 NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references
NULL test t1 f10 9 NULL YES mediumtext 8388607 16777215 NULL NULL ucs2 ucs2_general_ci mediumtext select,insert,update,references
NULL test t1 f11 10 NULL YES longtext 2147483647 4294967295 NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references
NULL test t1 f2 2 NULL YES char 0 0 NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references
NULL test t1 f3 3 NULL YES char 10 20 NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references
NULL test t1 f5 4 NULL YES varchar 0 0 NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references
NULL test t1 f6 5 NULL YES varchar 255 510 NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references
NULL test t1 f7 6 NULL YES varchar 260 520 NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references
NULL test t1 f8 7 NULL YES text 32767 65535 NULL NULL ucs2 ucs2_general_ci text select,insert,update,references
NULL test t1 f9 8 NULL YES tinytext 127 255 NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
CHARACTER_SET_NAME,
COLLATION_NAME
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
CHARACTER_SET_NAME,
COLLATION_NAME
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
2.0000 char ucs2 ucs2_general_ci
2.0000 longtext ucs2 ucs2_general_ci
2.0000 mediumtext ucs2 ucs2_general_ci
2.0000 text ucs2 ucs2_general_ci
2.0000 varchar ucs2 ucs2_general_ci
2.0079 tinytext ucs2 ucs2_general_ci
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
CHARACTER_SET_NAME,
COLLATION_NAME
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
NULL char ucs2 ucs2_general_ci
NULL varchar ucs2 ucs2_general_ci
--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values
--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL
SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
TABLE_SCHEMA,
TABLE_NAME,
COLUMN_NAME,
DATA_TYPE,
CHARACTER_MAXIMUM_LENGTH,
CHARACTER_OCTET_LENGTH,
CHARACTER_SET_NAME,
COLLATION_NAME,
COLUMN_TYPE
FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE
2.0000 test t1 f1 char 1 2 ucs2 ucs2_general_ci char(1)
NULL test t1 f2 char 0 0 ucs2 ucs2_general_ci char(0)
2.0000 test t1 f3 char 10 20 ucs2 ucs2_general_ci char(10)
NULL test t1 f5 varchar 0 0 ucs2 ucs2_general_ci varchar(0)
2.0000 test t1 f6 varchar 255 510 ucs2 ucs2_general_ci varchar(255)
2.0000 test t1 f7 varchar 260 520 ucs2 ucs2_general_ci varchar(260)
2.0000 test t1 f8 text 32767 65535 ucs2 ucs2_general_ci text
2.0079 test t1 f9 tinytext 127 255 ucs2 ucs2_general_ci tinytext
2.0000 test t1 f10 mediumtext 8388607 16777215 ucs2 ucs2_general_ci mediumtext
2.0000 test t1 f11 longtext 2147483647 4294967295 ucs2 ucs2_general_ci longtext
DROP TABLE t1;
......@@ -6,7 +6,7 @@ create table tb1 (
f1 char(0),
f2 char(0) binary,
f3 char(0) ascii,
f4 tinytext unicode,
f4 tinytext,
f5 text,
f6 mediumtext,
f7 longtext,
......@@ -142,7 +142,7 @@ f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f124 longtext,
f125 tinyblob,
f126 blob,
f127 mediumblob,
......@@ -254,13 +254,13 @@ f223 year(3),
f224 year(4),
f225 enum("1enum","2enum"),
f226 set("1set","2set"),
f235 char(0) unicode,
f235 char(0),
f236 char(90),
f237 char(255) ascii,
f238 varchar(0),
f239 varchar(20000) binary,
f240 varchar(2000) unicode,
f241 char(100) unicode
f240 varchar(2000),
f241 char(100)
) engine = innodb;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb4.txt'
into table tb4;
......@@ -460,7 +460,7 @@ NULL test tb1 f36 36 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0
NULL test tb1 f37 37 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
NULL test tb1 f38 38 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
NULL test tb1 f39 39 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
NULL test tb1 f4 4 NULL YES tinytext 127 255 NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references
NULL test tb1 f4 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references
NULL test tb1 f40 40 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
NULL test tb1 f41 41 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
NULL test tb1 f42 42 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
......@@ -542,7 +542,7 @@ NULL test tb3 f120 3  NO char 1 1 NULL NULL latin1 latin1_swedish_ci char(1)
NULL test tb3 f121 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references
NULL test tb3 f122 5 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text select,insert,update,references
NULL test tb3 f123 6 NULL YES mediumtext 16777215 16777215 NULL NULL latin1 latin1_swedish_ci mediumtext select,insert,update,references
NULL test tb3 f124 7 NULL YES longtext 2147483647 4294967295 NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references
NULL test tb3 f124 7 NULL YES longtext 4294967295 4294967295 NULL NULL latin1 latin1_swedish_ci longtext select,insert,update,references
NULL test tb3 f125 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL tinyblob select,insert,update,references
NULL test tb3 f126 9 NULL YES blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
NULL test tb3 f127 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL mediumblob select,insert,update,references
......@@ -645,13 +645,13 @@ NULL test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL year(4) sele
NULL test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
NULL test tb4 f225 50 NULL YES enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references
NULL test tb4 f226 51 NULL YES set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references
NULL test tb4 f235 52 NULL YES char 0 0 NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references
NULL test tb4 f235 52 NULL YES char 0 0 NULL NULL latin1 latin1_swedish_ci char(0) select,insert,update,references
NULL test tb4 f236 53 NULL YES char 90 90 NULL NULL latin1 latin1_swedish_ci char(90) select,insert,update,references
NULL test tb4 f237 54 NULL YES char 255 255 NULL NULL latin1 latin1_swedish_ci char(255) select,insert,update,references
NULL test tb4 f238 55 NULL YES varchar 0 0 NULL NULL latin1 latin1_swedish_ci varchar(0) select,insert,update,references
NULL test tb4 f239 56 NULL YES varchar 20000 20000 NULL NULL latin1 latin1_bin varchar(20000) select,insert,update,references
NULL test tb4 f240 57 NULL YES varchar 2000 4000 NULL NULL ucs2 ucs2_general_ci varchar(2000) select,insert,update,references
NULL test tb4 f241 58 NULL YES char 100 200 NULL NULL ucs2 ucs2_general_ci char(100) select,insert,update,references
NULL test tb4 f240 57 NULL YES varchar 2000 2000 NULL NULL latin1 latin1_swedish_ci varchar(2000) select,insert,update,references
NULL test tb4 f241 58 NULL YES char 100 100 NULL NULL latin1 latin1_swedish_ci char(100) select,insert,update,references
NULL test1 tb2 f100 42 00000000000000000008.8 NO double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
NULL test1 tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date select,insert,update,references
NULL test1 tb2 f102 44 00:00:20 NO time NULL NULL NULL NULL NULL NULL time select,insert,update,references
......@@ -736,6 +736,7 @@ COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
1.0000 set latin1 latin1_swedish_ci
1.0000 text latin1 latin1_swedish_ci
1.0000 tinytext latin1 latin1_swedish_ci
1.0000 varchar latin1 latin1_swedish_ci
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
......@@ -746,10 +747,6 @@ WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
2.0000 char ucs2 ucs2_general_ci
2.0000 longtext ucs2 ucs2_general_ci
2.0000 varchar ucs2 ucs2_general_ci
2.0079 tinytext ucs2 ucs2_general_ci
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
......@@ -780,7 +777,6 @@ NULL year NULL NULL
NULL char latin1 latin1_bin
NULL char latin1 latin1_swedish_ci
NULL varchar latin1 latin1_swedish_ci
NULL char ucs2 ucs2_general_ci
--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values
--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL
SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
......@@ -844,7 +840,7 @@ NULL test t9 f3 int NULL NULL NULL NULL int(11)
NULL test tb1 f1 char 0 0 latin1 latin1_swedish_ci char(0)
NULL test tb1 f2 char 0 0 latin1 latin1_bin char(0)
NULL test tb1 f3 char 0 0 latin1 latin1_swedish_ci char(0)
2.0079 test tb1 f4 tinytext 127 255 ucs2 ucs2_general_ci tinytext
1.0000 test tb1 f4 tinytext 255 255 latin1 latin1_swedish_ci tinytext
1.0000 test tb1 f5 text 65535 65535 latin1 latin1_swedish_ci text
1.0000 test tb1 f6 mediumtext 16777215 16777215 latin1 latin1_swedish_ci mediumtext
1.0000 test tb1 f7 longtext 4294967295 4294967295 latin1 latin1_swedish_ci longtext
......@@ -956,7 +952,7 @@ NULL test tb2 f107 year NULL NULL NULL NULL year(4)
1.0000 test tb3 f121 tinytext 255 255 latin1 latin1_swedish_ci tinytext
1.0000 test tb3 f122 text 65535 65535 latin1 latin1_swedish_ci text
1.0000 test tb3 f123 mediumtext 16777215 16777215 latin1 latin1_swedish_ci mediumtext
2.0000 test tb3 f124 longtext 2147483647 4294967295 ucs2 ucs2_general_ci longtext
1.0000 test tb3 f124 longtext 4294967295 4294967295 latin1 latin1_swedish_ci longtext
1.0000 test tb3 f125 tinyblob 255 255 NULL NULL tinyblob
1.0000 test tb3 f126 blob 65535 65535 NULL NULL blob
1.0000 test tb3 f127 mediumblob 16777215 16777215 NULL NULL mediumblob
......@@ -1059,13 +1055,13 @@ NULL test tb4 f223 year NULL NULL NULL NULL year(4)
NULL test tb4 f224 year NULL NULL NULL NULL year(4)
1.0000 test tb4 f225 enum 5 5 latin1 latin1_swedish_ci enum('1enum','2enum')
1.0000 test tb4 f226 set 9 9 latin1 latin1_swedish_ci set('1set','2set')
NULL test tb4 f235 char 0 0 ucs2 ucs2_general_ci char(0)
NULL test tb4 f235 char 0 0 latin1 latin1_swedish_ci char(0)
1.0000 test tb4 f236 char 90 90 latin1 latin1_swedish_ci char(90)
1.0000 test tb4 f237 char 255 255 latin1 latin1_swedish_ci char(255)
NULL test tb4 f238 varchar 0 0 latin1 latin1_swedish_ci varchar(0)
1.0000 test tb4 f239 varchar 20000 20000 latin1 latin1_bin varchar(20000)
2.0000 test tb4 f240 varchar 2000 4000 ucs2 ucs2_general_ci varchar(2000)
2.0000 test tb4 f241 char 100 200 ucs2 ucs2_general_ci char(100)
1.0000 test tb4 f240 varchar 2000 2000 latin1 latin1_swedish_ci varchar(2000)
1.0000 test tb4 f241 char 100 100 latin1 latin1_swedish_ci char(100)
NULL test1 tb2 f59 decimal NULL NULL NULL NULL decimal(10,0) unsigned
NULL test1 tb2 f60 decimal NULL NULL NULL NULL decimal(64,0) unsigned
NULL test1 tb2 f61 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill
......
This diff is collapsed.
......@@ -244,12 +244,12 @@ f223 year(3),
f224 year(4),
f225 enum("1enum","2enum"),
f226 set("1set","2set"),
f236 char(95) unicode,
f241 char(255) unicode,
f236 char(95),
f241 char(255),
f237 char(130) binary,
f238 varchar(25000) binary,
f239 varbinary(0),
f240 varchar(1200) unicode
f240 varchar(1200)
) engine = memory;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb4.txt'
into table tb4;
......@@ -620,12 +620,12 @@ NULL test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL year(4) sele
NULL test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
NULL test tb4 f225 50 NULL YES enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references
NULL test tb4 f226 51 NULL YES set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references
NULL test tb4 f236 52 NULL YES char 95 190 NULL NULL ucs2 ucs2_general_ci char(95) select,insert,update,references
NULL test tb4 f236 52 NULL YES char 95 95 NULL NULL latin1 latin1_swedish_ci char(95) select,insert,update,references
NULL test tb4 f237 54 NULL YES char 130 130 NULL NULL latin1 latin1_bin char(130) select,insert,update,references
NULL test tb4 f238 55 NULL YES varchar 25000 25000 NULL NULL latin1 latin1_bin varchar(25000) select,insert,update,references
NULL test tb4 f239 56 NULL YES varbinary 0 0 NULL NULL NULL NULL varbinary(0) select,insert,update,references
NULL test tb4 f240 57 NULL YES varchar 1200 2400 NULL NULL ucs2 ucs2_general_ci varchar(1200) select,insert,update,references
NULL test tb4 f241 53 NULL YES char 255 510 NULL NULL ucs2 ucs2_general_ci char(255) select,insert,update,references
NULL test tb4 f240 57 NULL YES varchar 1200 1200 NULL NULL latin1 latin1_swedish_ci varchar(1200) select,insert,update,references
NULL test tb4 f241 53 NULL YES char 255 255 NULL NULL latin1 latin1_swedish_ci char(255) select,insert,update,references
NULL test1 tb2 f100 42 00000000000000000008.8 NO double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
NULL test1 tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date select,insert,update,references
NULL test1 tb2 f102 44 00:00:20 NO time NULL NULL NULL NULL NULL NULL time select,insert,update,references
......@@ -702,6 +702,7 @@ COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
1.0000 char latin1 latin1_swedish_ci
1.0000 enum latin1 latin1_swedish_ci
1.0000 set latin1 latin1_swedish_ci
1.0000 varchar latin1 latin1_swedish_ci
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
......@@ -712,8 +713,6 @@ WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
2.0000 char ucs2 ucs2_general_ci
2.0000 varchar ucs2 ucs2_general_ci
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
......@@ -1006,12 +1005,12 @@ NULL test tb4 f223 year NULL NULL NULL NULL year(4)
NULL test tb4 f224 year NULL NULL NULL NULL year(4)
1.0000 test tb4 f225 enum 5 5 latin1 latin1_swedish_ci enum('1enum','2enum')
1.0000 test tb4 f226 set 9 9 latin1 latin1_swedish_ci set('1set','2set')
2.0000 test tb4 f236 char 95 190 ucs2 ucs2_general_ci char(95)
2.0000 test tb4 f241 char 255 510 ucs2 ucs2_general_ci char(255)
1.0000 test tb4 f236 char 95 95 latin1 latin1_swedish_ci char(95)
1.0000 test tb4 f241 char 255 255 latin1 latin1_swedish_ci char(255)
1.0000 test tb4 f237 char 130 130 latin1 latin1_bin char(130)
1.0000 test tb4 f238 varchar 25000 25000 latin1 latin1_bin varchar(25000)
NULL test tb4 f239 varbinary 0 0 NULL NULL varbinary(0)
2.0000 test tb4 f240 varchar 1200 2400 ucs2 ucs2_general_ci varchar(1200)
1.0000 test tb4 f240 varchar 1200 1200 latin1 latin1_swedish_ci varchar(1200)
NULL test1 tb2 f59 decimal NULL NULL NULL NULL decimal(10,0) unsigned
NULL test1 tb2 f60 decimal NULL NULL NULL NULL decimal(64,0) unsigned
NULL test1 tb2 f61 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill
......
......@@ -7,7 +7,7 @@ create table tb1 (
f1 char,
f2 char binary,
f3 char ascii,
f4 tinytext unicode,
f4 tinytext,
f5 text,
f6 mediumtext,
f7 longtext,
......@@ -154,7 +154,7 @@ f120 char ascii not null DEFAULT b'101',
f121 tinytext,
f122 text,
f123 mediumtext,
f124 longtext unicode,
f124 longtext,
f125 tinyblob,
f126 blob,
f127 mediumblob,
......@@ -274,13 +274,13 @@ f231 VARBINARY(192),
f232 VARBINARY(27),
f233 VARBINARY(64),
f234 VARBINARY(192),
f235 char(255) unicode,
f235 char(255),
f236 char(60) ascii,
f237 char(255) binary,
f238 varchar(0) binary,
f239 varbinary(1000),
f240 varchar(120) unicode,
f241 char(100) unicode,
f240 varchar(120),
f241 char(100),
f242 bit(30)
) engine = myisam;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb4.txt'
......@@ -489,7 +489,7 @@ NULL test tb1 f36 36 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0
NULL test tb1 f37 37 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
NULL test tb1 f38 38 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
NULL test tb1 f39 39 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
NULL test tb1 f4 4 NULL YES tinytext 127 255 NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references
NULL test tb1 f4 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references
NULL test tb1 f40 40 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
NULL test tb1 f41 41 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
NULL test tb1 f42 42 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
......@@ -579,7 +579,7 @@ NULL test tb3 f120 3  NO char 1 1 NULL NULL latin1 latin1_swedish_ci char(1)
NULL test tb3 f121 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references
NULL test tb3 f122 5 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text select,insert,update,references
NULL test tb3 f123 6 NULL YES mediumtext 16777215 16777215 NULL NULL latin1 latin1_swedish_ci mediumtext select,insert,update,references
NULL test tb3 f124 7 NULL YES longtext 2147483647 4294967295 NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references
NULL test tb3 f124 7 NULL YES longtext 4294967295 4294967295 NULL NULL latin1 latin1_swedish_ci longtext select,insert,update,references
NULL test tb3 f125 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL tinyblob select,insert,update,references
NULL test tb3 f126 9 NULL YES blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
NULL test tb3 f127 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL mediumblob select,insert,update,references
......@@ -690,13 +690,13 @@ NULL test tb4 f231 56 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(1
NULL test tb4 f232 57 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27) select,insert,update,references
NULL test tb4 f233 58 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) select,insert,update,references
NULL test tb4 f234 59 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) select,insert,update,references
NULL test tb4 f235 60 NULL YES char 255 510 NULL NULL ucs2 ucs2_general_ci char(255) select,insert,update,references
NULL test tb4 f235 60 NULL YES char 255 255 NULL NULL latin1 latin1_swedish_ci char(255) select,insert,update,references
NULL test tb4 f236 61 NULL YES char 60 60 NULL NULL latin1 latin1_swedish_ci char(60) select,insert,update,references
NULL test tb4 f237 62 NULL YES char 255 255 NULL NULL latin1 latin1_bin char(255) select,insert,update,references
NULL test tb4 f238 63 NULL YES varchar 0 0 NULL NULL latin1 latin1_bin varchar(0) select,insert,update,references
NULL test tb4 f239 64 NULL YES varbinary 1000 1000 NULL NULL NULL NULL varbinary(1000) select,insert,update,references
NULL test tb4 f240 65 NULL YES varchar 120 240 NULL NULL ucs2 ucs2_general_ci varchar(120) select,insert,update,references
NULL test tb4 f241 66 NULL YES char 100 200 NULL NULL ucs2 ucs2_general_ci char(100) select,insert,update,references
NULL test tb4 f240 65 NULL YES varchar 120 120 NULL NULL latin1 latin1_swedish_ci varchar(120) select,insert,update,references
NULL test tb4 f241 66 NULL YES char 100 100 NULL NULL latin1 latin1_swedish_ci char(100) select,insert,update,references
NULL test tb4 f242 67 NULL YES bit NULL NULL 30 NULL NULL NULL bit(30) select,insert,update,references
NULL test1 tb2 f100 42 00000000000000000008.8 NO double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
NULL test1 tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date select,insert,update,references
......@@ -790,6 +790,7 @@ COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
1.0000 set latin1 latin1_swedish_ci
1.0000 text latin1 latin1_swedish_ci
1.0000 tinytext latin1 latin1_swedish_ci
1.0000 varchar latin1 latin1_swedish_ci
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
......@@ -800,10 +801,6 @@ WHERE table_schema LIKE 'test%'
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
2.0000 char ucs2 ucs2_general_ci
2.0000 longtext ucs2 ucs2_general_ci
2.0000 varchar ucs2 ucs2_general_ci
2.0079 tinytext ucs2 ucs2_general_ci
SELECT DISTINCT
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
DATA_TYPE,
......@@ -896,7 +893,7 @@ NULL test t9 f3 int NULL NULL NULL NULL int(11)
1.0000 test tb1 f1 char 1 1 latin1 latin1_swedish_ci char(1)
1.0000 test tb1 f2 char 1 1 latin1 latin1_bin char(1)
1.0000 test tb1 f3 char 1 1 latin1 latin1_swedish_ci char(1)
2.0079 test tb1 f4 tinytext 127 255 ucs2 ucs2_general_ci tinytext
1.0000 test tb1 f4 tinytext 255 255 latin1 latin1_swedish_ci tinytext
1.0000 test tb1 f5 text 65535 65535 latin1 latin1_swedish_ci text
1.0000 test tb1 f6 mediumtext 16777215 16777215 latin1 latin1_swedish_ci mediumtext
1.0000 test tb1 f7 longtext 4294967295 4294967295 latin1 latin1_swedish_ci longtext
......@@ -1016,7 +1013,7 @@ NULL test tb2 f107 year NULL NULL NULL NULL year(4)
1.0000 test tb3 f121 tinytext 255 255 latin1 latin1_swedish_ci tinytext
1.0000 test tb3 f122 text 65535 65535 latin1 latin1_swedish_ci text
1.0000 test tb3 f123 mediumtext 16777215 16777215 latin1 latin1_swedish_ci mediumtext
2.0000 test tb3 f124 longtext 2147483647 4294967295 ucs2 ucs2_general_ci longtext
1.0000 test tb3 f124 longtext 4294967295 4294967295 latin1 latin1_swedish_ci longtext
1.0000 test tb3 f125 tinyblob 255 255 NULL NULL tinyblob
1.0000 test tb3 f126 blob 65535 65535 NULL NULL blob
1.0000 test tb3 f127 mediumblob 16777215 16777215 NULL NULL mediumblob
......@@ -1127,13 +1124,13 @@ NULL test tb4 f224 year NULL NULL NULL NULL year(4)
1.0000 test tb4 f232 varbinary 27 27 NULL NULL varbinary(27)
1.0000 test tb4 f233 varbinary 64 64 NULL NULL varbinary(64)
1.0000 test tb4 f234 varbinary 192 192 NULL NULL varbinary(192)
2.0000 test tb4 f235 char 255 510 ucs2 ucs2_general_ci char(255)
1.0000 test tb4 f235 char 255 255 latin1 latin1_swedish_ci char(255)
1.0000 test tb4 f236 char 60 60 latin1 latin1_swedish_ci char(60)
1.0000 test tb4 f237 char 255 255 latin1 latin1_bin char(255)
NULL test tb4 f238 varchar 0 0 latin1 latin1_bin varchar(0)
1.0000 test tb4 f239 varbinary 1000 1000 NULL NULL varbinary(1000)
2.0000 test tb4 f240 varchar 120 240 ucs2 ucs2_general_ci varchar(120)
2.0000 test tb4 f241 char 100 200 ucs2 ucs2_general_ci char(100)
1.0000 test tb4 f240 varchar 120 120 latin1 latin1_swedish_ci varchar(120)
1.0000 test tb4 f241 char 100 100 latin1 latin1_swedish_ci char(100)
NULL test tb4 f242 bit NULL NULL NULL NULL bit(30)
NULL test1 tb2 f59 decimal NULL NULL NULL NULL decimal(10,0) unsigned
NULL test1 tb2 f60 decimal NULL NULL NULL NULL decimal(64,0) unsigned
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
SHOW TABLES FROM information_schema LIKE 'SCHEMATA';
Tables_in_information_schema (SCHEMATA)
SCHEMATA
#######################################################################
# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
#######################################################################
DROP VIEW IF EXISTS test.v1;
DROP PROCEDURE IF EXISTS test.p1;
DROP FUNCTION IF EXISTS test.f1;
CREATE VIEW test.v1 AS SELECT * FROM information_schema.SCHEMATA;
CREATE PROCEDURE test.p1() SELECT * FROM information_schema.SCHEMATA;
CREATE FUNCTION test.f1() returns BIGINT
BEGIN
DECLARE counter BIGINT DEFAULT NULL;
SELECT COUNT(*) INTO counter FROM information_schema.SCHEMATA;
RETURN counter;
END//
# Attention: The printing of the next result sets is disabled.
SELECT * FROM information_schema.SCHEMATA;
SELECT * FROM test.v1;
CALL test.p1;
SELECT test.f1();
DROP VIEW test.v1;
DROP PROCEDURE test.p1;
DROP FUNCTION test.f1;
#########################################################################
# Testcase 3.2.9.1: INFORMATION_SCHEMA.SCHEMATA layout;
#########################################################################
DESCRIBE information_schema.SCHEMATA;
Field Type Null Key Default Extra
CATALOG_NAME varchar(512) YES NULL
SCHEMA_NAME varchar(64) NO
DEFAULT_CHARACTER_SET_NAME varchar(64) NO
DEFAULT_COLLATION_NAME varchar(64) NO
SQL_PATH varchar(512) YES NULL
SHOW CREATE TABLE information_schema.SCHEMATA;
Table Create Table
SCHEMATA CREATE TEMPORARY TABLE `SCHEMATA` (
`CATALOG_NAME` varchar(512) default NULL,
`SCHEMA_NAME` varchar(64) NOT NULL default '',
`DEFAULT_CHARACTER_SET_NAME` varchar(64) NOT NULL default '',
`DEFAULT_COLLATION_NAME` varchar(64) NOT NULL default '',
`SQL_PATH` varchar(512) default NULL
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.SCHEMATA;
Field Type Null Key Default Extra
CATALOG_NAME varchar(512) YES NULL
SCHEMA_NAME varchar(64) NO
DEFAULT_CHARACTER_SET_NAME varchar(64) NO
DEFAULT_COLLATION_NAME varchar(64) NO
SQL_PATH varchar(512) YES NULL
SELECT catalog_name, schema_name, sql_path
FROM information_schema.schemata
WHERE catalog_name IS NOT NULL or sql_path IS NOT NULL;
catalog_name schema_name sql_path
###############################################################################
# Testcases 3.2.9.2+3.2.9.3: INFORMATION_SCHEMA.SCHEMATA accessible information
###############################################################################
DROP DATABASE IF EXISTS db_datadict_1;
DROP DATABASE IF EXISTS db_datadict_2;
CREATE DATABASE db_datadict_1;
CREATE DATABASE db_datadict_2;
DROP USER 'testuser1'@'localhost';
CREATE USER 'testuser1'@'localhost';
DROP USER 'testuser2'@'localhost';
CREATE USER 'testuser2'@'localhost';
DROP USER 'testuser3'@'localhost';
CREATE USER 'testuser3'@'localhost';
GRANT SELECT ON db_datadict_1.* to 'testuser1'@'localhost';
GRANT SELECT ON db_datadict_1.* to 'testuser2'@'localhost';
GRANT SELECT ON db_datadict_2.* to 'testuser2'@'localhost';
SELECT * FROM information_schema.schemata
WHERE schema_name LIKE 'db_datadict_%' ORDER BY schema_name;
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
NULL db_datadict_1 latin1 latin1_swedish_ci NULL
NULL db_datadict_2 latin1 latin1_swedish_ci NULL
SHOW DATABASES LIKE 'db_datadict_%';
Database (db_datadict_%)
db_datadict_1
db_datadict_2
# Establish connection testuser1 (user=testuser1)
SELECT * FROM information_schema.schemata
WHERE schema_name LIKE 'db_datadict_%' ORDER BY schema_name;
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
NULL db_datadict_1 latin1 latin1_swedish_ci NULL
NULL db_datadict_2 latin1 latin1_swedish_ci NULL
SHOW DATABASES LIKE 'db_datadict_%';
Database (db_datadict_%)
db_datadict_1
db_datadict_2
# Establish connection testuser2 (user=testuser2)
SELECT * FROM information_schema.schemata
WHERE schema_name LIKE 'db_datadict_%' ORDER BY schema_name;
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
NULL db_datadict_1 latin1 latin1_swedish_ci NULL
NULL db_datadict_2 latin1 latin1_swedish_ci NULL
SHOW DATABASES LIKE 'db_datadict_%';
Database (db_datadict_%)
db_datadict_1
db_datadict_2
# Establish connection testuser3 (user=testuser3)
SELECT * FROM information_schema.schemata
WHERE schema_name LIKE 'db_datadict_%' ORDER BY schema_name;
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
NULL db_datadict_1 latin1 latin1_swedish_ci NULL
NULL db_datadict_2 latin1 latin1_swedish_ci NULL
SHOW DATABASES LIKE 'db_datadict_%';
Database (db_datadict_%)
db_datadict_1
db_datadict_2
# Switch to connection default and close connections testuser1,testuser2,testuser3
DROP USER 'testuser1'@'localhost';
DROP USER 'testuser2'@'localhost';
DROP USER 'testuser3'@'localhost';
DROP DATABASE db_datadict_1;
DROP DATABASE db_datadict_2;
#################################################################################
# Testcases 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.SCHEMATA modifications
#################################################################################
DROP DATABASE IF EXISTS db_datadict;
SELECT * FROM information_schema.schemata WHERE schema_name = 'db_datadict';
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
CREATE DATABASE db_datadict CHARACTER SET 'latin1' COLLATE 'latin1_swedish_ci';
SELECT * FROM information_schema.schemata WHERE schema_name = 'db_datadict';
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
NULL db_datadict latin1 latin1_swedish_ci NULL
SELECT schema_name, default_character_set_name
FROM information_schema.schemata WHERE schema_name = 'db_datadict';
schema_name default_character_set_name
db_datadict latin1
ALTER SCHEMA db_datadict CHARACTER SET 'utf8';
SELECT schema_name, default_character_set_name
FROM information_schema.schemata WHERE schema_name = 'db_datadict';
schema_name default_character_set_name
db_datadict utf8
ALTER SCHEMA db_datadict CHARACTER SET 'latin1';
SELECT schema_name, default_collation_name FROM information_schema.schemata
WHERE schema_name = 'db_datadict';
schema_name default_collation_name
db_datadict latin1_swedish_ci
ALTER SCHEMA db_datadict COLLATE 'latin1_general_cs';
SELECT schema_name, default_collation_name FROM information_schema.schemata
WHERE schema_name = 'db_datadict';
schema_name default_collation_name
db_datadict latin1_general_cs
SELECT schema_name
FROM information_schema.schemata WHERE schema_name = 'db_datadict';
schema_name
db_datadict
DROP DATABASE db_datadict;
SELECT schema_name
FROM information_schema.schemata WHERE schema_name = 'db_datadict';
schema_name
########################################################################
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
# DDL on INFORMATION_SCHEMA tables are not supported
########################################################################
DROP DATABASE IF EXISTS db_datadict;
CREATE DATABASE db_datadict CHARACTER SET 'latin1' COLLATE 'latin1_swedish_ci';
INSERT INTO information_schema.schemata
(catalog_name, schema_name, default_character_set_name, sql_path)
VALUES (NULL, 'db1', 'latin1', NULL);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
INSERT INTO information_schema.schemata
SELECT * FROM information_schema.schemata;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
UPDATE information_schema.schemata
SET default_character_set_name = 'utf8'
WHERE schema_name = 'db_datadict';
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
UPDATE information_schema.schemata SET catalog_name = 't_4711';
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
DELETE FROM information_schema.schemata WHERE schema_name = 'db_datadict';
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
TRUNCATE information_schema.schemata;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
CREATE INDEX i1 ON information_schema.schemata(schema_name);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
ALTER TABLE information_schema.schemata ADD f1 INT;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
DROP TABLE information_schema.schemata;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
ALTER TABLE information_schema.schemata RENAME db_datadict.schemata;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
ALTER TABLE information_schema.schemata RENAME information_schema.xschemata;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
DROP DATABASE db_datadict;
This diff is collapsed.
DROP DATABASE IF EXISTS db_datadict;
CREATE DATABASE db_datadict;
DROP USER testuser1@localhost;
CREATE USER testuser1@localhost;
GRANT SELECT ON db_datadict.* TO testuser1@localhost;
SELECT * FROM information_schema.table_constraints
WHERE table_schema = 'mysql'
ORDER BY table_schema,table_name,constraint_name;
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
NULL mysql PRIMARY mysql columns_priv PRIMARY KEY
NULL mysql PRIMARY mysql db PRIMARY KEY
NULL mysql PRIMARY mysql func PRIMARY KEY
NULL mysql name mysql help_category UNIQUE
NULL mysql PRIMARY mysql help_category PRIMARY KEY
NULL mysql name mysql help_keyword UNIQUE
NULL mysql PRIMARY mysql help_keyword PRIMARY KEY
NULL mysql PRIMARY mysql help_relation PRIMARY KEY
NULL mysql name mysql help_topic UNIQUE
NULL mysql PRIMARY mysql help_topic PRIMARY KEY
NULL mysql PRIMARY mysql host PRIMARY KEY
NULL mysql PRIMARY mysql proc PRIMARY KEY
NULL mysql PRIMARY mysql procs_priv PRIMARY KEY
NULL mysql PRIMARY mysql tables_priv PRIMARY KEY
NULL mysql PRIMARY mysql time_zone PRIMARY KEY
NULL mysql PRIMARY mysql time_zone_leap_second PRIMARY KEY
NULL mysql PRIMARY mysql time_zone_name PRIMARY KEY
NULL mysql PRIMARY mysql time_zone_transition PRIMARY KEY
NULL mysql PRIMARY mysql time_zone_transition_type PRIMARY KEY
NULL mysql PRIMARY mysql user PRIMARY KEY
# Establish connection testuser1 (user=testuser1)
SELECT * FROM information_schema.table_constraints
WHERE table_schema = 'mysql'
ORDER BY table_schema,table_name,constraint_name;
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
NULL mysql PRIMARY mysql columns_priv PRIMARY KEY
NULL mysql PRIMARY mysql db PRIMARY KEY
NULL mysql PRIMARY mysql func PRIMARY KEY
NULL mysql name mysql help_category UNIQUE
NULL mysql PRIMARY mysql help_category PRIMARY KEY
NULL mysql name mysql help_keyword UNIQUE
NULL mysql PRIMARY mysql help_keyword PRIMARY KEY
NULL mysql PRIMARY mysql help_relation PRIMARY KEY
NULL mysql name mysql help_topic UNIQUE
NULL mysql PRIMARY mysql help_topic PRIMARY KEY
NULL mysql PRIMARY mysql host PRIMARY KEY
NULL mysql PRIMARY mysql proc PRIMARY KEY
NULL mysql PRIMARY mysql procs_priv PRIMARY KEY
NULL mysql PRIMARY mysql tables_priv PRIMARY KEY
NULL mysql PRIMARY mysql time_zone PRIMARY KEY
NULL mysql PRIMARY mysql time_zone_leap_second PRIMARY KEY
NULL mysql PRIMARY mysql time_zone_name PRIMARY KEY
NULL mysql PRIMARY mysql time_zone_transition PRIMARY KEY
NULL mysql PRIMARY mysql time_zone_transition_type PRIMARY KEY
NULL mysql PRIMARY mysql user PRIMARY KEY
# Switch to connection default and close connection testuser1
DROP USER testuser1@localhost;
DROP DATABASE db_datadict;
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -14,3 +14,4 @@ innodb_storedproc: (changes of WL#2984, using storeproc_nn instead)
memory_storedproc: (changes of WL#2984, using storeproc_nn instead)
myisam_storedproc: (changes of WL#2984, using storeproc_nn instead)
ndb_trig_1011ext: Bug#32656 NDB: Duplicate key error aborts transaction in handler. Doesn't talk back to SQL
is_tables_ndb: Bug#37198 user without any right on schema sees NDB table
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment