~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.h

Blackhole, CSV, Pool of Threads,Single Thread, Multi Thread.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#ifndef DRIZZLED_SQL_TABLE_H
27
27
#define DRIZZLED_SQL_TABLE_H
28
28
 
29
 
#include "drizzled/base.h"
30
 
 
31
 
namespace drizzled
32
 
{
33
 
 
34
29
class Session;
35
30
class TableList;
36
31
typedef struct st_ha_check_opt HA_CHECK_OPT;
37
32
class Table;
38
 
typedef struct st_ha_create_information HA_CREATE_INFO;
39
 
class AlterInfo;
40
 
class Cursor;
41
33
 
42
 
namespace message { class Table; }
43
 
class TableIdentifier;
 
34
namespace drizzled { namespace message { class Table; } }
44
35
 
45
36
int mysql_rm_table_part2(Session *session, TableList *tables, bool if_exists,
46
37
                         bool drop_temporary);
 
38
void write_bin_log_drop_table(Session *session,
 
39
                              bool if_exists, const char *db_name,
 
40
                              const char *table_name);
 
41
bool quick_rm_table(Session& session,
 
42
                    drizzled::TableIdentifier &identifier);
47
43
void close_cached_table(Session *session, Table *table);
48
44
 
49
45
void wait_while_table_is_used(Session *session, Table *table,
50
46
                              enum ha_extra_function function);
51
47
 
 
48
bool mysql_checksum_table(Session* session, TableList* table_list,
 
49
                          HA_CHECK_OPT* check_opt);
52
50
bool mysql_check_table(Session* session, TableList* table_list,
53
51
                       HA_CHECK_OPT* check_opt);
54
52
bool mysql_analyze_table(Session* session, TableList* table_list,
56
54
bool mysql_optimize_table(Session* session, TableList* table_list,
57
55
                          HA_CHECK_OPT* check_opt);
58
56
 
59
 
void write_bin_log(Session *session, const std::string &query);
 
57
void write_bin_log(Session *session,
 
58
                   char const *query, size_t query_length);
60
59
 
61
 
bool is_primary_key(KeyInfo *key_info);
 
60
bool is_primary_key(KEY *key_info);
62
61
const char* is_primary_key_name(const char* key_name);
63
 
bool check_engine(Session *, const char *, message::Table *, HA_CREATE_INFO *);
 
62
bool check_engine(Session *, const char *, drizzled::message::Table *, HA_CREATE_INFO *);
64
63
void set_table_default_charset(HA_CREATE_INFO *create_info, const char *db);
65
 
} /* namespace drizzled */
 
64
/*
 
65
  Preparation for table creation
 
66
 
 
67
  SYNOPSIS
 
68
    mysql_prepare_create_table()
 
69
      session                       Thread object.
 
70
      create_info               Create information (like MAX_ROWS).
 
71
      alter_info                List of columns and indexes to create
 
72
      tmp_table                 If a temporary table is to be created.
 
73
      db_options          INOUT Table options (like HA_OPTION_PACK_RECORD).
 
74
      file                      The Cursor for the new table.
 
75
      key_info_buffer     OUT   An array of KEY structs for the indexes.
 
76
      key_count           OUT   The number of elements in the array.
 
77
      select_field_count        The number of fields coming from a select table.
 
78
 
 
79
  DESCRIPTION
 
80
    Prepares the table and key structures for table creation.
 
81
 
 
82
  NOTES
 
83
    sets create_info->varchar if the table has a varchar
 
84
 
 
85
  RETURN VALUES
 
86
    false    OK
 
87
    true     error
 
88
*/
 
89
int mysql_prepare_create_table(Session *session,
 
90
                               HA_CREATE_INFO *create_info,
 
91
                               drizzled::message::Table *create_proto,
 
92
                               AlterInfo *alter_info,
 
93
                               bool tmp_table,
 
94
                               uint32_t *db_options,
 
95
                               Cursor *file,
 
96
                               KEY **key_info_buffer,
 
97
                               uint32_t *key_count,
 
98
                               int select_field_count);
66
99
 
67
100
#endif /* DRIZZLED_SQL_TABLE_H */