~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

  • Committer: Brian Aker
  • Date: 2009-10-16 10:27:33 UTC
  • mfrom: (1183.1.4 merge)
  • Revision ID: brian@gaz-20091016102733-b10po5oup0hjlilh
Merge Engine changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
420
420
 
421
421
  SYNOPSIS
422
422
    mysql_rm_table_part2()
423
 
    session                     Thread handler
 
423
    session                     Thread Cursor
424
424
    tables              Tables to drop
425
425
    if_exists           If set, don't give an error if table doesn't exists.
426
426
                        In this case we give an warning of level 'NOTE'
427
427
    drop_temporary      Only drop temporary tables
428
428
    dont_log_query      Don't write query to log files. This will also not
429
 
                        generate warnings if the handler files doesn't exists
 
429
                        generate warnings if the Cursor files doesn't exists
430
430
 
431
431
  TODO:
432
432
    When logging to the binary log, we should log
831
831
                               AlterInfo *alter_info,
832
832
                               bool tmp_table,
833
833
                               uint32_t *db_options,
834
 
                               handler *file,
 
834
                               Cursor *file,
835
835
                               KEY **key_info_buffer,
836
836
                               uint32_t *key_count,
837
837
                               int select_field_count)
1597
1597
  uint32_t          path_length;
1598
1598
  uint          db_options, key_count;
1599
1599
  KEY           *key_info_buffer;
1600
 
  handler       *file;
 
1600
  Cursor        *file;
1601
1601
  bool          error= true;
1602
1602
  /* Check for duplicate fields and check type of table to create */
1603
1603
  if (!alter_info->create_list.elements)
1612
1612
  db_options= create_info->table_options;
1613
1613
  if (create_info->row_type == ROW_TYPE_DYNAMIC)
1614
1614
    db_options|=HA_OPTION_PACK_RECORD;
1615
 
  if (!(file= plugin::StorageEngine::getNewHandler((TableShare*) 0, session->mem_root,
1616
 
                              create_info->db_type)))
 
1615
  if (!(file= create_info->db_type->getCursor((TableShare*) 0, session->mem_root)))
1617
1616
  {
1618
 
    my_error(ER_OUTOFMEMORY, MYF(0), sizeof(handler));
 
1617
    my_error(ER_OUTOFMEMORY, MYF(0), sizeof(Cursor));
1619
1618
    return true;
1620
1619
  }
1621
1620
 
1947
1946
 
1948
1947
  SYNOPSIS
1949
1948
    wait_while_table_is_used()
1950
 
    session                     Thread handler
 
1949
    session                     Thread Cursor
1951
1950
    table               Table to remove from cache
1952
1951
    function            HA_EXTRA_PREPARE_FOR_DROP if table is to be deleted
1953
1952
                        HA_EXTRA_FORCE_REOPEN if table is not be used
1982
1981
 
1983
1982
  SYNOPSIS
1984
1983
    close_cached_table()
1985
 
    session                     Thread handler
 
1984
    session                     Thread Cursor
1986
1985
    table               Table to remove from cache
1987
1986
 
1988
1987
  NOTES
2026
2025
                              uint32_t extra_open_options,
2027
2026
                              int (*prepare_func)(Session *, TableList *,
2028
2027
                                                  HA_CHECK_OPT *),
2029
 
                              int (handler::*operator_func)(Session *,
 
2028
                              int (Cursor::*operator_func)(Session *,
2030
2029
                                                            HA_CHECK_OPT *))
2031
2030
{
2032
2031
  TableList *table;
2156
2155
      open_for_modify= 0;
2157
2156
    }
2158
2157
 
2159
 
    if (table->table->s->crashed && operator_func == &handler::ha_check)
 
2158
    if (table->table->s->crashed && operator_func == &Cursor::ha_check)
2160
2159
    {
2161
2160
      session->client->store(table_name);
2162
2161
      session->client->store(operator_name);
2351
2350
{
2352
2351
  return(mysql_admin_table(session, tables, check_opt,
2353
2352
                           "optimize", TL_WRITE, 1,0,0,0,
2354
 
                           &handler::ha_optimize));
 
2353
                           &Cursor::ha_optimize));
2355
2354
}
2356
2355
 
2357
2356
/*
2599
2598
 
2600
2599
  return(mysql_admin_table(session, tables, check_opt,
2601
2600
                                "analyze", lock_type, 1, 0, 0, 0,
2602
 
                                &handler::ha_analyze));
 
2601
                                &Cursor::ha_analyze));
2603
2602
}
2604
2603
 
2605
2604
 
2610
2609
  return(mysql_admin_table(session, tables, check_opt,
2611
2610
                                "check", lock_type,
2612
2611
                                0, 0, HA_OPEN_FOR_REPAIR, 0,
2613
 
                                &handler::ha_check));
 
2612
                                &Cursor::ha_check));
2614
2613
}
2615
2614
 
2616
2615
/*
2618
2617
 
2619
2618
  SYNOPSIS
2620
2619
    mysql_recreate_table()
2621
 
    session                     Thread handler
 
2620
    session                     Thread Cursor
2622
2621
    tables              Tables to recreate
2623
2622
 
2624
2623
 RETURN