| 10343 | */ |
| 10344 | |
| 10345 | static 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 |
no test coverage detected