diff options
author | unknown <gluh@mysql.com> | 2006-05-25 19:20:34 +0500 |
---|---|---|
committer | unknown <gluh@mysql.com> | 2006-05-25 19:20:34 +0500 |
commit | 644efa51db79c53a017fe5d99a8d271147537740 (patch) | |
tree | 777606563931381e6e7f0e7ce6aec9a5a7200727 /sql | |
parent | 52078846fc635b913c2090c20adc18e1f06c9e56 (diff) | |
parent | fc2e96ee7b5bf2c0370310c12ec260705dfe0318 (diff) | |
download | mariadb-git-644efa51db79c53a017fe5d99a8d271147537740.tar.gz |
after merge fix
mysql-test/r/strict.result:
Auto merged
mysql-test/r/type_ranges.result:
Auto merged
mysql-test/t/strict.test:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_show.cc:
Auto merged
mysql-test/r/information_schema.result:
manual merge
mysql-test/t/information_schema.test:
manual merge
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_select.cc | 1 | ||||
-rw-r--r-- | sql/sql_show.cc | 28 |
2 files changed, 26 insertions, 3 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 965afbe5b3c..2212371db92 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -8034,6 +8034,7 @@ Field *create_tmp_field_from_field(THD *thd, Field *org_field, item->result_field= new_field; else new_field->field_name= name; + new_field->flags|= (org_field->flags & NO_DEFAULT_VALUE_FLAG); if (org_field->maybe_null() || (item && item->maybe_null)) new_field->flags&= ~NOT_NULL_FLAG; // Because of outer join if (org_field->type() == MYSQL_TYPE_VAR_STRING || diff --git a/sql/sql_show.cc b/sql/sql_show.cc index b6cc5c19594..ac1825d7c84 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -3427,11 +3427,33 @@ static int get_schema_views_record(THD *thd, struct st_table_list *tables, if (tables->view) { + Security_context *sctx= thd->security_ctx; + ulong grant= SHOW_VIEW_ACL; +#ifndef NO_EMBEDDED_ACCESS_CHECKS + char *save_table_name= tables->table_name; + if (!my_strcasecmp(system_charset_info, tables->definer.user.str, + sctx->priv_user) && + !my_strcasecmp(system_charset_info, tables->definer.host.str, + sctx->priv_host)) + grant= SHOW_VIEW_ACL; + else + { + tables->table_name= tables->view_name.str; + if (check_access(thd, SHOW_VIEW_ACL , base_name, + &tables->grant.privilege, 0, 1, + test(tables->schema_table))) + grant= get_table_grant(thd, tables); + else + grant= tables->grant.privilege; + } + tables->table_name= save_table_name; +#endif + restore_record(table, s->default_values); table->field[1]->store(tables->view_db.str, tables->view_db.length, cs); - table->field[2]->store(tables->view_name.str, tables->view_name.length, - cs); - table->field[3]->store(tables->query.str, tables->query.length, cs); + table->field[2]->store(tables->view_name.str, tables->view_name.length, cs); + if (grant & SHOW_VIEW_ACL) + table->field[3]->store(tables->query.str, tables->query.length, cs); if (tables->with_check != VIEW_CHECK_NONE) { |