1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

bugfix: missing restore_record when modifying roles_mapping() table.

(and an assert in myisam to catch these bugs easier in the future)
update tests/results
This commit is contained in:
Sergei Golubchik
2013-10-18 12:27:07 -07:00
parent e5211e0cde
commit f1a71b6815
16 changed files with 83 additions and 16 deletions

View File

@ -3798,6 +3798,7 @@ replace_roles_mapping_table(TABLE *table, ROLE_GRANT_PAIR *pair,
uchar row_key[MAX_KEY_LENGTH];
int error;
table->use_all_columns();
restore_record(table, s->default_values);
table->field[0]->store(pair->u_hname, strlen(pair->u_hname),
system_charset_info);
table->field[1]->store(pair->u_uname, strlen(pair->u_uname),
@ -3805,6 +3806,8 @@ replace_roles_mapping_table(TABLE *table, ROLE_GRANT_PAIR *pair,
table->field[2]->store(pair->r_uname, strlen(pair->r_uname),
system_charset_info);
DBUG_ASSERT(!revoke_grant || existing);
if (existing) // delete or update
{
key_copy(row_key, table->record[0], table->key_info,
@ -7874,11 +7877,13 @@ int open_grant_tables(THD *thd, TABLE_LIST *tables)
account in tests.
*/
tables[0].updating= tables[1].updating= tables[2].updating=
tables[3].updating= tables[4].updating= tables[5].updating= 1;
tables[3].updating= tables[4].updating= tables[5].updating=
tables[6].updating= 1;
if (!(thd->spcont || rpl_filter->tables_ok(0, tables)))
DBUG_RETURN(1);
tables[0].updating= tables[1].updating= tables[2].updating=
tables[3].updating= tables[4].updating= tables[5].updating= 0;
tables[3].updating= tables[4].updating= tables[5].updating=
tables[6].updating= 0;
}
#endif