summaryrefslogtreecommitdiff
path: root/sql/sql_update.cc
diff options
context:
space:
mode:
authorhf@deer.(none) <>2003-09-26 15:33:13 +0500
committerhf@deer.(none) <>2003-09-26 15:33:13 +0500
commitba8fa76fa20f400d8adfe2aa14231a682df9ba79 (patch)
treef4b60e9394c6d88f0bd04731d87ae6203e987e3b /sql/sql_update.cc
parent7dd4cb58d64e55a72283e33deeadf8fa2ed38e56 (diff)
downloadmariadb-git-ba8fa76fa20f400d8adfe2aa14231a682df9ba79.tar.gz
SCRUM:
WL#604 Privileges in embedded library code added to check privileges in embedded library NO_EMBEDDED_ACCESS_CHECKS macros inserted in code so we can exclude access-checking parts. Actually we now can exclude these parts from standalone server as well. Do we need it? Access checks are disabled in embedded server by default. One should edit libmysqld/Makefile manually to get this working. We definitely need the separate configure for embedded server
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r--sql/sql_update.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 7430029a5e5..946107049dc 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -86,8 +86,10 @@ int mysql_update(THD *thd,
/* Calculate "table->used_keys" based on the WHERE */
table->used_keys=table->keys_in_use;
table->quick_keys=0;
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
want_privilege=table->grant.want_privilege;
table->grant.want_privilege=(SELECT_ACL & ~table->grant.privilege);
+#endif
bzero((char*) &tables,sizeof(tables)); // For ORDER BY
tables.table= table;
@@ -122,7 +124,9 @@ int mysql_update(THD *thd,
}
/* Check the fields we are going to modify */
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
table->grant.want_privilege=want_privilege;
+#endif
if (setup_fields(thd, 0, update_table_list, fields, 1, 0, 0))
DBUG_RETURN(-1); /* purecov: inspected */
if (table->timestamp_field)
@@ -134,8 +138,10 @@ int mysql_update(THD *thd,
table->timestamp_field->query_id=timestamp_query_id;
}
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
/* Check values */
table->grant.want_privilege=(SELECT_ACL & ~table->grant.privilege);
+#endif
if (setup_fields(thd, 0, update_table_list, values, 0, 0, 0))
{
free_underlaid_joins(thd, &thd->lex.select_lex);
@@ -418,7 +424,9 @@ int mysql_multi_update(THD *thd,
TABLE_LIST *tl;
DBUG_ENTER("mysql_multi_update");
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
table_list->grant.want_privilege=(SELECT_ACL & ~table_list->grant.privilege);
+#endif
if ((res=open_and_lock_tables(thd,table_list)))
DBUG_RETURN(res);
fix_tables_pointers(thd->lex.all_selects_list);