1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-31 22:22:30 +03:00

fixed bugs in view code with prepared statemnts

sql/sql_acl.cc:
  block checking view underlying tables
sql/sql_base.cc:
  item registration fixed
  fixed non registred item resolving
  fixed result of outo-merge
  fixed creation reference if alias used
sql/sql_insert.cc:
  layout fixed
  removed unused variable
sql/sql_parse.cc:
  block checking view underlying tables
sql/sql_prepare.cc:
  make preparation check same as usual check
sql/sql_update.cc:
  made want_privilege assignment simplier
  block checking view underlying tables
sql/sql_view.cc:
  belong_to_view assignmebt moved after privileges check
sql/table.cc:
  check option fix field added
  arena management added
This commit is contained in:
unknown
2005-01-04 18:04:16 +02:00
parent 592ffbcd68
commit 34f313eeaf
8 changed files with 116 additions and 48 deletions

View File

@@ -170,10 +170,8 @@ int mysql_update(THD *thd,
table->quick_keys.clear_all();
#ifndef NO_EMBEDDED_ACCESS_CHECKS
/* In case of view TABLE_LIST contain right privilages request */
want_privilege= (table_list->view ?
table_list->grant.want_privilege :
table->grant.want_privilege);
/* TABLE_LIST contain right privilages request */
want_privilege= table_list->grant.want_privilege;
#endif
if (mysql_prepare_update(thd, table_list, &conds, order_num, order))
DBUG_RETURN(1);
@@ -221,7 +219,7 @@ int mysql_update(THD *thd,
#ifndef NO_EMBEDDED_ACCESS_CHECKS
/* Check values */
table_list->grant.want_privilege= table->grant.want_privilege=
(SELECT_ACL & ~table->grant.privilege);
(SELECT_ACL & ~~table->grant.privilege);
#endif
if (setup_fields(thd, 0, table_list, values, 1, 0, 0))
{
@@ -715,7 +713,7 @@ bool mysql_multi_update_prepare(THD *thd)
}
/* Check access privileges for table */
if (!tl->derived)
if (!tl->derived && !tl->belong_to_view)
{
uint want_privilege= tl->updating ? UPDATE_ACL : SELECT_ACL;
if (!using_lock_tables)