~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_base.cc

  • Committer: Brian Aker
  • Date: 2009-05-22 22:09:30 UTC
  • mto: This revision was merged to the branch mainline in revision 1037.
  • Revision ID: brian@gaz-20090522220930-pwl91hefo5f4udzq
Fixed TableList to correctly construct (and removed memset() calls in
places).

Show diffs side-by-side

added added

removed removed

Lines of Context:
805
805
  bool result= false;
806
806
  assert(session);
807
807
 
808
 
  memset(&tmp, 0, sizeof(TableList));
809
 
 
810
808
  if (!have_lock)
811
809
    pthread_mutex_lock(&LOCK_open);
812
810
 
2264
2262
    errmsg_printf(ERRMSG_LVL_ERROR, _("Table %s had a open data handler in reopen_table"),
2265
2263
                    table->alias);
2266
2264
#endif
2267
 
  memset(&table_list, 0, sizeof(TableList));
2268
2265
  table_list.db=         table->s->db.str;
2269
2266
  table_list.table_name= table->s->table_name.str;
2270
2267
  table_list.table=      table;
2987
2984
    */
2988
2985
    if (tables->schema_table)
2989
2986
    {
2990
 
      if (!mysql_schema_table(session, session->lex, tables))
 
2987
      if (mysql_schema_table(session, session->lex, tables) == false)
2991
2988
        continue;
2992
 
      return(-1);
 
2989
      return -1;
2993
2990
    }
2994
2991
    (*counter)++;
2995
2992
 
2997
2994
      Not a placeholder: must be a base table or a view, and the table is
2998
2995
      not opened yet. Try to open the table.
2999
2996
    */
3000
 
    if (!tables->table)
 
2997
    if (tables->table == NULL)
3001
2998
      tables->table= open_table(session, tables, &refresh, flags);
3002
2999
 
3003
 
    if (!tables->table)
 
3000
    if (tables->table == NULL)
3004
3001
    {
3005
3002
      free_root(&new_frm_mem, MYF(MY_KEEP_PREALLOC));
3006
3003
 
3319
3316
  */
3320
3317
  *need_reopen= false;
3321
3318
 
3322
 
  if (!tables)
 
3319
  if (tables == NULL)
3323
3320
    return 0;
3324
3321
 
3325
3322
  if (!session->locked_tables)
5193
5190
    this is used for INSERT ... SELECT.
5194
5191
    For select we setup tables except first (and its underlying tables)
5195
5192
  */
5196
 
  TableList *first_select_table= (select_insert ?
5197
 
                                   tables->next_local:
5198
 
                                   0);
 
5193
  TableList *first_select_table= (select_insert ?  tables->next_local: NULL);
 
5194
 
5199
5195
  if (!(*leaves))
5200
5196
    make_leaves_list(leaves, tables);
5201
5197