summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorbell@sanja.is.com.ua <>2004-02-09 15:01:51 +0200
committerbell@sanja.is.com.ua <>2004-02-09 15:01:51 +0200
commitff0a6e9686a9c11e8c760f5a789a84b4a777739f (patch)
treec8ec8613fe59e076ac6d3719bcaf06d5f3da8d46 /sql/sql_acl.cc
parentcc78e2d97aa2906bfd162e47c97662b9190ec014 (diff)
parent74a9ca1991b61c51d666ac5901b9358085deea6c (diff)
downloadmariadb-git-ff0a6e9686a9c11e8c760f5a789a84b4a777739f.tar.gz
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/bk/work-derived2-4.1
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 9d3ab8621d7..c500f0cf1f7 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -173,7 +173,8 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables)
tables[0].lock_type=tables[1].lock_type=tables[2].lock_type=TL_READ;
tables[0].db=tables[1].db=tables[2].db=thd->db;
- if (open_tables(thd,tables))
+ uint counter;
+ if (open_tables(thd, tables, &counter))
{
sql_print_error("Fatal error: Can't open privilege tables: %s",
thd->net.last_error);
@@ -2247,7 +2248,7 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
}
#endif
- if (open_and_lock_tables(thd,tables))
+ if (simple_open_n_lock_tables(thd,tables))
{ // Should never happen
close_thread_tables(thd); /* purecov: deadcode */
DBUG_RETURN(-1); /* purecov: deadcode */
@@ -2395,7 +2396,7 @@ int mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
}
/* open the mysql.user and mysql.db tables */
-
+ bzero((char*) &tables,sizeof(tables));
tables[0].alias=tables[0].real_name=(char*) "user";
tables[1].alias=tables[1].real_name=(char*) "db";
tables[0].next=tables+1;
@@ -2421,7 +2422,7 @@ int mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
}
#endif
- if (open_and_lock_tables(thd,tables))
+ if (simple_open_n_lock_tables(thd,tables))
{ // This should never happen
close_thread_tables(thd); /* purecov: deadcode */
DBUG_RETURN(-1); /* purecov: deadcode */
@@ -2517,14 +2518,15 @@ my_bool grant_init(THD *org_thd)
thd->store_globals();
thd->db= my_strdup("mysql",MYF(0));
thd->db_length=5; // Safety
- bzero((char*) &tables,sizeof(tables));
+ bzero((char*) &tables, sizeof(tables));
tables[0].alias=tables[0].real_name= (char*) "tables_priv";
tables[1].alias=tables[1].real_name= (char*) "columns_priv";
tables[0].next=tables+1;
tables[0].lock_type=tables[1].lock_type=TL_READ;
tables[0].db=tables[1].db=thd->db;
- if (open_tables(thd,tables))
+ uint counter;
+ if (open_tables(thd, tables, &counter))
goto end;
TABLE *ptr[2]; // Lock tables for quick update
@@ -3376,7 +3378,7 @@ int open_grant_tables(THD *thd, TABLE_LIST *tables)
}
#endif
- if (open_and_lock_tables(thd, tables))
+ if (simple_open_n_lock_tables(thd, tables))
{ // This should never happen
close_thread_tables(thd);
DBUG_RETURN(-1);