List:General Discussion« Previous MessageNext Message »
From:Tianwei Date:March 10 2009 8:33am
Subject:Question about the code in check_routine_access?
View as plain text  
Hi, all,  I don't know if this is the right list to ask such naive question.
I am analyzing some mysql code for my work. For the following code:
sql/sql_parser.c:5247
bool
check_routine_access(THD *thd, ulong want_access,char *db, char *name,
     bool is_proc, bool no_errors)
{
  TABLE_LIST tables[1];

  bzero((char *)tables, sizeof(TABLE_LIST));
  tables->db= db;
  tables->table_name= tables->alias= name;

.........
}

For tables, Why we use an array, not as the following:
TABLE_LIST tables, * tables_p;
tables_p = &tables;

I know that they are equivalent,  but anyone can explain why we use the
former´╝č Are there any special rules or I misunderstand the code?


Thanks very much


Tianwei

Thread
Question about the code in check_routine_access?Tianwei10 Mar