~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_class.h

  • Committer: Brian Aker
  • Date: 2008-08-16 22:34:15 UTC
  • mto: This revision was merged to the branch mainline in revision 346.
  • Revision ID: brian@tangent.org-20080816223415-n24esdpfcqi4pwpy
Refactor around classes. TABLE_LIST has been factored out of table.h

Show diffs side-by-side

added added

removed removed

Lines of Context:
214
214
 
215
215
typedef struct st_mysql_lock
216
216
{
217
 
  TABLE **table;
 
217
  Table **table;
218
218
  uint table_count,lock_count;
219
219
  THR_LOCK_DATA **locks;
220
220
} DRIZZLE_LOCK;
686
686
    List of regular tables in use by this thread. Contains temporary and
687
687
    base tables that were opened with @see open_tables().
688
688
  */
689
 
  TABLE *open_tables;
 
689
  Table *open_tables;
690
690
  /**
691
691
    List of temporary tables used by this thread. Contains user-level
692
692
    temporary tables, created with CREATE TEMPORARY TABLE, and
694
694
    or for an intermediate table used in ALTER.
695
695
    XXX Why are internal temporary tables added to this list?
696
696
  */
697
 
  TABLE *temporary_tables;
 
697
  Table *temporary_tables;
698
698
  /**
699
699
    List of tables that were opened with HANDLER OPEN and are
700
700
    still in use by this thread.
701
701
  */
702
 
  TABLE *handler_tables;
703
 
  TABLE *derived_tables;
 
702
  Table *handler_tables;
 
703
  Table *derived_tables;
704
704
  /*
705
705
    During a MySQL session, one can lock tables in two modes: automatic
706
706
    or manual. In automatic mode all necessary tables are locked just before
1119
1119
  */
1120
1120
  void binlog_start_trans_and_stmt();
1121
1121
  void binlog_set_stmt_begin();
1122
 
  int binlog_write_table_map(TABLE *table, bool is_transactional);
1123
 
  int binlog_write_row(TABLE* table, bool is_transactional,
 
1122
  int binlog_write_table_map(Table *table, bool is_transactional);
 
1123
  int binlog_write_row(Table* table, bool is_transactional,
1124
1124
                       const uchar *new_data);
1125
 
  int binlog_delete_row(TABLE* table, bool is_transactional,
 
1125
  int binlog_delete_row(Table* table, bool is_transactional,
1126
1126
                        const uchar *old_data);
1127
 
  int binlog_update_row(TABLE* table, bool is_transactional,
 
1127
  int binlog_update_row(Table* table, bool is_transactional,
1128
1128
                        const uchar *old_data, const uchar *new_data);
1129
1129
 
1130
1130
  void set_server_id(uint32_t sid) { server_id = sid; }
1133
1133
    Member functions to handle pending event for row-level logging.
1134
1134
  */
1135
1135
  template <class RowsEventT> Rows_log_event*
1136
 
    binlog_prepare_pending_rows_event(TABLE* table, uint32_t serv_id,
 
1136
    binlog_prepare_pending_rows_event(Table* table, uint32_t serv_id,
1137
1137
                                      size_t needed,
1138
1138
                                      bool is_transactional,
1139
1139
                                      RowsEventT* hint);
1683
1683
 
1684
1684
  bool convert_string(String *s, const CHARSET_INFO * const from_cs, const CHARSET_INFO * const to_cs);
1685
1685
 
1686
 
  void add_changed_table(TABLE *table);
 
1686
  void add_changed_table(Table *table);
1687
1687
  void add_changed_table(const char *key, long key_length);
1688
1688
  CHANGED_TABLE_LIST * changed_table_dup(const char *key, long key_length);
1689
1689
  int send_explain_fields(select_result *result);
2122
2122
class select_insert :public select_result_interceptor {
2123
2123
 public:
2124
2124
  TABLE_LIST *table_list;
2125
 
  TABLE *table;
 
2125
  Table *table;
2126
2126
  List<Item> *fields;
2127
2127
  uint64_t autoinc_value_of_last_inserted_row; // autogenerated or not
2128
2128
  COPY_INFO info;
2129
2129
  bool insert_into_view;
2130
2130
  select_insert(TABLE_LIST *table_list_par,
2131
 
                TABLE *table_par, List<Item> *fields_par,
 
2131
                Table *table_par, List<Item> *fields_par,
2132
2132
                List<Item> *update_fields, List<Item> *update_values,
2133
2133
                enum_duplicates duplic, bool ignore);
2134
2134
  ~select_insert();
2171
2171
    {}
2172
2172
  int prepare(List<Item> &list, SELECT_LEX_UNIT *u);
2173
2173
 
2174
 
  void binlog_show_create_table(TABLE **tables, uint count);
 
2174
  void binlog_show_create_table(Table **tables, uint count);
2175
2175
  void store_values(List<Item> &values);
2176
2176
  void send_error(uint errcode,const char *err);
2177
2177
  bool send_eof();
2258
2258
{
2259
2259
  TMP_TABLE_PARAM tmp_table_param;
2260
2260
public:
2261
 
  TABLE *table;
 
2261
  Table *table;
2262
2262
 
2263
2263
  select_union() :table(0) {}
2264
2264
  int prepare(List<Item> &list, SELECT_LEX_UNIT *u);
2434
2434
    return(!tree_insert(&tree, ptr, 0, tree.custom_arg));
2435
2435
  }
2436
2436
 
2437
 
  bool get(TABLE *table);
 
2437
  bool get(Table *table);
2438
2438
  static double get_use_cost(uint *buffer, uint nkeys, uint key_size, 
2439
2439
                             uint64_t max_in_memory_size);
2440
2440
  inline static int get_cost_calc_buff_size(ulong nkeys, uint key_size, 
2490
2490
  TABLE_LIST *all_tables; /* query/update command tables */
2491
2491
  TABLE_LIST *leaves;     /* list of leves of join table tree */
2492
2492
  TABLE_LIST *update_tables, *table_being_updated;
2493
 
  TABLE **tmp_tables, *main_table, *table_to_update;
 
2493
  Table **tmp_tables, *main_table, *table_to_update;
2494
2494
  TMP_TABLE_PARAM *tmp_table_param;
2495
2495
  ha_rows updated, found;
2496
2496
  List <Item> *fields, *values;
2500
2500
   List of tables referenced in the CHECK OPTION condition of
2501
2501
   the updated view excluding the updated table. 
2502
2502
  */
2503
 
  List <TABLE> unupdated_check_opt_tables;
 
2503
  List <Table> unupdated_check_opt_tables;
2504
2504
  Copy_field *copy_field;
2505
2505
  enum enum_duplicates handle_duplicates;
2506
2506
  bool do_update, trans_safe;