diff options
author | tomas@poseidon.ndb.mysql.com <> | 2004-11-17 08:10:26 +0000 |
---|---|---|
committer | tomas@poseidon.ndb.mysql.com <> | 2004-11-17 08:10:26 +0000 |
commit | 0acc6f83b2d0fae4bf3306e73c1de607f05feadd (patch) | |
tree | 253d0b6c06dec1f599f190f5719a71dbea73ff2c /sql/sql_acl.cc | |
parent | 8ee2a1836e8c94d21891b589375515bf11b708b7 (diff) | |
download | mariadb-git-0acc6f83b2d0fae4bf3306e73c1de607f05feadd.tar.gz |
enabled having system tables in ndb
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r-- | sql/sql_acl.cc | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 98af43e17a7..d6f52fed1d2 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1384,8 +1384,10 @@ static bool update_user_table(THD *thd, const char *host, const char *user, table->field[0]->store(host,(uint) strlen(host), &my_charset_latin1); table->field[1]->store(user,(uint) strlen(user), &my_charset_latin1); + table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); if (table->file->index_read_idx(table->record[0],0, - (byte*) table->field[0]->ptr,0, + (byte*) table->field[0]->ptr, + table->key_info[0].key_length, HA_READ_KEY_EXACT)) { my_error(ER_PASSWORD_NO_MATCH,MYF(0)); /* purecov: deadcode */ @@ -1463,9 +1465,11 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, table->field[0]->store(combo.host.str,combo.host.length, &my_charset_latin1); table->field[1]->store(combo.user.str,combo.user.length, &my_charset_latin1); + table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); if (table->file->index_read_idx(table->record[0], 0, - (byte*) table->field[0]->ptr,0, - HA_READ_KEY_EXACT)) + (byte*) table->field[0]->ptr, + table->key_info[0].key_length, + HA_READ_KEY_EXACT)) { if (!create_user) { @@ -1568,6 +1572,7 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, We should NEVER delete from the user table, as a uses can still use mysqld even if he doesn't have any privileges in the user table! */ + table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); if (cmp_record(table,record[1]) && (error=table->file->update_row(table->record[1],table->record[0]))) { // This should never happen @@ -1645,8 +1650,11 @@ static int replace_db_table(TABLE *table, const char *db, table->field[0]->store(combo.host.str,combo.host.length, &my_charset_latin1); table->field[1]->store(db,(uint) strlen(db), &my_charset_latin1); table->field[2]->store(combo.user.str,combo.user.length, &my_charset_latin1); - if (table->file->index_read_idx(table->record[0],0,(byte*) table->field[0]->ptr,0, - HA_READ_KEY_EXACT)) + table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); + if (table->file->index_read_idx(table->record[0],0, + (byte*) table->field[0]->ptr, + table->key_info[0].key_length, + HA_READ_KEY_EXACT)) { if (what == 'N') { // no row, no revoke @@ -1679,6 +1687,7 @@ static int replace_db_table(TABLE *table, const char *db, /* update old existing row */ if (rights) { + table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); if ((error=table->file->update_row(table->record[1],table->record[0]))) goto table_error; /* purecov: deadcode */ } @@ -1953,8 +1962,10 @@ static int replace_column_table(GRANT_TABLE *g_t, table->field[4]->store(xx->column.ptr(),xx->column.length(), &my_charset_latin1); + table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); if (table->file->index_read(table->record[0],(byte*) table->field[0]->ptr, - 0, HA_READ_KEY_EXACT)) + table->key_info[0].key_length, + HA_READ_KEY_EXACT)) { if (revoke_grant) { @@ -2022,8 +2033,10 @@ static int replace_column_table(GRANT_TABLE *g_t, if (revoke_grant) { + table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); if (table->file->index_read(table->record[0], (byte*) table->field[0]->ptr, - key_length, HA_READ_KEY_EXACT)) + table->key_info[0].key_length, + HA_READ_KEY_EXACT)) goto end; /* Scan through all rows with the same host,db,user and table */ @@ -2112,9 +2125,10 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table, table->field[2]->store(combo.user.str,combo.user.length, &my_charset_latin1); table->field[3]->store(table_name,(uint) strlen(table_name), &my_charset_latin1); store_record(table,record[1]); // store at pos 1 - + table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); if (table->file->index_read_idx(table->record[0],0, - (byte*) table->field[0]->ptr,0, + (byte*) table->field[0]->ptr, + table->key_info[0].key_length, HA_READ_KEY_EXACT)) { /* @@ -3571,9 +3585,12 @@ int mysql_drop_user(THD *thd, List <LEX_USER> &list) tables[0].table->field[1]->store(user_name->user.str,(uint) user_name->user.length, system_charset_info); + tables[0].table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); if (!tables[0].table->file->index_read_idx(tables[0].table->record[0],0, (byte*) tables[0].table-> - field[0]->ptr,0, + field[0]->ptr, + tables[0].table-> + key_info[0].key_length, HA_READ_KEY_EXACT)) { int error; |