~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session.cc

  • Committer: Brian Aker
  • Date: 2009-01-17 02:46:52 UTC
  • Revision ID: brian@gir-3.local-20090117024652-4ducefje08ajbs1q
Refactor append_identifier and remove dead OPTION_QUOTE_SHOW_CREATE option
(we always quote).

Show diffs side-by-side

added added

removed removed

Lines of Context:
2616
2616
  Table *table;
2617
2617
  Table *next= NULL;
2618
2618
  Table *prev_table;
2619
 
  /* Assume session->options has OPTION_QUOTE_SHOW_CREATE */
2620
 
  bool was_quote_show= true;
2621
2619
 
2622
2620
  if (!temporary_tables)
2623
2621
    return;
2681
2679
    }
2682
2680
  }
2683
2681
 
2684
 
  /* We always quote db,table names though it is slight overkill */
2685
 
  if (found_user_tables && !(was_quote_show= test(options & OPTION_QUOTE_SHOW_CREATE)))
2686
 
  {
2687
 
    options |= OPTION_QUOTE_SHOW_CREATE;
2688
 
  }
2689
 
 
2690
2682
  /* scan sorted tmps to generate sequence of DROP */
2691
2683
  for (table= temporary_tables; table; table= next)
2692
2684
  {
2708
2700
          We are going to add 4 ` around the db/table names and possible more
2709
2701
          due to special characters in the names
2710
2702
        */
2711
 
        append_identifier(this, &s_query, table->s->db.str, strlen(table->s->db.str));
 
2703
        s_query.append_identifier(table->s->db.str, strlen(table->s->db.str));
2712
2704
        s_query.append('.');
2713
 
        append_identifier(this, &s_query, table->s->table_name.str,
2714
 
                          strlen(table->s->table_name.str));
 
2705
        s_query.append_identifier(table->s->table_name.str, strlen(table->s->table_name.str));
2715
2706
        s_query.append(',');
2716
2707
        next= table->next;
2717
2708
        close_temporary(table, 1, 1);
2740
2731
      close_temporary(table, 1, 1);
2741
2732
    }
2742
2733
  }
2743
 
  if (!was_quote_show)
2744
 
    options&= ~OPTION_QUOTE_SHOW_CREATE; /* restore option */
 
2734
 
2745
2735
  temporary_tables= NULL;
2746
2736
}