mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
enabled having system tables in ndb
This commit is contained in:
@ -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[0]->store(host,(uint) strlen(host), &my_charset_latin1);
|
||||||
table->field[1]->store(user,(uint) strlen(user), &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,
|
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))
|
HA_READ_KEY_EXACT))
|
||||||
{
|
{
|
||||||
my_error(ER_PASSWORD_NO_MATCH,MYF(0)); /* purecov: deadcode */
|
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[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->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,
|
if (table->file->index_read_idx(table->record[0], 0,
|
||||||
(byte*) table->field[0]->ptr,0,
|
(byte*) table->field[0]->ptr,
|
||||||
HA_READ_KEY_EXACT))
|
table->key_info[0].key_length,
|
||||||
|
HA_READ_KEY_EXACT))
|
||||||
{
|
{
|
||||||
if (!create_user)
|
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
|
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!
|
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]) &&
|
if (cmp_record(table,record[1]) &&
|
||||||
(error=table->file->update_row(table->record[1],table->record[0])))
|
(error=table->file->update_row(table->record[1],table->record[0])))
|
||||||
{ // This should never happen
|
{ // 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[0]->store(combo.host.str,combo.host.length, &my_charset_latin1);
|
||||||
table->field[1]->store(db,(uint) strlen(db), &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);
|
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,
|
table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS);
|
||||||
HA_READ_KEY_EXACT))
|
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')
|
if (what == 'N')
|
||||||
{ // no row, no revoke
|
{ // no row, no revoke
|
||||||
@ -1679,6 +1687,7 @@ static int replace_db_table(TABLE *table, const char *db,
|
|||||||
/* update old existing row */
|
/* update old existing row */
|
||||||
if (rights)
|
if (rights)
|
||||||
{
|
{
|
||||||
|
table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS);
|
||||||
if ((error=table->file->update_row(table->record[1],table->record[0])))
|
if ((error=table->file->update_row(table->record[1],table->record[0])))
|
||||||
goto table_error; /* purecov: deadcode */
|
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(),
|
table->field[4]->store(xx->column.ptr(),xx->column.length(),
|
||||||
&my_charset_latin1);
|
&my_charset_latin1);
|
||||||
|
|
||||||
|
table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS);
|
||||||
if (table->file->index_read(table->record[0],(byte*) table->field[0]->ptr,
|
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)
|
if (revoke_grant)
|
||||||
{
|
{
|
||||||
@ -2022,8 +2033,10 @@ static int replace_column_table(GRANT_TABLE *g_t,
|
|||||||
|
|
||||||
if (revoke_grant)
|
if (revoke_grant)
|
||||||
{
|
{
|
||||||
|
table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS);
|
||||||
if (table->file->index_read(table->record[0], (byte*) table->field[0]->ptr,
|
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;
|
goto end;
|
||||||
|
|
||||||
/* Scan through all rows with the same host,db,user and table */
|
/* 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[2]->store(combo.user.str,combo.user.length, &my_charset_latin1);
|
||||||
table->field[3]->store(table_name,(uint) strlen(table_name), &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
|
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,
|
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))
|
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)
|
tables[0].table->field[1]->store(user_name->user.str,(uint)
|
||||||
user_name->user.length,
|
user_name->user.length,
|
||||||
system_charset_info);
|
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,
|
if (!tables[0].table->file->index_read_idx(tables[0].table->record[0],0,
|
||||||
(byte*) tables[0].table->
|
(byte*) tables[0].table->
|
||||||
field[0]->ptr,0,
|
field[0]->ptr,
|
||||||
|
tables[0].table->
|
||||||
|
key_info[0].key_length,
|
||||||
HA_READ_KEY_EXACT))
|
HA_READ_KEY_EXACT))
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
|
Reference in New Issue
Block a user