diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-06-13 20:18:40 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-06-13 20:18:40 +0200 |
commit | 36c753519865ca9615e834a4f3e5cdf270cef230 (patch) | |
tree | 40b9bd31bbfbe6b1eaf4be2e57f4195ca78badf7 | |
parent | 2533313895b21bdf2862779477b4cf54cb101013 (diff) | |
download | mariadb-git-36c753519865ca9615e834a4f3e5cdf270cef230.tar.gz |
MDEV-4519 SHOW EVENTS and SHOW PROCEDURE STATUS truncate long user names
fix I_S table definitions in sql_show.cc
-rw-r--r-- | include/mysql_com.h | 2 | ||||
-rw-r--r-- | mysql-test/r/grant_4332.result | 16 | ||||
-rw-r--r-- | mysql-test/r/information_schema_routines.result | 10 | ||||
-rw-r--r-- | mysql-test/r/show_check.result | 10 | ||||
-rw-r--r-- | mysql-test/suite/funcs_1/r/is_columns_is.result | 16 | ||||
-rw-r--r-- | mysql-test/suite/funcs_1/r/is_columns_is_embedded.result | 16 | ||||
-rw-r--r-- | mysql-test/suite/funcs_1/r/is_events.result | 6 | ||||
-rw-r--r-- | mysql-test/suite/funcs_1/r/is_routines.result | 6 | ||||
-rw-r--r-- | mysql-test/suite/funcs_1/r/is_triggers.result | 6 | ||||
-rw-r--r-- | mysql-test/suite/funcs_1/r/is_views.result | 6 | ||||
-rw-r--r-- | mysql-test/t/grant_4332.test | 12 | ||||
-rw-r--r-- | sql/sql_show.cc | 12 |
12 files changed, 74 insertions, 44 deletions
diff --git a/include/mysql_com.h b/include/mysql_com.h index bb89cd09efe..0d57b178937 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -27,6 +27,8 @@ #define USERNAME_CHAR_LENGTH 128 #define NAME_LEN (NAME_CHAR_LEN*SYSTEM_CHARSET_MBMAXLEN) #define USERNAME_LENGTH (USERNAME_CHAR_LENGTH*SYSTEM_CHARSET_MBMAXLEN) +#define DEFINER_CHAR_LENGTH (USERNAME_CHAR_LENGTH + HOSTNAME_LENGTH + 1) +#define DEFINER_LENGTH (USERNAME_LENGTH + HOSTNAME_LENGTH + 1) #define MYSQL_AUTODETECT_CHARSET_NAME "auto" diff --git a/mysql-test/r/grant_4332.result b/mysql-test/r/grant_4332.result index b5d58266afc..cca7825a07e 100644 --- a/mysql-test/r/grant_4332.result +++ b/mysql-test/r/grant_4332.result @@ -64,9 +64,25 @@ show create procedure test.p1; Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation p1 CREATE DEFINER=`c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0`@`localhost` PROCEDURE `p1`() select user(), current_user(), user from mysql.tables_priv latin1 latin1_swedish_ci latin1_swedish_ci +select definer from information_schema.routines; +definer +c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0@localhost create table test.t1 (a text); create event e1 on schedule every 1 second do insert test.t1 values (concat(user(), ' ', current_user())); +select definer from information_schema.events; +definer +c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0@localhost +create view v1 as select * from t1; +select definer from information_schema.views; +definer +c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0@localhost +drop view v1; +create trigger tr1 before delete on t1 for each row set @a:=1; +select definer from information_schema.triggers; +definer +c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0@localhost +drop trigger tr1; connect(localhost,c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0,foobar,test,MASTER_PORT,MASTER_SOCKET); ERROR 28000: Access denied for user 'c80cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc0'@'localhost' (using password: YES) call test.p1(); diff --git a/mysql-test/r/information_schema_routines.result b/mysql-test/r/information_schema_routines.result index 36f8637faa9..b8f4fb9b1ef 100644 --- a/mysql-test/r/information_schema_routines.result +++ b/mysql-test/r/information_schema_routines.result @@ -30,7 +30,7 @@ ROUTINES CREATE TEMPORARY TABLE `ROUTINES` ( `LAST_ALTERED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `SQL_MODE` varchar(8192) NOT NULL DEFAULT '', `ROUTINE_COMMENT` longtext NOT NULL, - `DEFINER` varchar(77) NOT NULL DEFAULT '', + `DEFINER` varchar(189) NOT NULL DEFAULT '', `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '', `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '', `DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT '' @@ -587,14 +587,14 @@ ORDINAL_POSITION 28 COLUMN_DEFAULT IS_NULLABLE NO DATA_TYPE varchar -CHARACTER_MAXIMUM_LENGTH 77 -CHARACTER_OCTET_LENGTH 231 +CHARACTER_MAXIMUM_LENGTH 189 +CHARACTER_OCTET_LENGTH 567 NUMERIC_PRECISION NULL NUMERIC_SCALE NULL DATETIME_PRECISION NULL CHARACTER_SET_NAME utf8 COLLATION_NAME utf8_general_ci -COLUMN_TYPE varchar(77) +COLUMN_TYPE varchar(189) COLUMN_KEY EXTRA PRIVILEGES # @@ -688,7 +688,7 @@ CREATED datetime NO 0000-00-00 00:00:00 LAST_ALTERED datetime NO 0000-00-00 00:00:00 SQL_MODE varchar(8192) NO ROUTINE_COMMENT longtext NO NULL -DEFINER varchar(77) NO +DEFINER varchar(189) NO CHARACTER_SET_CLIENT varchar(32) NO COLLATION_CONNECTION varchar(32) NO DATABASE_COLLATION varchar(32) NO diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index d209bbc3838..0e4cf6c6775 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -998,7 +998,7 @@ def information_schema TRIGGERS TRIGGERS ACTION_STATEMENT Statement 252 589815 1 def information_schema TRIGGERS TRIGGERS ACTION_TIMING Timing 253 18 6 N 1 0 33 def information_schema TRIGGERS TRIGGERS CREATED Created 12 19 0 Y 128 0 63 def information_schema TRIGGERS TRIGGERS SQL_MODE sql_mode 253 24576 0 N 1 0 33 -def information_schema TRIGGERS TRIGGERS DEFINER Definer 253 231 14 N 1 0 33 +def information_schema TRIGGERS TRIGGERS DEFINER Definer 253 567 14 N 1 0 33 def information_schema TRIGGERS TRIGGERS CHARACTER_SET_CLIENT character_set_client 253 96 6 N 1 0 33 def information_schema TRIGGERS TRIGGERS COLLATION_CONNECTION collation_connection 253 96 6 N 1 0 33 def information_schema TRIGGERS TRIGGERS DATABASE_COLLATION Database Collation 253 96 17 N 1 0 33 @@ -1042,7 +1042,7 @@ def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_NEW_TABLE ACTION_REFER def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_OLD_ROW 253 9 3 N 1 0 33 def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_NEW_ROW ACTION_REFERENCE_NEW_ROW 253 9 3 N 1 0 33 def information_schema TRIGGERS TRIGGERS SQL_MODE SQL_MODE 253 24576 0 N 1 0 33 -def information_schema TRIGGERS TRIGGERS DEFINER DEFINER 253 231 14 N 1 0 33 +def information_schema TRIGGERS TRIGGERS DEFINER DEFINER 253 567 14 N 1 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 def test t1_bi INSERT def test t1 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW root@localhost ---------------------------------------------------------------- @@ -1065,7 +1065,7 @@ def information_schema VIEWS VIEWS TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33 def information_schema VIEWS VIEWS VIEW_DEFINITION VIEW_DEFINITION 252 589815 15 N 17 0 33 def information_schema VIEWS VIEWS CHECK_OPTION CHECK_OPTION 253 24 4 N 1 0 33 def information_schema VIEWS VIEWS IS_UPDATABLE IS_UPDATABLE 253 9 2 N 1 0 33 -def information_schema VIEWS VIEWS DEFINER DEFINER 253 231 14 N 1 0 33 +def information_schema VIEWS VIEWS DEFINER DEFINER 253 567 14 N 1 0 33 def information_schema VIEWS VIEWS SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33 def information_schema VIEWS VIEWS CHARACTER_SET_CLIENT CHARACTER_SET_CLIENT 253 96 6 N 1 0 33 def information_schema VIEWS VIEWS COLLATION_CONNECTION COLLATION_CONNECTION 253 96 6 N 1 0 33 @@ -1123,7 +1123,7 @@ def information_schema ROUTINES ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33 def information_schema ROUTINES ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33 def information_schema ROUTINES ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33 def information_schema ROUTINES ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 252 589815 0 N 17 0 33 -def information_schema ROUTINES ROUTINES DEFINER DEFINER 253 231 14 N 1 0 33 +def information_schema ROUTINES ROUTINES DEFINER DEFINER 253 567 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 def test p1 PROCEDURE NULL SQL SELECT 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER root@localhost ---------------------------------------------------------------- @@ -1178,7 +1178,7 @@ def information_schema ROUTINES ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33 def information_schema ROUTINES ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33 def information_schema ROUTINES ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33 def information_schema ROUTINES ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 252 589815 0 N 17 0 33 -def information_schema ROUTINES ROUTINES DEFINER DEFINER 253 231 14 N 1 0 33 +def information_schema ROUTINES ROUTINES DEFINER DEFINER 253 567 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 def test f1 FUNCTION int(11) SQL RETURN 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER root@localhost ---------------------------------------------------------------- diff --git a/mysql-test/suite/funcs_1/r/is_columns_is.result b/mysql-test/suite/funcs_1/r/is_columns_is.result index 784eae541c6..15015ce4786 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_is.result +++ b/mysql-test/suite/funcs_1/r/is_columns_is.result @@ -75,7 +75,7 @@ def information_schema EVENTS CHARACTER_SET_CLIENT 22 NO varchar 32 96 NULL NUL def information_schema EVENTS COLLATION_CONNECTION 23 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select def information_schema EVENTS CREATED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select def information_schema EVENTS DATABASE_COLLATION 24 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select -def information_schema EVENTS DEFINER 4 NO varchar 77 231 NULL NULL NULL utf8 utf8_general_ci varchar(77) select +def information_schema EVENTS DEFINER 4 NO varchar 189 567 NULL NULL NULL utf8 utf8_general_ci varchar(189) select def information_schema EVENTS ENDS 14 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select def information_schema EVENTS EVENT_BODY 6 NO varchar 8 24 NULL NULL NULL utf8 utf8_general_ci varchar(8) select def information_schema EVENTS EVENT_CATALOG 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select @@ -252,7 +252,7 @@ def information_schema ROUTINES CREATED 24 0000-00-00 00:00:00 NO datetime NULL def information_schema ROUTINES DATABASE_COLLATION 31 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select def information_schema ROUTINES DATA_TYPE 6 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select def information_schema ROUTINES DATETIME_PRECISION 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select -def information_schema ROUTINES DEFINER 28 NO varchar 77 231 NULL NULL NULL utf8 utf8_general_ci varchar(77) select +def information_schema ROUTINES DEFINER 28 NO varchar 189 567 NULL NULL NULL utf8 utf8_general_ci varchar(189) select def information_schema ROUTINES DTD_IDENTIFIER 14 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select def information_schema ROUTINES EXTERNAL_LANGUAGE 18 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select def information_schema ROUTINES EXTERNAL_NAME 17 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select @@ -363,7 +363,7 @@ def information_schema TRIGGERS CHARACTER_SET_CLIENT 20 NO varchar 32 96 NULL N def information_schema TRIGGERS COLLATION_CONNECTION 21 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select def information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select def information_schema TRIGGERS DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select -def information_schema TRIGGERS DEFINER 19 NO varchar 77 231 NULL NULL NULL utf8 utf8_general_ci varchar(77) select +def information_schema TRIGGERS DEFINER 19 NO varchar 189 567 NULL NULL NULL utf8 utf8_general_ci varchar(189) select def information_schema TRIGGERS EVENT_MANIPULATION 4 NO varchar 6 18 NULL NULL NULL utf8 utf8_general_ci varchar(6) select def information_schema TRIGGERS EVENT_OBJECT_CATALOG 5 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select def information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select @@ -402,7 +402,7 @@ def information_schema USER_STATISTICS USER 1 NO varchar 128 384 NULL NULL NULL def information_schema VIEWS CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select def information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL NULL utf8 utf8_general_ci varchar(8) select def information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select -def information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL NULL utf8 utf8_general_ci varchar(77) select +def information_schema VIEWS DEFINER 7 NO varchar 189 567 NULL NULL NULL utf8 utf8_general_ci varchar(189) select def information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL NULL utf8 utf8_general_ci varchar(3) select def information_schema VIEWS SECURITY_TYPE 8 NO varchar 7 21 NULL NULL NULL utf8 utf8_general_ci varchar(7) select def information_schema VIEWS TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select @@ -542,7 +542,7 @@ NULL information_schema COLUMNS DATETIME_PRECISION bigint NULL NULL NULL NULL bi 3.0000 information_schema EVENTS EVENT_CATALOG varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 information_schema EVENTS EVENT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 information_schema EVENTS EVENT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) -3.0000 information_schema EVENTS DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77) +3.0000 information_schema EVENTS DEFINER varchar 189 567 utf8 utf8_general_ci varchar(189) 3.0000 information_schema EVENTS TIME_ZONE varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 information_schema EVENTS EVENT_BODY varchar 8 24 utf8 utf8_general_ci varchar(8) 1.0000 information_schema EVENTS EVENT_DEFINITION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext @@ -737,7 +737,7 @@ NULL information_schema ROUTINES CREATED datetime NULL NULL NULL NULL datetime NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datetime 3.0000 information_schema ROUTINES SQL_MODE varchar 8192 24576 utf8 utf8_general_ci varchar(8192) 1.0000 information_schema ROUTINES ROUTINE_COMMENT longtext 4294967295 4294967295 utf8 utf8_general_ci longtext -3.0000 information_schema ROUTINES DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77) +3.0000 information_schema ROUTINES DEFINER varchar 189 567 utf8 utf8_general_ci varchar(189) 3.0000 information_schema ROUTINES CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32) 3.0000 information_schema ROUTINES COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32) 3.0000 information_schema ROUTINES DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32) @@ -836,7 +836,7 @@ NULL information_schema TRIGGERS ACTION_ORDER bigint NULL NULL NULL NULL bigint( 3.0000 information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW varchar 3 9 utf8 utf8_general_ci varchar(3) NULL information_schema TRIGGERS CREATED datetime NULL NULL NULL NULL datetime 3.0000 information_schema TRIGGERS SQL_MODE varchar 8192 24576 utf8 utf8_general_ci varchar(8192) -3.0000 information_schema TRIGGERS DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77) +3.0000 information_schema TRIGGERS DEFINER varchar 189 567 utf8 utf8_general_ci varchar(189) 3.0000 information_schema TRIGGERS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32) 3.0000 information_schema TRIGGERS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32) 3.0000 information_schema TRIGGERS DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32) @@ -873,7 +873,7 @@ NULL information_schema USER_STATISTICS EMPTY_QUERIES bigint NULL NULL NULL NULL 1.0000 information_schema VIEWS VIEW_DEFINITION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext 3.0000 information_schema VIEWS CHECK_OPTION varchar 8 24 utf8 utf8_general_ci varchar(8) 3.0000 information_schema VIEWS IS_UPDATABLE varchar 3 9 utf8 utf8_general_ci varchar(3) -3.0000 information_schema VIEWS DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77) +3.0000 information_schema VIEWS DEFINER varchar 189 567 utf8 utf8_general_ci varchar(189) 3.0000 information_schema VIEWS SECURITY_TYPE varchar 7 21 utf8 utf8_general_ci varchar(7) 3.0000 information_schema VIEWS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32) 3.0000 information_schema VIEWS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32) diff --git a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result index 323e5fea518..f4ffdc6f4d8 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result @@ -76,7 +76,7 @@ def information_schema EVENTS CHARACTER_SET_CLIENT 22 NO varchar 32 96 NULL NUL def information_schema EVENTS COLLATION_CONNECTION 23 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) def information_schema EVENTS CREATED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL 0 NULL NULL datetime def information_schema EVENTS DATABASE_COLLATION 24 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) -def information_schema EVENTS DEFINER 4 NO varchar 77 231 NULL NULL NULL utf8 utf8_general_ci varchar(77) +def information_schema EVENTS DEFINER 4 NO varchar 189 567 NULL NULL NULL utf8 utf8_general_ci varchar(189) def information_schema EVENTS ENDS 14 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime def information_schema EVENTS EVENT_BODY 6 NO varchar 8 24 NULL NULL NULL utf8 utf8_general_ci varchar(8) def information_schema EVENTS EVENT_CATALOG 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) @@ -253,7 +253,7 @@ def information_schema ROUTINES CREATED 24 0000-00-00 00:00:00 NO datetime NULL def information_schema ROUTINES DATABASE_COLLATION 31 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) def information_schema ROUTINES DATA_TYPE 6 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) def information_schema ROUTINES DATETIME_PRECISION 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned -def information_schema ROUTINES DEFINER 28 NO varchar 77 231 NULL NULL NULL utf8 utf8_general_ci varchar(77) +def information_schema ROUTINES DEFINER 28 NO varchar 189 567 NULL NULL NULL utf8 utf8_general_ci varchar(189) def information_schema ROUTINES DTD_IDENTIFIER 14 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext def information_schema ROUTINES EXTERNAL_LANGUAGE 18 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) def information_schema ROUTINES EXTERNAL_NAME 17 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) @@ -364,7 +364,7 @@ def information_schema TRIGGERS CHARACTER_SET_CLIENT 20 NO varchar 32 96 NULL N def information_schema TRIGGERS COLLATION_CONNECTION 21 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) def information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime def information_schema TRIGGERS DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) -def information_schema TRIGGERS DEFINER 19 NO varchar 77 231 NULL NULL NULL utf8 utf8_general_ci varchar(77) +def information_schema TRIGGERS DEFINER 19 NO varchar 189 567 NULL NULL NULL utf8 utf8_general_ci varchar(189) def information_schema TRIGGERS EVENT_MANIPULATION 4 NO varchar 6 18 NULL NULL NULL utf8 utf8_general_ci varchar(6) def information_schema TRIGGERS EVENT_OBJECT_CATALOG 5 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) def information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) @@ -403,7 +403,7 @@ def information_schema USER_STATISTICS USER 1 NO varchar 128 384 NULL NULL NULL def information_schema VIEWS CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) def information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL NULL utf8 utf8_general_ci varchar(8) def information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) -def information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL NULL utf8 utf8_general_ci varchar(77) +def information_schema VIEWS DEFINER 7 NO varchar 189 567 NULL NULL NULL utf8 utf8_general_ci varchar(189) def information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL NULL utf8 utf8_general_ci varchar(3) def information_schema VIEWS SECURITY_TYPE 8 NO varchar 7 21 NULL NULL NULL utf8 utf8_general_ci varchar(7) def information_schema VIEWS TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) @@ -547,7 +547,7 @@ NULL information_schema COLUMNS DATETIME_PRECISION bigint NULL NULL NULL NULL bi 3.0000 information_schema EVENTS EVENT_CATALOG varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 information_schema EVENTS EVENT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 information_schema EVENTS EVENT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) -3.0000 information_schema EVENTS DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77) +3.0000 information_schema EVENTS DEFINER varchar 189 567 utf8 utf8_general_ci varchar(189) 3.0000 information_schema EVENTS TIME_ZONE varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 information_schema EVENTS EVENT_BODY varchar 8 24 utf8 utf8_general_ci varchar(8) 1.0000 information_schema EVENTS EVENT_DEFINITION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext @@ -742,7 +742,7 @@ NULL information_schema ROUTINES CREATED datetime NULL NULL NULL NULL datetime NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datetime 3.0000 information_schema ROUTINES SQL_MODE varchar 8192 24576 utf8 utf8_general_ci varchar(8192) 1.0000 information_schema ROUTINES ROUTINE_COMMENT longtext 4294967295 4294967295 utf8 utf8_general_ci longtext -3.0000 information_schema ROUTINES DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77) +3.0000 information_schema ROUTINES DEFINER varchar 189 567 utf8 utf8_general_ci varchar(189) 3.0000 information_schema ROUTINES CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32) 3.0000 information_schema ROUTINES COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32) 3.0000 information_schema ROUTINES DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32) @@ -841,7 +841,7 @@ NULL information_schema TRIGGERS ACTION_ORDER bigint NULL NULL NULL NULL bigint( 3.0000 information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW varchar 3 9 utf8 utf8_general_ci varchar(3) NULL information_schema TRIGGERS CREATED datetime NULL NULL NULL NULL datetime 3.0000 information_schema TRIGGERS SQL_MODE varchar 8192 24576 utf8 utf8_general_ci varchar(8192) -3.0000 information_schema TRIGGERS DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77) +3.0000 information_schema TRIGGERS DEFINER varchar 189 567 utf8 utf8_general_ci varchar(189) 3.0000 information_schema TRIGGERS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32) 3.0000 information_schema TRIGGERS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32) 3.0000 information_schema TRIGGERS DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32) @@ -878,7 +878,7 @@ NULL information_schema USER_STATISTICS EMPTY_QUERIES bigint NULL NULL NULL NULL 1.0000 information_schema VIEWS VIEW_DEFINITION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext 3.0000 information_schema VIEWS CHECK_OPTION varchar 8 24 utf8 utf8_general_ci varchar(8) 3.0000 information_schema VIEWS IS_UPDATABLE varchar 3 9 utf8 utf8_general_ci varchar(3) -3.0000 information_schema VIEWS DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77) +3.0000 information_schema VIEWS DEFINER varchar 189 567 utf8 utf8_general_ci varchar(189) 3.0000 information_schema VIEWS SECURITY_TYPE varchar 7 21 utf8 utf8_general_ci varchar(7) 3.0000 information_schema VIEWS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32) 3.0000 information_schema VIEWS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32) diff --git a/mysql-test/suite/funcs_1/r/is_events.result b/mysql-test/suite/funcs_1/r/is_events.result index 7115b57fe47..79f60821347 100644 --- a/mysql-test/suite/funcs_1/r/is_events.result +++ b/mysql-test/suite/funcs_1/r/is_events.result @@ -31,7 +31,7 @@ Field Type Null Key Default Extra EVENT_CATALOG varchar(64) NO EVENT_SCHEMA varchar(64) NO EVENT_NAME varchar(64) NO -DEFINER varchar(77) NO +DEFINER varchar(189) NO TIME_ZONE varchar(64) NO EVENT_BODY varchar(8) NO EVENT_DEFINITION longtext NO NULL @@ -58,7 +58,7 @@ EVENTS CREATE TEMPORARY TABLE `EVENTS` ( `EVENT_CATALOG` varchar(64) NOT NULL DEFAULT '', `EVENT_SCHEMA` varchar(64) NOT NULL DEFAULT '', `EVENT_NAME` varchar(64) NOT NULL DEFAULT '', - `DEFINER` varchar(77) NOT NULL DEFAULT '', + `DEFINER` varchar(189) NOT NULL DEFAULT '', `TIME_ZONE` varchar(64) NOT NULL DEFAULT '', `EVENT_BODY` varchar(8) NOT NULL DEFAULT '', `EVENT_DEFINITION` longtext NOT NULL, @@ -85,7 +85,7 @@ Field Type Null Key Default Extra EVENT_CATALOG varchar(64) NO EVENT_SCHEMA varchar(64) NO EVENT_NAME varchar(64) NO -DEFINER varchar(77) NO +DEFINER varchar(189) NO TIME_ZONE varchar(64) NO EVENT_BODY varchar(8) NO EVENT_DEFINITION longtext NO NULL diff --git a/mysql-test/suite/funcs_1/r/is_routines.result b/mysql-test/suite/funcs_1/r/is_routines.result index a1aa40a59c3..a062e2d7b8f 100644 --- a/mysql-test/suite/funcs_1/r/is_routines.result +++ b/mysql-test/suite/funcs_1/r/is_routines.result @@ -55,7 +55,7 @@ CREATED datetime NO 0000-00-00 00:00:00 LAST_ALTERED datetime NO 0000-00-00 00:00:00 SQL_MODE varchar(8192) NO ROUTINE_COMMENT longtext NO NULL -DEFINER varchar(77) NO +DEFINER varchar(189) NO CHARACTER_SET_CLIENT varchar(32) NO COLLATION_CONNECTION varchar(32) NO DATABASE_COLLATION varchar(32) NO @@ -89,7 +89,7 @@ ROUTINES CREATE TEMPORARY TABLE `ROUTINES` ( `LAST_ALTERED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `SQL_MODE` varchar(8192) NOT NULL DEFAULT '', `ROUTINE_COMMENT` longtext NOT NULL, - `DEFINER` varchar(77) NOT NULL DEFAULT '', + `DEFINER` varchar(189) NOT NULL DEFAULT '', `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '', `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '', `DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT '' @@ -123,7 +123,7 @@ CREATED datetime NO 0000-00-00 00:00:00 LAST_ALTERED datetime NO 0000-00-00 00:00:00 SQL_MODE varchar(8192) NO ROUTINE_COMMENT longtext NO NULL -DEFINER varchar(77) NO +DEFINER varchar(189) NO CHARACTER_SET_CLIENT varchar(32) NO COLLATION_CONNECTION varchar(32) NO DATABASE_COLLATION varchar(32) NO diff --git a/mysql-test/suite/funcs_1/r/is_triggers.result b/mysql-test/suite/funcs_1/r/is_triggers.result index 8f07bca408a..53bb54aa0f2 100644 --- a/mysql-test/suite/funcs_1/r/is_triggers.result +++ b/mysql-test/suite/funcs_1/r/is_triggers.result @@ -46,7 +46,7 @@ ACTION_REFERENCE_OLD_ROW varchar(3) NO ACTION_REFERENCE_NEW_ROW varchar(3) NO CREATED datetime YES NULL SQL_MODE varchar(8192) NO -DEFINER varchar(77) NO +DEFINER varchar(189) NO CHARACTER_SET_CLIENT varchar(32) NO COLLATION_CONNECTION varchar(32) NO DATABASE_COLLATION varchar(32) NO @@ -71,7 +71,7 @@ TRIGGERS CREATE TEMPORARY TABLE `TRIGGERS` ( `ACTION_REFERENCE_NEW_ROW` varchar(3) NOT NULL DEFAULT '', `CREATED` datetime DEFAULT NULL, `SQL_MODE` varchar(8192) NOT NULL DEFAULT '', - `DEFINER` varchar(77) NOT NULL DEFAULT '', + `DEFINER` varchar(189) NOT NULL DEFAULT '', `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '', `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '', `DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT '' @@ -96,7 +96,7 @@ ACTION_REFERENCE_OLD_ROW varchar(3) NO ACTION_REFERENCE_NEW_ROW varchar(3) NO CREATED datetime YES NULL SQL_MODE varchar(8192) NO -DEFINER varchar(77) NO +DEFINER varchar(189) NO CHARACTER_SET_CLIENT varchar(32) NO COLLATION_CONNECTION varchar(32) NO DATABASE_COLLATION varchar(32) NO diff --git a/mysql-test/suite/funcs_1/r/is_views.result b/mysql-test/suite/funcs_1/r/is_views.result index 73d46b4d627..ebb0e1ac091 100644 --- a/mysql-test/suite/funcs_1/r/is_views.result +++ b/mysql-test/suite/funcs_1/r/is_views.result @@ -34,7 +34,7 @@ TABLE_NAME varchar(64) NO VIEW_DEFINITION longtext NO NULL CHECK_OPTION varchar(8) NO IS_UPDATABLE varchar(3) NO -DEFINER varchar(77) NO +DEFINER varchar(189) NO SECURITY_TYPE varchar(7) NO CHARACTER_SET_CLIENT varchar(32) NO COLLATION_CONNECTION varchar(32) NO @@ -47,7 +47,7 @@ VIEWS CREATE TEMPORARY TABLE `VIEWS` ( `VIEW_DEFINITION` longtext NOT NULL, `CHECK_OPTION` varchar(8) NOT NULL DEFAULT '', `IS_UPDATABLE` varchar(3) NOT NULL DEFAULT '', - `DEFINER` varchar(77) NOT NULL DEFAULT '', + `DEFINER` varchar(189) NOT NULL DEFAULT '', `SECURITY_TYPE` varchar(7) NOT NULL DEFAULT '', `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '', `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '' @@ -60,7 +60,7 @@ TABLE_NAME varchar(64) NO VIEW_DEFINITION longtext NO NULL CHECK_OPTION varchar(8) NO IS_UPDATABLE varchar(3) NO -DEFINER varchar(77) NO +DEFINER varchar(189) NO SECURITY_TYPE varchar(7) NO CHARACTER_SET_CLIENT varchar(32) NO COLLATION_CONNECTION varchar(32) NO diff --git a/mysql-test/t/grant_4332.test b/mysql-test/t/grant_4332.test index 991223221c5..302624e3873 100644 --- a/mysql-test/t/grant_4332.test +++ b/mysql-test/t/grant_4332.test @@ -68,10 +68,22 @@ create procedure test.p1() select user(), current_user(), user from mysql.tables show create procedure test.p1; +select definer from information_schema.routines; + create table test.t1 (a text); create event e1 on schedule every 1 second do insert test.t1 values (concat(user(), ' ', current_user())); +select definer from information_schema.events; + +create view v1 as select * from t1; +select definer from information_schema.views; +drop view v1; + +create trigger tr1 before delete on t1 for each row set @a:=1; +select definer from information_schema.triggers; +drop trigger tr1; + connection default; --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 3786fb7c22f..b120479c998 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -5374,7 +5374,7 @@ bool store_schema_params(THD *thd, TABLE *table, TABLE *proc_table, CHARSET_INFO *cs= system_charset_info; char params_buff[MAX_FIELD_WIDTH], returns_buff[MAX_FIELD_WIDTH], sp_db_buff[NAME_LEN], sp_name_buff[NAME_LEN], path[FN_REFLEN], - definer_buff[USERNAME_LENGTH + HOSTNAME_LENGTH + 1]; + definer_buff[DEFINER_LENGTH + 1]; String params(params_buff, sizeof(params_buff), cs); String returns(returns_buff, sizeof(returns_buff), cs); String sp_db(sp_db_buff, sizeof(sp_db_buff), cs); @@ -5518,7 +5518,7 @@ bool store_schema_proc(THD *thd, TABLE *table, TABLE *proc_table, LEX *lex= thd->lex; CHARSET_INFO *cs= system_charset_info; char sp_db_buff[SAFE_NAME_LEN + 1], sp_name_buff[NAME_LEN + 1], - definer_buff[USERNAME_LENGTH + HOSTNAME_LENGTH + 2], + definer_buff[DEFINER_LENGTH + 1], returns_buff[MAX_FIELD_WIDTH]; String sp_db(sp_db_buff, sizeof(sp_db_buff), cs); @@ -8081,7 +8081,7 @@ ST_FIELD_INFO events_fields_info[]= SKIP_OPEN_TABLE}, {"EVENT_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Name", SKIP_OPEN_TABLE}, - {"DEFINER", 77, MYSQL_TYPE_STRING, 0, 0, "Definer", SKIP_OPEN_TABLE}, + {"DEFINER", DEFINER_CHAR_LENGTH, MYSQL_TYPE_STRING, 0, 0, "Definer", SKIP_OPEN_TABLE}, {"TIME_ZONE", 64, MYSQL_TYPE_STRING, 0, 0, "Time zone", SKIP_OPEN_TABLE}, {"EVENT_BODY", 8, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}, {"EVENT_DEFINITION", 65535, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}, @@ -8158,7 +8158,7 @@ ST_FIELD_INFO proc_fields_info[]= {"SQL_MODE", 32*256, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}, {"ROUTINE_COMMENT", 65535, MYSQL_TYPE_STRING, 0, 0, "Comment", SKIP_OPEN_TABLE}, - {"DEFINER", 77, MYSQL_TYPE_STRING, 0, 0, "Definer", SKIP_OPEN_TABLE}, + {"DEFINER", DEFINER_CHAR_LENGTH, MYSQL_TYPE_STRING, 0, 0, "Definer", SKIP_OPEN_TABLE}, {"CHARACTER_SET_CLIENT", MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0, 0, "character_set_client", SKIP_OPEN_TABLE}, {"COLLATION_CONNECTION", MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0, 0, @@ -8203,7 +8203,7 @@ ST_FIELD_INFO view_fields_info[]= {"VIEW_DEFINITION", 65535, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY}, {"CHECK_OPTION", 8, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY}, {"IS_UPDATABLE", 3, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE}, - {"DEFINER", 77, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY}, + {"DEFINER", DEFINER_CHAR_LENGTH, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY}, {"SECURITY_TYPE", 7, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY}, {"CHARACTER_SET_CLIENT", MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY}, @@ -8348,7 +8348,7 @@ ST_FIELD_INFO triggers_fields_info[]= {"ACTION_REFERENCE_NEW_ROW", 3, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY}, {"CREATED", 0, MYSQL_TYPE_DATETIME, 0, 1, "Created", OPEN_FRM_ONLY}, {"SQL_MODE", 32*256, MYSQL_TYPE_STRING, 0, 0, "sql_mode", OPEN_FRM_ONLY}, - {"DEFINER", 77, MYSQL_TYPE_STRING, 0, 0, "Definer", OPEN_FRM_ONLY}, + {"DEFINER", DEFINER_CHAR_LENGTH, MYSQL_TYPE_STRING, 0, 0, "Definer", OPEN_FRM_ONLY}, {"CHARACTER_SET_CLIENT", MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0, 0, "character_set_client", OPEN_FRM_ONLY}, {"COLLATION_CONNECTION", MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0, 0, |