MCPcopy Create free account
hub / github.com/MariaDB/server / modify_grant_table

Function modify_grant_table

sql/sql_acl.cc:10345–10374  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10343*/
10344
10345static int modify_grant_table(TABLE *table, Field *host_field,
10346 Field *user_field, LEX_USER *user_to)
10347{
10348 int error;
10349 DBUG_ENTER("modify_grant_table");
10350
10351 if (user_to)
10352 {
10353 /* rename */
10354 store_record(table, record[1]);
10355 host_field->store(user_to->host.str, user_to->host.length,
10356 system_charset_info);
10357 user_field->store(user_to->user.str, user_to->user.length,
10358 system_charset_info);
10359 if (unlikely(error= table->file->ha_update_row(table->record[1],
10360 table->record[0])) &&
10361 error != HA_ERR_RECORD_IS_THE_SAME)
10362 table->file->print_error(error, MYF(0));
10363 else
10364 error= 0;
10365 }
10366 else
10367 {
10368 /* delete */
10369 if (unlikely((error=table->file->ha_delete_row(table->record[0]))))
10370 table->file->print_error(error, MYF(0));
10371 }
10372
10373 DBUG_RETURN(error);
10374}
10375
10376/*
10377 Handle the roles_mapping privilege table

Callers 2

handle_grant_tableFunction · 0.85

Calls 4

ha_update_rowMethod · 0.80
ha_delete_rowMethod · 0.80
storeMethod · 0.45
print_errorMethod · 0.45

Tested by

no test coverage detected