summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorunknown <gluh@mysql.com>2005-05-07 15:14:34 +0000
committerunknown <gluh@mysql.com>2005-05-07 15:14:34 +0000
commit6cc34bf22209c13fc7d63f841c49d4a5891d2052 (patch)
treeff00a7ca2fa3415860aabd01ae335e283374f910 /sql/sql_show.cc
parentbd58e3e59cfa4dd03feb515b38858ba05820284c (diff)
downloadmariadb-git-6cc34bf22209c13fc7d63f841c49d4a5891d2052.tar.gz
Fix for bug#10261: INFORMATION_SCHEMA.COLUMNS, incomplete result for non root user
I_S table columns information is available for any user mysql-test/r/information_schema.result: Fix for bug#10261: INFORMATION_SCHEMA.COLUMNS, incomplete result for non root user mysql-test/t/information_schema.test: Fix for bug#10261: INFORMATION_SCHEMA.COLUMNS, incomplete result for non root user sql/sql_show.cc: Fix for bug#10261: INFORMATION_SCHEMA.COLUMNS, incomplete result for non root user
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index ceb98740298..a90756e38db 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -2306,7 +2306,8 @@ static int get_schema_column_record(THD *thd, struct st_table_list *tables,
col_access= get_column_grant(thd, &tables->grant,
base_name, file_name,
field->field_name) & COL_ACLS;
- if (lex->orig_sql_command != SQLCOM_SHOW_FIELDS && !col_access)
+ if (lex->orig_sql_command != SQLCOM_SHOW_FIELDS &&
+ !tables->schema_table && !col_access)
continue;
for (uint bitnr=0; col_access ; col_access>>=1,bitnr++)
{
@@ -2319,7 +2320,12 @@ static int get_schema_column_record(THD *thd, struct st_table_list *tables,
#else
*end= 0;
#endif
- table->field[17]->store(tmp+1,end == tmp ? 0 : (uint) (end-tmp-1), cs);
+ if (tables->schema_table) // any user has 'select' privilege on all
+ // I_S table columns
+ table->field[17]->store(grant_types.type_names[0],
+ strlen(grant_types.type_names[0]), cs);
+ else
+ table->field[17]->store(tmp+1,end == tmp ? 0 : (uint) (end-tmp-1), cs);
table->field[1]->store(base_name, strlen(base_name), cs);
table->field[2]->store(file_name, strlen(file_name), cs);