diff options
author | unknown <gluh@eagle.(none)> | 2007-09-20 14:10:05 +0500 |
---|---|---|
committer | unknown <gluh@eagle.(none)> | 2007-09-20 14:10:05 +0500 |
commit | d0f794247408a25058726c79a6c841f5a6c9d7c8 (patch) | |
tree | 6b9ec49af02f09921c19be300af3675d88dd0e14 /mysql-test | |
parent | ed34aabe653d5863b8fcd03960b8a8e3201e3991 (diff) | |
parent | fac190a28ba0d03e71fb0c05ddf6ac8d2a9823a8 (diff) | |
download | mariadb-git-d0f794247408a25058726c79a6c841f5a6c9d7c8.tar.gz |
Merge mysql.com:/home/gluh/MySQL/Merge/5.0-opt
into mysql.com:/home/gluh/MySQL/Merge/5.1-opt
mysql-test/r/alter_table.result:
Auto merged
mysql-test/r/create.result:
Auto merged
mysql-test/r/ctype_collate.result:
Auto merged
mysql-test/r/ctype_recoding.result:
Auto merged
mysql-test/r/default.result:
Auto merged
mysql-test/r/gis.result:
Auto merged
mysql-test/r/grant.result:
Auto merged
mysql-test/r/information_schema.result:
Auto merged
mysql-test/r/key.result:
Auto merged
mysql-test/r/mysql.result:
Auto merged
mysql-test/r/ps_1general.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/r/type_enum.result:
Auto merged
mysql-test/r/type_ranges.result:
Auto merged
mysql-test/r/show_check.result:
manual merge
mysql-test/t/information_schema.test:
manual merge
sql/sql_show.cc:
manual merge
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/alter_table.result | 2 | ||||
-rw-r--r-- | mysql-test/r/create.result | 2 | ||||
-rw-r--r-- | mysql-test/r/ctype_collate.result | 2 | ||||
-rw-r--r-- | mysql-test/r/ctype_recoding.result | 6 | ||||
-rw-r--r-- | mysql-test/r/default.result | 2 | ||||
-rw-r--r-- | mysql-test/r/gis.result | 18 | ||||
-rw-r--r-- | mysql-test/r/grant.result | 2 | ||||
-rw-r--r-- | mysql-test/r/information_schema.result | 33 | ||||
-rw-r--r-- | mysql-test/r/key.result | 22 | ||||
-rw-r--r-- | mysql-test/r/mysql.result | 4 | ||||
-rw-r--r-- | mysql-test/r/ps_1general.result | 6 | ||||
-rw-r--r-- | mysql-test/r/show_check.result | 256 | ||||
-rw-r--r-- | mysql-test/r/sp.result | 4 | ||||
-rw-r--r-- | mysql-test/r/type_enum.result | 2 | ||||
-rw-r--r-- | mysql-test/r/type_ranges.result | 22 | ||||
-rw-r--r-- | mysql-test/t/information_schema.test | 17 |
16 files changed, 344 insertions, 56 deletions
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 7c0ac177cb5..786a715b940 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -54,7 +54,7 @@ SHOW FULL COLUMNS FROM t1; Field Type Collation Null Key Default Extra Privileges Comment GROUP_ID int(10) unsigned NULL NO PRI 0 # LANG_ID smallint(5) unsigned NULL NO PRI 0 # -NAME char(80) latin1_swedish_ci NO MUL # +NAME char(80) latin1_swedish_ci NO MUL NULL # DROP TABLE t1; create table t1 (n int); insert into t1 values(9),(3),(12),(10); diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 84a620336dc..b370fbf6fbe 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -443,7 +443,7 @@ d date YES NULL e varchar(1) NO f datetime YES NULL g time YES NULL -h longblob NO +h longblob NO NULL dd time YES NULL select * from t2; a b c d e f g h dd diff --git a/mysql-test/r/ctype_collate.result b/mysql-test/r/ctype_collate.result index f476ec68371..026c0ebdcf2 100644 --- a/mysql-test/r/ctype_collate.result +++ b/mysql-test/r/ctype_collate.result @@ -488,7 +488,7 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SHOW FIELDS FROM t1; Field Type Null Key Default Extra -latin1_f char(32) NO +latin1_f char(32) NO NULL ALTER TABLE t1 CHANGE latin1_f latin1_f CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin; SHOW CREATE TABLE t1; diff --git a/mysql-test/r/ctype_recoding.result b/mysql-test/r/ctype_recoding.result index fe5842f9880..304e37facb1 100644 --- a/mysql-test/r/ctype_recoding.result +++ b/mysql-test/r/ctype_recoding.result @@ -54,7 +54,7 @@ Table Create Table ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT=' ' SHOW FIELDS FROM ; Field Type Null Key Default Extra - char(32) NO + char(32) NO NULL SET CHARACTER SET cp1251; SHOW TABLES; Tables_in_test @@ -66,7 +66,7 @@ Table Create Table ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT=' ' SHOW FIELDS FROM ; Field Type Null Key Default Extra - char(32) NO + char(32) NO NULL SET CHARACTER SET utf8; SHOW TABLES; Tables_in_test @@ -78,7 +78,7 @@ Table Create Table ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='комментарий таблицы' SHOW FIELDS FROM таблица; Field Type Null Key Default Extra -поле char(32) NO +поле char(32) NO NULL SET CHARACTER SET koi8r; DROP TABLE ; SET CHARACTER SET default; diff --git a/mysql-test/r/default.result b/mysql-test/r/default.result index cf9ef4f8f8b..e65e015eff9 100644 --- a/mysql-test/r/default.result +++ b/mysql-test/r/default.result @@ -115,7 +115,7 @@ Warning 1364 Field 'd' doesn't have a default value desc bug20691; Field Type Null Key Default Extra i int(11) YES NULL -d datetime NO +d datetime NO NULL dn datetime NO 0000-00-00 00:00:00 insert into bug20691 values (3, DEFAULT, DEFAULT), (3, '1975-07-10 07:10:03', '1978-01-13 14:08:51'), (3, DEFAULT, DEFAULT); Warnings: diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index f68559fa8ea..7b4b02f3ff3 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -9,35 +9,35 @@ CREATE TABLE gis_geometrycollection (fid INTEGER NOT NULL PRIMARY KEY, g GEOMET CREATE TABLE gis_geometry (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRY); SHOW FIELDS FROM gis_point; Field Type Null Key Default Extra -fid int(11) NO PRI +fid int(11) NO PRI NULL g point YES NULL SHOW FIELDS FROM gis_line; Field Type Null Key Default Extra -fid int(11) NO PRI +fid int(11) NO PRI NULL g linestring YES NULL SHOW FIELDS FROM gis_polygon; Field Type Null Key Default Extra -fid int(11) NO PRI +fid int(11) NO PRI NULL g polygon YES NULL SHOW FIELDS FROM gis_multi_point; Field Type Null Key Default Extra -fid int(11) NO PRI +fid int(11) NO PRI NULL g multipoint YES NULL SHOW FIELDS FROM gis_multi_line; Field Type Null Key Default Extra -fid int(11) NO PRI +fid int(11) NO PRI NULL g multilinestring YES NULL SHOW FIELDS FROM gis_multi_polygon; Field Type Null Key Default Extra -fid int(11) NO PRI +fid int(11) NO PRI NULL g multipolygon YES NULL SHOW FIELDS FROM gis_geometrycollection; Field Type Null Key Default Extra -fid int(11) NO PRI +fid int(11) NO PRI NULL g geometrycollection YES NULL SHOW FIELDS FROM gis_geometry; Field Type Null Key Default Extra -fid int(11) NO PRI +fid int(11) NO PRI NULL g geometry YES NULL INSERT INTO gis_point VALUES (101, PointFromText('POINT(10 10)')), @@ -430,7 +430,7 @@ mln multilinestring YES NULL mpg multipolygon YES NULL gc geometrycollection YES NULL gm geometry YES NULL -fid int(11) NO +fid int(11) NO NULL DROP TABLE t1; SELECT AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)')))); AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)')))) diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 0d4dad39882..5b0bf152fef 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -529,7 +529,7 @@ Db char(64) NO PRI User char(16) NO PRI Table_name char(64) NO PRI Grantor char(77) NO MUL -Timestamp timestamp NO CURRENT_TIMESTAMP +Timestamp timestamp NO 0000-00-00 00:00:00 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/information_schema.result b/mysql-test/r/information_schema.result index d0b6813cfd1..885acf5c744 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -1036,7 +1036,7 @@ b NULL use test; show columns from t1; Field Type Null Key Default Extra -a int(11) NO +a int(11) NO NULL b int(11) YES NULL drop table t1; CREATE TABLE t1 (a int); @@ -1434,6 +1434,37 @@ where event_object_table='t1'; trigger_name drop user mysqltest_1@localhost; drop database mysqltest; +create table t1 ( +f1 varchar(50), +f2 varchar(50) not null, +f3 varchar(50) default '', +f4 varchar(50) default NULL, +f5 bigint not null, +f6 bigint not null default 10, +f7 datetime not null, +f8 datetime default '2006-01-01' +); +select column_default from information_schema.columns where table_name= 't1'; +column_default +NULL +NULL + +NULL +NULL +10 +NULL +2006-01-01 00:00:00 +show columns from t1; +Field Type Null Key Default Extra +f1 varchar(50) YES NULL +f2 varchar(50) NO NULL +f3 varchar(50) YES +f4 varchar(50) YES NULL +f5 bigint(20) NO NULL +f6 bigint(20) NO 10 +f7 datetime NO NULL +f8 datetime YES 2006-01-01 00:00:00 +drop table t1; End of 5.0 tests. select * from information_schema.engines WHERE ENGINE="MyISAM"; ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result index e348a387252..a2bed75a709 100644 --- a/mysql-test/r/key.result +++ b/mysql-test/r/key.result @@ -336,8 +336,8 @@ UNIQUE i1idx (i1), UNIQUE i2idx (i2)); desc t1; Field Type Null Key Default Extra -i1 int(11) NO PRI -i2 int(11) NO UNI +i1 int(11) NO PRI NULL +i2 int(11) NO UNI NULL show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -392,27 +392,27 @@ drop table t1; create table t1 (a int not null primary key, b varchar(20) not null unique); desc t1; Field Type Null Key Default Extra -a int(11) NO PRI -b varchar(20) NO UNI +a int(11) NO PRI NULL +b varchar(20) NO UNI NULL drop table t1; create table t1 (a int not null primary key, b int not null unique); desc t1; Field Type Null Key Default Extra -a int(11) NO PRI -b int(11) NO UNI +a int(11) NO PRI NULL +b int(11) NO UNI NULL drop table t1; create table t1 (a int not null primary key, b varchar(20) not null, unique (b(10))); desc t1; Field Type Null Key Default Extra -a int(11) NO PRI -b varchar(20) NO UNI +a int(11) NO PRI NULL +b varchar(20) NO UNI NULL drop table t1; create table t1 (a int not null primary key, b varchar(20) not null, c varchar(20) not null, unique(b(10),c(10))); desc t1; Field Type Null Key Default Extra -a int(11) NO PRI -b varchar(20) NO MUL -c varchar(20) NO +a int(11) NO PRI NULL +b varchar(20) NO MUL NULL +c varchar(20) NO NULL drop table t1; create table t1 ( c1 int, diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result index df77bc99c22..4e39fb28454 100644 --- a/mysql-test/r/mysql.result +++ b/mysql-test/r/mysql.result @@ -91,7 +91,7 @@ i j k NULL 1 NULL Field Type Null Key Default Extra i int(11) YES NULL -j int(11) NO +j int(11) NO NULL k int(11) YES NULL +------+---+------+ | i | j | k | @@ -102,7 +102,7 @@ k int(11) YES NULL | Field | Type | Null | Key | Default | Extra | +-------+---------+------+-----+---------+-------+ | i | int(11) | YES | | NULL | | -| j | int(11) | NO | | | | +| j | int(11) | NO | | NULL | | | k | int(11) | YES | | NULL | | +-------+---------+------+-----+---------+-------+ i s1 diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index a532324719c..1c5f0e4dfd6 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -269,7 +269,7 @@ prepare stmt4 from ' show columns from t2 where field in (select ?) '; SET @arg00="a"; execute stmt4 using @arg00; Field Type Null Key Default Extra -a int(11) NO PRI +a int(11) NO PRI NULL SET @arg00="b"; execute stmt4 using @arg00; Field Type Null Key Default Extra @@ -280,7 +280,7 @@ Field Type Null Key Default Extra prepare stmt4 from ' show columns from t2 from test like ''a%'' '; execute stmt4; Field Type Null Key Default Extra -a int(11) NO PRI +a int(11) NO PRI NULL create index t2_idx on t2(b); prepare stmt4 from ' show index from t2 from test '; execute stmt4; @@ -389,7 +389,7 @@ drop database mysqltest ; prepare stmt3 from ' describe t2 '; execute stmt3; Field Type Null Key Default Extra -a int(11) NO PRI +a int(11) NO PRI NULL b char(10) YES MUL NULL drop table t2 ; execute stmt3; diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 75585974a32..9577db1cd8e 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -228,7 +228,7 @@ show full columns from t1; Field Type Collation Null Key Default Extra Privileges Comment test_set set('val1','val2','val3') latin1_swedish_ci NO select,insert,update,references name char(20) latin1_swedish_ci YES O'Brien select,insert,update,references O'Brien as default -c int(11) NULL NO select,insert,update,references int column +c int(11) NULL NO NULL select,insert,update,references int column c-b int(11) NULL YES NULL select,insert,update,references name with a minus space 2 int(11) NULL YES NULL select,insert,update,references name with a space drop table t1; @@ -791,6 +791,246 @@ select 1 from information_schema.tables limit 1; show status like 'slow_queries'; Variable_name Value Slow_queries 1 +---------------------------------------------------------------- +SHOW TRIGGERS LIKE 't1'; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def TRIGGERS TRIGGER_NAME Trigger 253 192 5 N 1 0 33 +def TRIGGERS EVENT_MANIPULATION Event 253 18 6 N 1 0 33 +def TRIGGERS EVENT_OBJECT_TABLE Table 253 192 2 N 1 0 33 +def TRIGGERS ACTION_STATEMENT Statement 252 589815 10 N 17 0 33 +def TRIGGERS ACTION_TIMING Timing 253 18 6 N 1 0 33 +def TRIGGERS CREATED Created 12 19 0 Y 128 0 63 +def TRIGGERS SQL_MODE sql_mode 252 589815 0 N 17 0 33 +def TRIGGERS DEFINER Definer 252 589815 14 N 17 0 33 +Trigger Event Table Statement Timing Created sql_mode Definer +t1_bi INSERT t1 SET @a = 1 BEFORE NULL root@localhost +---------------------------------------------------------------- +SELECT +TRIGGER_CATALOG, +TRIGGER_SCHEMA, +TRIGGER_NAME, +EVENT_MANIPULATION, +EVENT_OBJECT_CATALOG, +EVENT_OBJECT_SCHEMA, +EVENT_OBJECT_TABLE, +ACTION_CONDITION, +ACTION_STATEMENT, +ACTION_ORIENTATION, +ACTION_TIMING, +ACTION_REFERENCE_OLD_TABLE, +ACTION_REFERENCE_NEW_TABLE, +ACTION_REFERENCE_OLD_ROW, +ACTION_REFERENCE_NEW_ROW, +SQL_MODE, +DEFINER +FROM INFORMATION_SCHEMA.TRIGGERS +WHERE trigger_name = 't1_bi'; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def TRIGGERS TRIGGER_CATALOG TRIGGER_CATALOG 253 1536 0 Y 0 0 33 +def TRIGGERS TRIGGER_SCHEMA TRIGGER_SCHEMA 253 192 4 N 1 0 33 +def TRIGGERS TRIGGER_NAME TRIGGER_NAME 253 192 5 N 1 0 33 +def TRIGGERS EVENT_MANIPULATION EVENT_MANIPULATION 253 18 6 N 1 0 33 +def TRIGGERS EVENT_OBJECT_CATALOG EVENT_OBJECT_CATALOG 253 1536 0 Y 0 0 33 +def TRIGGERS EVENT_OBJECT_SCHEMA EVENT_OBJECT_SCHEMA 253 192 4 N 1 0 33 +def TRIGGERS EVENT_OBJECT_TABLE EVENT_OBJECT_TABLE 253 192 2 N 1 0 33 +def TRIGGERS ACTION_CONDITION ACTION_CONDITION 252 589815 0 Y 16 0 33 +def TRIGGERS ACTION_STATEMENT ACTION_STATEMENT 252 589815 10 N 17 0 33 +def TRIGGERS ACTION_ORIENTATION ACTION_ORIENTATION 253 27 3 N 1 0 33 +def TRIGGERS ACTION_TIMING ACTION_TIMING 253 18 6 N 1 0 33 +def TRIGGERS ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_OLD_TABLE 253 192 0 Y 0 0 33 +def TRIGGERS ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_NEW_TABLE 253 192 0 Y 0 0 33 +def TRIGGERS ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_OLD_ROW 253 9 3 N 1 0 33 +def TRIGGERS ACTION_REFERENCE_NEW_ROW ACTION_REFERENCE_NEW_ROW 253 9 3 N 1 0 33 +def TRIGGERS SQL_MODE SQL_MODE 252 589815 0 N 17 0 33 +def TRIGGERS DEFINER DEFINER 252 589815 14 N 17 0 33 +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW SQL_MODE DEFINER +NULL test t1_bi INSERT NULL test t1 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW root@localhost +---------------------------------------------------------------- +SHOW CREATE VIEW v1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def View 253 63 2 N 1 31 33 +def Create View 253 1023 103 N 1 31 33 +View Create View +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `1` +---------------------------------------------------------------- +SELECT * +FROM INFORMATION_SCHEMA.VIEWS +WHERE table_name = 'v1'; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def VIEWS TABLE_CATALOG TABLE_CATALOG 253 1536 0 Y 0 0 33 +def VIEWS TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33 +def VIEWS TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33 +def VIEWS VIEW_DEFINITION VIEW_DEFINITION 252 589815 41 N 17 0 33 +def VIEWS CHECK_OPTION CHECK_OPTION 253 24 4 N 1 0 33 +def VIEWS IS_UPDATABLE IS_UPDATABLE 253 9 2 N 1 0 33 +def VIEWS DEFINER DEFINER 253 231 14 N 1 0 33 +def VIEWS SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33 +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE +NULL test v1 /* ALGORITHM=UNDEFINED */ select 1 AS `1` NONE NO root@localhost DEFINER +---------------------------------------------------------------- +SHOW CREATE PROCEDURE p1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def Procedure 253 63 2 N 1 31 33 +def sql_mode 253 0 0 N 1 31 33 +def Create Procedure 253 2046 59 Y 0 31 33 +Procedure sql_mode Create Procedure +p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() +SELECT 1 +---------------------------------------------------------------- +SELECT +SPECIFIC_NAME, +ROUTINE_CATALOG, +ROUTINE_SCHEMA, +ROUTINE_NAME, +ROUTINE_TYPE, +DTD_IDENTIFIER, +ROUTINE_BODY, +ROUTINE_DEFINITION, +EXTERNAL_NAME, +EXTERNAL_LANGUAGE, +PARAMETER_STYLE, +IS_DETERMINISTIC, +SQL_DATA_ACCESS, +SQL_PATH, +SECURITY_TYPE, +SQL_MODE, +ROUTINE_COMMENT, +DEFINER +FROM INFORMATION_SCHEMA.ROUTINES +WHERE routine_name = 'p1'; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def ROUTINES SPECIFIC_NAME SPECIFIC_NAME 253 192 2 N 1 0 33 +def ROUTINES ROUTINE_CATALOG ROUTINE_CATALOG 253 1536 0 Y 0 0 33 +def ROUTINES ROUTINE_SCHEMA ROUTINE_SCHEMA 253 192 4 N 1 0 33 +def ROUTINES ROUTINE_NAME ROUTINE_NAME 253 192 2 N 1 0 33 +def ROUTINES ROUTINE_TYPE ROUTINE_TYPE 253 27 9 N 1 0 33 +def ROUTINES DTD_IDENTIFIER DTD_IDENTIFIER 253 192 0 Y 0 0 33 +def ROUTINES ROUTINE_BODY ROUTINE_BODY 253 24 3 N 1 0 33 +def ROUTINES ROUTINE_DEFINITION ROUTINE_DEFINITION 252 589815 8 Y 16 0 33 +def ROUTINES EXTERNAL_NAME EXTERNAL_NAME 253 192 0 Y 0 0 33 +def ROUTINES EXTERNAL_LANGUAGE EXTERNAL_LANGUAGE 253 192 0 Y 0 0 33 +def ROUTINES PARAMETER_STYLE PARAMETER_STYLE 253 24 3 N 1 0 33 +def ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9 2 N 1 0 33 +def ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 1 0 33 +def ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33 +def ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33 +def ROUTINES SQL_MODE SQL_MODE 252 589815 0 N 17 0 33 +def ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 253 192 0 N 1 0 33 +def ROUTINES DEFINER DEFINER 253 231 14 N 1 0 33 +SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE SQL_MODE ROUTINE_COMMENT DEFINER +p1 NULL test p1 PROCEDURE NULL SQL SELECT 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER root@localhost +---------------------------------------------------------------- +SHOW CREATE FUNCTION f1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def Function 253 63 2 N 1 31 33 +def sql_mode 253 0 0 N 1 31 33 +def Create Function 253 2046 74 Y 0 31 33 +Function sql_mode Create Function +f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) +RETURN 1 +---------------------------------------------------------------- +SELECT +SPECIFIC_NAME, +ROUTINE_CATALOG, +ROUTINE_SCHEMA, +ROUTINE_NAME, +ROUTINE_TYPE, +DTD_IDENTIFIER, +ROUTINE_BODY, +ROUTINE_DEFINITION, +EXTERNAL_NAME, +EXTERNAL_LANGUAGE, +PARAMETER_STYLE, +IS_DETERMINISTIC, +SQL_DATA_ACCESS, +SQL_PATH, +SECURITY_TYPE, +SQL_MODE, +ROUTINE_COMMENT, +DEFINER +FROM INFORMATION_SCHEMA.ROUTINES +WHERE routine_name = 'f1'; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def ROUTINES SPECIFIC_NAME SPECIFIC_NAME 253 192 2 N 1 0 33 +def ROUTINES ROUTINE_CATALOG ROUTINE_CATALOG 253 1536 0 Y 0 0 33 +def ROUTINES ROUTINE_SCHEMA ROUTINE_SCHEMA 253 192 4 N 1 0 33 +def ROUTINES ROUTINE_NAME ROUTINE_NAME 253 192 2 N 1 0 33 +def ROUTINES ROUTINE_TYPE ROUTINE_TYPE 253 27 8 N 1 0 33 +def ROUTINES DTD_IDENTIFIER DTD_IDENTIFIER 253 192 7 Y 0 0 33 +def ROUTINES ROUTINE_BODY ROUTINE_BODY 253 24 3 N 1 0 33 +def ROUTINES ROUTINE_DEFINITION ROUTINE_DEFINITION 252 589815 8 Y 16 0 33 +def ROUTINES EXTERNAL_NAME EXTERNAL_NAME 253 192 0 Y 0 0 33 +def ROUTINES EXTERNAL_LANGUAGE EXTERNAL_LANGUAGE 253 192 0 Y 0 0 33 +def ROUTINES PARAMETER_STYLE PARAMETER_STYLE 253 24 3 N 1 0 33 +def ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9 2 N 1 0 33 +def ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 1 0 33 +def ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33 +def ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33 +def ROUTINES SQL_MODE SQL_MODE 252 589815 0 N 17 0 33 +def ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 253 192 0 N 1 0 33 +def ROUTINES DEFINER DEFINER 253 231 14 N 1 0 33 +SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE SQL_MODE ROUTINE_COMMENT DEFINER +f1 NULL test f1 FUNCTION int(11) SQL RETURN 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER root@localhost +---------------------------------------------------------------- +DROP DATABASE mysqltest1; +DROP TABLE t1; +DROP VIEW v1; +DROP PROCEDURE p1; +DROP FUNCTION f1; +set names koi8r; +DROP DATABASE IF EXISTS mysqltest1; +CREATE DATABASE mysqltest1; +use mysqltest1; +CREATE TABLE t1(ËÏÌÏÎËÁ1 INT); + +---> Dumping mysqltest1 to show_check.mysqltest1.sql + + +DROP DATABASE mysqltest1; + + +---> Restoring mysqltest1... +SHOW CREATE TABLE mysqltest1.t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `ËÏÌÏÎËÁ1` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP DATABASE mysqltest1; +use test; +flush status; +show variables like "log_queries_not_using_indexes"; +Variable_name Value +log_queries_not_using_indexes ON +select 1 from information_schema.tables limit 1; +1 +1 +show status like 'slow_queries'; +Variable_name Value +Slow_queries 1 +set global log_queries_not_using_indexes=OFF; +show variables like "log_queries_not_using_indexes"; +Variable_name Value +log_queries_not_using_indexes OFF +select 1 from information_schema.tables limit 1; +1 +1 +show status like 'slow_queries'; +Variable_name Value +Slow_queries 1 +set global log_queries_not_using_indexes=ON; +show variables like "log_queries_not_using_indexes"; +Variable_name Value +log_queries_not_using_indexes ON +select 1 from information_schema.tables limit 1; +1 +1 +show status like 'slow_queries'; +Variable_name Value +Slow_queries 2 +show variables like 'myisam_recover_options'; +Variable_name Value +myisam_recover_options OFF +End of 5.0 tests create table t1 (a int); create trigger tr1 before insert on t1 for each row begin @@ -1204,7 +1444,7 @@ set names koi8r; DROP DATABASE IF EXISTS mysqltest1; CREATE DATABASE mysqltest1; use mysqltest1; -CREATE TABLE t1(1 INT); +CREATE TABLE t1(ËÏÌÏÎËÁ1 INT); ---> Dumping mysqltest1 to show_check.mysqltest1.sql @@ -1216,7 +1456,7 @@ DROP DATABASE mysqltest1; SHOW CREATE TABLE mysqltest1.t1; Table Create Table t1 CREATE TABLE `t1` ( - `1` int(11) DEFAULT NULL + `ËÏÌÏÎËÁ1` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP DATABASE mysqltest1; use test; @@ -1393,14 +1633,14 @@ DROP PROCEDURE IF EXISTS p1; DROP FUNCTION IF EXISTS f1; DROP TABLE IF EXISTS t1; DROP EVENT IF EXISTS ev1; -CREATE VIEW v1 AS SELECT '' AS test; -CREATE PROCEDURE p1() SELECT '' AS test; -CREATE FUNCTION f1() RETURNS CHAR(10) RETURN ''; +CREATE VIEW v1 AS SELECT 'ÔÅÓÔ' AS test; +CREATE PROCEDURE p1() SELECT 'ÔÅÓÔ' AS test; +CREATE FUNCTION f1() RETURNS CHAR(10) RETURN 'ÔÅÓÔ'; CREATE TABLE t1(c1 CHAR(10)); CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW -SET NEW.c1 = ''; -CREATE EVENT ev1 ON SCHEDULE AT '2030-01-01 00:00:00' DO SELECT '' AS test; +SET NEW.c1 = 'ÔÅÓÔ'; +CREATE EVENT ev1 ON SCHEDULE AT '2030-01-01 00:00:00' DO SELECT 'ÔÅÓÔ' AS test; set names utf8; SHOW CREATE VIEW v1; View Create View character_set_client collation_connection diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index da3e5818a54..55b27b0a733 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -2469,7 +2469,7 @@ Database (foo) Level Code Message Field Type Null Key Default Extra id char(16) NO -data int(11) NO +data int(11) NO NULL Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Database Table In_use Name_locked Privilege Context Comment @@ -2523,7 +2523,7 @@ Database (foo) Level Code Message Field Type Null Key Default Extra id char(16) NO -data int(11) NO +data int(11) NO NULL Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Database Table In_use Name_locked Privilege Context Comment diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result index 051cfe61384..813f912c5af 100644 --- a/mysql-test/r/type_enum.result +++ b/mysql-test/r/type_enum.result @@ -1675,7 +1675,7 @@ t1 CREATE TABLE `t1` ( show columns from t1; Field Type Null Key Default Extra a int(11) YES 1 -b enum('value','_value','') NO +b enum('value','_value','') NO NULL drop table t1; CREATE TABLE t1 (c enum('a', 'A') BINARY); INSERT INTO t1 VALUES ('a'),('A'); diff --git a/mysql-test/r/type_ranges.result b/mysql-test/r/type_ranges.result index 22580c155f3..149f0d2dca5 100644 --- a/mysql-test/r/type_ranges.result +++ b/mysql-test/r/type_ranges.result @@ -63,9 +63,9 @@ time_field time NULL YES NULL # date_time datetime NULL YES NULL # blob_col blob NULL YES NULL # tinyblob_col tinyblob NULL YES NULL # -mediumblob_col mediumblob NULL NO # -longblob_col longblob NULL NO # -options enum('one','two','tree') latin1_swedish_ci NO MUL # +mediumblob_col mediumblob NULL NO NULL # +longblob_col longblob NULL NO NULL # +options enum('one','two','tree') latin1_swedish_ci NO MUL NULL # flags set('one','two','tree') latin1_swedish_ci NO # show keys from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment @@ -214,7 +214,7 @@ Field Type Collation Null Key Default Extra Privileges Comment auto int(5) unsigned NULL NO MUL NULL auto_increment # string char(10) latin1_swedish_ci YES newdefault # tiny tinyint(4) NULL NO MUL 0 # -short smallint(6) NULL NO MUL # +short smallint(6) NULL NO MUL NULL # medium mediumint(8) NULL NO MUL 0 # long_int int(11) NULL NO 0 # longlong bigint(13) NULL NO MUL 0 # @@ -231,8 +231,8 @@ time_field time NULL YES NULL # 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 MUL # +mediumblob_col mediumblob NULL NO NULL # +options enum('one','two','tree') latin1_swedish_ci NO MUL NULL # flags set('one','two','tree') latin1_swedish_ci NO # new_field char(10) latin1_swedish_ci NO new # show full columns from t2; @@ -240,7 +240,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 # +short smallint(6) NULL NO NULL # medium mediumint(8) NULL NO 0 # long_int int(11) NULL NO 0 # longlong bigint(13) NULL NO 0 # @@ -257,8 +257,8 @@ time_field time NULL YES NULL # 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 # +mediumblob_col mediumblob NULL NO NULL # +options enum('one','two','tree') latin1_swedish_ci NO NULL # 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))); @@ -276,8 +276,8 @@ t1 int(1) NULL NO 0 # t2 varchar(1) latin1_swedish_ci NO # t3 varchar(256) latin1_swedish_ci NO # t4 varbinary(256) NULL NO # -t5 longtext latin1_swedish_ci NO # -t6 longblob NULL NO # +t5 longtext latin1_swedish_ci NO NULL # +t6 longblob NULL NO NULL # t7 char(0) latin1_swedish_ci NO # t8 binary(0) NULL NO # select t1,t2,length(t3),length(t4),length(t5),length(t6),t7,t8 from t2; diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index 8a3d62ba91f..6bcc14d4e49 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -1072,6 +1072,23 @@ connection default; drop user mysqltest_1@localhost; drop database mysqltest; +# +# Bug#27747 database metadata doesn't return sufficient column default info +# +create table t1 ( + f1 varchar(50), + f2 varchar(50) not null, + f3 varchar(50) default '', + f4 varchar(50) default NULL, + f5 bigint not null, + f6 bigint not null default 10, + f7 datetime not null, + f8 datetime default '2006-01-01' +); +select column_default from information_schema.columns where table_name= 't1'; +show columns from t1; +drop table t1; + --echo End of 5.0 tests. # # Show engines |