~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_base.cc

  • Committer: Brian Aker
  • Date: 2008-08-19 23:26:33 UTC
  • Revision ID: brian@tangent.org-20080819232633-diua29a85vhsek75
Class cleanups... duplicates are in definitions and unireg :(

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
static bool table_def_inited= 0;
36
36
 
37
37
static int open_unireg_entry(THD *thd, Table *entry, TableList *table_list,
38
 
                             const char *alias,
39
 
                             char *cache_key, uint cache_key_length,
40
 
                             MEM_ROOT *mem_root, uint flags);
 
38
                             const char *alias,
 
39
                             char *cache_key, uint cache_key_length);
41
40
static void free_cache_entry(Table *entry);
42
41
static void close_old_data_files(THD *thd, Table *table, bool morph_locks,
43
42
                                 bool send_refresh);
1816
1815
 
1817
1816
  if (open_unireg_entry(thd, table, table_list, table_name,
1818
1817
                        table->s->table_cache_key.str,
1819
 
                        table->s->table_cache_key.length, thd->mem_root, 0))
 
1818
                        table->s->table_cache_key.length))
1820
1819
  {
1821
1820
    intern_close_table(table);
1822
1821
    /*
2062
2061
*/
2063
2062
 
2064
2063
 
2065
 
Table *open_table(THD *thd, TableList *table_list, MEM_ROOT *mem_root,
2066
 
                  bool *refresh, uint flags)
 
2064
Table *open_table(THD *thd, TableList *table_list, bool *refresh, uint flags)
2067
2065
{
2068
2066
  register Table *table;
2069
2067
  char key[MAX_DBKEY_LENGTH];
2421
2419
      return(NULL);
2422
2420
    }
2423
2421
 
2424
 
    error= open_unireg_entry(thd, table, table_list, alias, key, key_length,
2425
 
                             mem_root, (flags & OPEN_VIEW_NO_PARSE));
 
2422
    error= open_unireg_entry(thd, table, table_list, alias, key, key_length);
2426
2423
    /* Combine the follow two */
2427
2424
    if (error > 0)
2428
2425
    {
2541
2538
  if (open_unireg_entry(thd, &tmp, &table_list,
2542
2539
                        table->alias,
2543
2540
                        table->s->table_cache_key.str,
2544
 
                        table->s->table_cache_key.length,
2545
 
                        thd->mem_root, 0))
 
2541
                        table->s->table_cache_key.length))
2546
2542
    goto end;
2547
2543
 
2548
2544
  /* This list copies variables set by open_table */
3078
3074
    alias               Alias name
3079
3075
    cache_key           Key for share_cache
3080
3076
    cache_key_length    length of cache_key
3081
 
    mem_root            temporary mem_root for parsing
3082
 
    flags               the OPEN_VIEW_NO_PARSE flag to be passed to
3083
 
                        openfrm()/open_new_frm()
3084
3077
 
3085
3078
  NOTES
3086
3079
   Extra argument for open is taken from thd->open_options
3093
3086
 
3094
3087
static int open_unireg_entry(THD *thd, Table *entry, TableList *table_list,
3095
3088
                             const char *alias,
3096
 
                             char *cache_key, uint cache_key_length,
3097
 
                             MEM_ROOT *mem_root __attribute__((unused)),
3098
 
                             uint flags __attribute__((unused)))
 
3089
                             char *cache_key, uint cache_key_length)
3099
3090
{
3100
3091
  int error;
3101
3092
  TABLE_SHARE *share;
3105
3096
retry:
3106
3097
  if (!(share= get_table_share_with_create(thd, table_list, cache_key,
3107
3098
                                           cache_key_length, 
3108
 
                                           OPEN_VIEW |
3109
3099
                                           table_list->i_s_requested_object,
3110
3100
                                           &error)))
3111
3101
    return(1);
3330
3320
      not opened yet. Try to open the table.
3331
3321
    */
3332
3322
    if (!tables->table)
3333
 
      tables->table= open_table(thd, tables, &new_frm_mem, &refresh, flags);
 
3323
      tables->table= open_table(thd, tables, &refresh, flags);
3334
3324
 
3335
3325
    if (!tables->table)
3336
3326
    {
3506
3496
 
3507
3497
  thd_proc_info(thd, "Opening table");
3508
3498
  thd->current_tablenr= 0;
3509
 
  while (!(table= open_table(thd, table_list, thd->mem_root, &refresh, 0)) &&
 
3499
  while (!(table= open_table(thd, table_list, &refresh, 0)) &&
3510
3500
         refresh)
3511
3501
    ;
3512
3502