~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/server_includes.h

  • Committer: Brian Aker
  • Date: 2008-08-18 22:20:43 UTC
  • mto: This revision was merged to the branch mainline in revision 352.
  • Revision ID: brian@tangent.org-20080818222043-et6zf93ogrgx1cz9
Refactoring table.h

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
void mysql_client_binlog_statement(THD *thd);
69
69
 
70
70
/* sql_rename.cc */
71
 
bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent);
72
 
bool do_rename(THD *thd, TABLE_LIST *ren_table, char *new_db,
 
71
bool mysql_rename_tables(THD *thd, TableList *table_list, bool silent);
 
72
bool do_rename(THD *thd, TableList *ren_table, char *new_db,
73
73
                      char *new_table_name, char *new_table_alias,
74
74
                      bool skip_error);
75
75
 
104
104
bool append_file_to_dir(THD *thd, const char **filename_ptr, 
105
105
                        const char *table_name);
106
106
 
107
 
bool reload_cache(THD *thd, ulong options, TABLE_LIST *tables, bool *write_to_binlog);
 
107
bool reload_cache(THD *thd, ulong options, TableList *tables, bool *write_to_binlog);
108
108
 
109
109
bool check_simple_select();
110
110
 
115
115
void free_max_user_conn(void);
116
116
pthread_handler_t handle_bootstrap(void *arg);
117
117
int mysql_execute_command(THD *thd);
118
 
bool check_dup(const char *db, const char *name, TABLE_LIST *tables);
119
 
bool check_table_access(THD *thd, ulong want_access, TABLE_LIST *tables,
 
118
bool check_dup(const char *db, const char *name, TableList *tables);
 
119
bool check_table_access(THD *thd, ulong want_access, TableList *tables,
120
120
                        bool no_errors,
121
121
                        bool any_combination_of_privileges_will_do,
122
122
                        uint number);
156
156
 
157
157
SORT_FIELD * make_unireg_sortorder(order_st *order, uint *length,
158
158
                                  SORT_FIELD *sortorder);
159
 
int setup_order(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables,
 
159
int setup_order(THD *thd, Item **ref_pointer_array, TableList *tables,
160
160
                List<Item> &fields, List <Item> &all_fields, order_st *order);
161
 
int setup_group(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables,
 
161
int setup_group(THD *thd, Item **ref_pointer_array, TableList *tables,
162
162
                List<Item> &fields, List<Item> &all_fields, order_st *order,
163
163
                bool *hidden_group_fields);
164
164
bool fix_inner_refs(THD *thd, List<Item> &all_fields, SELECT_LEX *select,
167
167
bool handle_select(THD *thd, LEX *lex, select_result *result,
168
168
                   ulong setup_tables_done_option);
169
169
bool mysql_select(THD *thd, Item ***rref_pointer_array,
170
 
                  TABLE_LIST *tables, uint wild_num,  List<Item> &list,
 
170
                  TableList *tables, uint wild_num,  List<Item> &list,
171
171
                  COND *conds, uint og_num, order_st *order, order_st *group,
172
172
                  Item *having, order_st *proc_param, uint64_t select_type, 
173
173
                  select_result *result, SELECT_LEX_UNIT *unit, 
181
181
                 SELECT_LEX_UNIT *unit, ulong setup_tables_done_option);
182
182
bool mysql_handle_derived(LEX *lex, bool (*processor)(THD *thd,
183
183
                                                      LEX *lex,
184
 
                                                      TABLE_LIST *table));
185
 
bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *t);
186
 
bool mysql_derived_filling(THD *thd, LEX *lex, TABLE_LIST *t);
 
184
                                                      TableList *table));
 
185
bool mysql_derived_prepare(THD *thd, LEX *lex, TableList *t);
 
186
bool mysql_derived_filling(THD *thd, LEX *lex, TableList *t);
187
187
Field *create_tmp_field(THD *thd, Table *table,Item *item, Item::Type type,
188
188
                        Item ***copy_func, Field **from_field,
189
189
                        Field **def_field,
208
208
 
209
209
bool mysql_alter_table(THD *thd, char *new_db, char *new_name,
210
210
                       HA_CREATE_INFO *create_info,
211
 
                       TABLE_LIST *table_list,
 
211
                       TableList *table_list,
212
212
                       Alter_info *alter_info,
213
213
                       uint order_num, order_st *order, bool ignore);
214
 
bool mysql_recreate_table(THD *thd, TABLE_LIST *table_list);
215
 
bool mysql_create_like_table(THD *thd, TABLE_LIST *table,
216
 
                             TABLE_LIST *src_table,
 
214
bool mysql_recreate_table(THD *thd, TableList *table_list);
 
215
bool mysql_create_like_table(THD *thd, TableList *table,
 
216
                             TableList *src_table,
217
217
                             HA_CREATE_INFO *create_info);
218
218
bool mysql_rename_table(handlerton *base, const char *old_db,
219
219
                        const char * old_name, const char *new_db,
220
220
                        const char * new_name, uint flags);
221
 
bool mysql_prepare_update(THD *thd, TABLE_LIST *table_list,
 
221
bool mysql_prepare_update(THD *thd, TableList *table_list,
222
222
                          Item **conds, uint order_num, order_st *order);
223
 
int mysql_update(THD *thd,TABLE_LIST *tables,List<Item> &fields,
 
223
int mysql_update(THD *thd,TableList *tables,List<Item> &fields,
224
224
                 List<Item> &values,COND *conds,
225
225
                 uint order_num, order_st *order, ha_rows limit,
226
226
                 enum enum_duplicates handle_duplicates, bool ignore);
227
 
bool mysql_multi_update(THD *thd, TABLE_LIST *table_list,
 
227
bool mysql_multi_update(THD *thd, TableList *table_list,
228
228
                        List<Item> *fields, List<Item> *values,
229
229
                        COND *conds, uint64_t options,
230
230
                        enum enum_duplicates handle_duplicates, bool ignore,
231
231
                        SELECT_LEX_UNIT *unit, SELECT_LEX *select_lex);
232
 
bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, Table *table,
 
232
bool mysql_prepare_insert(THD *thd, TableList *table_list, Table *table,
233
233
                          List<Item> &fields, List_item *values,
234
234
                          List<Item> &update_fields,
235
235
                          List<Item> &update_values, enum_duplicates duplic,
236
236
                          COND **where, bool select_insert,
237
237
                          bool check_fields, bool abort_on_warning);
238
 
bool mysql_insert(THD *thd,TABLE_LIST *table,List<Item> &fields,
 
238
bool mysql_insert(THD *thd,TableList *table,List<Item> &fields,
239
239
                  List<List_item> &values, List<Item> &update_fields,
240
240
                  List<Item> &update_values, enum_duplicates flag,
241
241
                  bool ignore);
242
242
int check_that_all_fields_are_given_values(THD *thd, Table *entry,
243
 
                                           TABLE_LIST *table_list);
 
243
                                           TableList *table_list);
244
244
void prepare_triggers_for_insert_stmt(Table *table);
245
 
int mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds);
246
 
bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
 
245
int mysql_prepare_delete(THD *thd, TableList *table_list, Item **conds);
 
246
bool mysql_delete(THD *thd, TableList *table_list, COND *conds,
247
247
                  SQL_LIST *order, ha_rows rows, uint64_t options,
248
248
                  bool reset_auto_increment);
249
 
bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok);
250
 
uint create_table_def_key(THD *thd, char *key, TABLE_LIST *table_list,
 
249
bool mysql_truncate(THD *thd, TableList *table_list, bool dont_send_ok);
 
250
uint create_table_def_key(THD *thd, char *key, TableList *table_list,
251
251
                          bool tmp_table);
252
 
TABLE_SHARE *get_table_share(THD *thd, TABLE_LIST *table_list, char *key,
 
252
TABLE_SHARE *get_table_share(THD *thd, TableList *table_list, char *key,
253
253
                             uint key_length, uint db_flags, int *error);
254
254
void release_table_share(TABLE_SHARE *share, enum release_type type);
255
255
TABLE_SHARE *get_cached_table_share(const char *db, const char *table_name);
256
 
Table *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type update,
 
256
Table *open_ltable(THD *thd, TableList *table_list, thr_lock_type update,
257
257
                   uint lock_flags);
258
 
Table *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT* mem,
 
258
Table *open_table(THD *thd, TableList *table_list, MEM_ROOT* mem,
259
259
                  bool *refresh, uint flags);
260
 
bool name_lock_locked_table(THD *thd, TABLE_LIST *tables);
261
 
bool reopen_name_locked_table(THD* thd, TABLE_LIST* table_list, bool link_in);
 
260
bool name_lock_locked_table(THD *thd, TableList *tables);
 
261
bool reopen_name_locked_table(THD* thd, TableList* table_list, bool link_in);
262
262
Table *table_cache_insert_placeholder(THD *thd, const char *key,
263
263
                                      uint key_length);
264
264
bool lock_table_name_if_not_cached(THD *thd, const char *db,
265
265
                                   const char *table_name, Table **table);
266
266
Table *find_locked_table(THD *thd, const char *db,const char *table_name);
267
267
void detach_merge_children(Table *table, bool clear_refs);
268
 
bool fix_merge_after_open(TABLE_LIST *old_child_list, TABLE_LIST **old_last,
269
 
                          TABLE_LIST *new_child_list, TABLE_LIST **new_last);
 
268
bool fix_merge_after_open(TableList *old_child_list, TableList **old_last,
 
269
                          TableList *new_child_list, TableList **new_last);
270
270
bool reopen_table(Table *table);
271
271
bool reopen_tables(THD *thd,bool get_locks,bool in_refresh);
272
272
void close_data_files_and_morph_locks(THD *thd, const char *db,
275
275
bool open_new_frm(THD *thd, TABLE_SHARE *share, const char *alias,
276
276
                  uint db_stat, uint prgflag,
277
277
                  uint ha_open_flags, Table *outparam,
278
 
                  TABLE_LIST *table_desc, MEM_ROOT *mem_root);
 
278
                  TableList *table_desc, MEM_ROOT *mem_root);
279
279
bool wait_for_tables(THD *thd);
280
280
bool table_is_used(Table *table, bool wait_for_name_lock);
281
281
Table *drop_locked_tables(THD *thd,const char *db, const char *table_name);
290
290
                                  IGNORE_EXCEPT_NON_UNIQUE};
291
291
Field *
292
292
find_field_in_tables(THD *thd, Item_ident *item,
293
 
                     TABLE_LIST *first_table, TABLE_LIST *last_table,
 
293
                     TableList *first_table, TableList *last_table,
294
294
                     Item **ref, find_item_error_report_type report_error,
295
295
                     bool check_privileges, bool register_tree_change);
296
296
Field *
297
 
find_field_in_table_ref(THD *thd, TABLE_LIST *table_list,
 
297
find_field_in_table_ref(THD *thd, TableList *table_list,
298
298
                        const char *name, uint length,
299
299
                        const char *item_name, const char *db_name,
300
300
                        const char *table_name, Item **ref,
301
301
                        bool check_privileges, bool allow_rowid,
302
302
                        uint *cached_field_index_ptr,
303
 
                        bool register_tree_change, TABLE_LIST **actual_table);
 
303
                        bool register_tree_change, TableList **actual_table);
304
304
Field *
305
305
find_field_in_table(THD *thd, Table *table, const char *name, uint length,
306
306
                    bool allow_rowid, uint *cached_field_index_ptr);
329
329
                         enum enum_schema_tables schema_table_idx);
330
330
int make_schema_select(THD *thd,  SELECT_LEX *sel,
331
331
                       enum enum_schema_tables schema_table_idx);
332
 
int mysql_schema_table(THD *thd, LEX *lex, TABLE_LIST *table_list);
 
332
int mysql_schema_table(THD *thd, LEX *lex, TableList *table_list);
333
333
bool get_schema_tables_result(JOIN *join,
334
334
                              enum enum_schema_table_state executed_place);
335
335
enum enum_schema_tables get_schema_table_idx(ST_SCHEMA_TABLE *schema_table);
338
338
  !my_strcasecmp(system_charset_info, INFORMATION_SCHEMA_NAME.str, (X))
339
339
 
340
340
/* sql_handler.cc */
341
 
bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen);
342
 
bool mysql_ha_close(THD *thd, TABLE_LIST *tables);
343
 
bool mysql_ha_read(THD *, TABLE_LIST *,enum enum_ha_read_modes,char *,
 
341
bool mysql_ha_open(THD *thd, TableList *tables, bool reopen);
 
342
bool mysql_ha_close(THD *thd, TableList *tables);
 
343
bool mysql_ha_read(THD *, TableList *,enum enum_ha_read_modes,char *,
344
344
                   List<Item> *,enum ha_rkey_function,Item *,ha_rows,ha_rows);
345
345
void mysql_ha_flush(THD *thd);
346
 
void mysql_ha_rm_tables(THD *thd, TABLE_LIST *tables, bool is_locked);
 
346
void mysql_ha_rm_tables(THD *thd, TableList *tables, bool is_locked);
347
347
void mysql_ha_cleanup(THD *thd);
348
348
 
349
349
/* sql_base.cc */
366
366
void store_position_for_column(const char *name);
367
367
bool add_to_list(THD *thd, SQL_LIST &list,Item *group,bool asc);
368
368
bool push_new_name_resolution_context(THD *thd,
369
 
                                      TABLE_LIST *left_op,
370
 
                                      TABLE_LIST *right_op);
371
 
void add_join_on(TABLE_LIST *b,Item *expr);
372
 
void add_join_natural(TABLE_LIST *a,TABLE_LIST *b,List<String> *using_fields,
 
369
                                      TableList *left_op,
 
370
                                      TableList *right_op);
 
371
void add_join_on(TableList *b,Item *expr);
 
372
void add_join_natural(TableList *a,TableList *b,List<String> *using_fields,
373
373
                      SELECT_LEX *lex);
374
374
bool add_proc_to_list(THD *thd, Item *item);
375
375
void unlink_open_table(THD *thd, Table *find, bool unlock);
376
376
void drop_open_table(THD *thd, Table *table, const char *db_name,
377
377
                     const char *table_name);
378
 
void update_non_unique_table_error(TABLE_LIST *update,
 
378
void update_non_unique_table_error(TableList *update,
379
379
                                   const char *operation,
380
 
                                   TABLE_LIST *duplicate);
 
380
                                   TableList *duplicate);
381
381
 
382
382
SQL_SELECT *make_select(Table *head, table_map const_tables,
383
383
                        table_map read_tables, COND *conds,
419
419
                   const char *db_name, const char *table_name,
420
420
                   List_iterator<Item> *it, bool any_privileges);
421
421
bool setup_tables(THD *thd, Name_resolution_context *context,
422
 
                  List<TABLE_LIST> *from_clause, TABLE_LIST *tables,
423
 
                  TABLE_LIST **leaves, bool select_insert);
 
422
                  List<TableList> *from_clause, TableList *tables,
 
423
                  TableList **leaves, bool select_insert);
424
424
bool setup_tables_and_check_access(THD *thd, 
425
425
                                   Name_resolution_context *context,
426
 
                                   List<TABLE_LIST> *from_clause, 
427
 
                                   TABLE_LIST *tables, 
428
 
                                   TABLE_LIST **leaves, 
 
426
                                   List<TableList> *from_clause, 
 
427
                                   TableList *tables, 
 
428
                                   TableList **leaves, 
429
429
                                   bool select_insert);
430
 
int setup_wild(THD *thd, TABLE_LIST *tables, List<Item> &fields,
 
430
int setup_wild(THD *thd, TableList *tables, List<Item> &fields,
431
431
               List<Item> *sum_func_list, uint wild_num);
432
432
bool setup_fields(THD *thd, Item** ref_pointer_array,
433
433
                  List<Item> &item, enum_mark_columns mark_used_columns,
443
443
                    allow_sum_func);
444
444
  return res;
445
445
}
446
 
int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves,
 
446
int setup_conds(THD *thd, TableList *tables, TableList *leaves,
447
447
                COND **conds);
448
448
int setup_ftfuncs(SELECT_LEX* select);
449
449
int init_ftfuncs(THD *thd, SELECT_LEX* select, bool no_order);
450
450
void wait_for_condition(THD *thd, pthread_mutex_t *mutex,
451
451
                        pthread_cond_t *cond);
452
 
int open_tables(THD *thd, TABLE_LIST **tables, uint *counter, uint flags);
 
452
int open_tables(THD *thd, TableList **tables, uint *counter, uint flags);
453
453
/* open_and_lock_tables with optional derived handling */
454
 
int open_and_lock_tables_derived(THD *thd, TABLE_LIST *tables, bool derived);
 
454
int open_and_lock_tables_derived(THD *thd, TableList *tables, bool derived);
455
455
/* simple open_and_lock_tables without derived handling */
456
 
inline int simple_open_n_lock_tables(THD *thd, TABLE_LIST *tables)
 
456
inline int simple_open_n_lock_tables(THD *thd, TableList *tables)
457
457
{
458
458
  return open_and_lock_tables_derived(thd, tables, false);
459
459
}
460
460
/* open_and_lock_tables with derived handling */
461
 
inline int open_and_lock_tables(THD *thd, TABLE_LIST *tables)
 
461
inline int open_and_lock_tables(THD *thd, TableList *tables)
462
462
{
463
463
  return open_and_lock_tables_derived(thd, tables, true);
464
464
}
465
465
/* simple open_and_lock_tables without derived handling for single table */
466
 
Table *open_n_lock_single_table(THD *thd, TABLE_LIST *table_l,
 
466
Table *open_n_lock_single_table(THD *thd, TableList *table_l,
467
467
                                thr_lock_type lock_type);
468
 
bool open_normal_and_derived_tables(THD *thd, TABLE_LIST *tables, uint flags);
469
 
int lock_tables(THD *thd, TABLE_LIST *tables, uint counter, bool *need_reopen);
470
 
int decide_logging_format(THD *thd, TABLE_LIST *tables);
 
468
bool open_normal_and_derived_tables(THD *thd, TableList *tables, uint flags);
 
469
int lock_tables(THD *thd, TableList *tables, uint counter, bool *need_reopen);
 
470
int decide_logging_format(THD *thd, TableList *tables);
471
471
Table *open_temporary_table(THD *thd, const char *path, const char *db,
472
472
                            const char *table_name, bool link_in_list,
473
473
                            open_table_mode open_mode);
476
476
void intern_close_table(Table *entry);
477
477
bool close_thread_table(THD *thd, Table **table_ptr);
478
478
void close_temporary_tables(THD *thd);
479
 
void close_tables_for_reopen(THD *thd, TABLE_LIST **tables);
480
 
TABLE_LIST *find_table_in_list(TABLE_LIST *table,
481
 
                               TABLE_LIST *TABLE_LIST::*link,
 
479
void close_tables_for_reopen(THD *thd, TableList **tables);
 
480
TableList *find_table_in_list(TableList *table,
 
481
                               TableList *TableList::*link,
482
482
                               const char *db_name,
483
483
                               const char *table_name);
484
 
TABLE_LIST *unique_table(THD *thd, TABLE_LIST *table, TABLE_LIST *table_list,
 
484
TableList *unique_table(THD *thd, TableList *table, TableList *table_list,
485
485
                         bool check_alias);
486
486
Table *find_temporary_table(THD *thd, const char *db, const char *table_name);
487
 
Table *find_temporary_table(THD *thd, TABLE_LIST *table_list);
488
 
int drop_temporary_table(THD *thd, TABLE_LIST *table_list);
 
487
Table *find_temporary_table(THD *thd, TableList *table_list);
 
488
int drop_temporary_table(THD *thd, TableList *table_list);
489
489
void close_temporary_table(THD *thd, Table *table, bool free_share,
490
490
                           bool delete_table);
491
491
void close_temporary(Table *table, bool free_share, bool delete_table);
515
515
#define WFRM_PACK_FRM 4
516
516
#define WFRM_KEEP_SHARE 8
517
517
 
518
 
bool close_cached_tables(THD *thd, TABLE_LIST *tables, bool have_lock,
 
518
bool close_cached_tables(THD *thd, TableList *tables, bool have_lock,
519
519
                         bool wait_for_refresh, bool wait_for_placeholders);
520
520
bool close_cached_connection_tables(THD *thd, bool wait_for_refresh,
521
521
                                    LEX_STRING *connect_string,
523
523
void copy_field_from_tmp_record(Field *field,int offset);
524
524
bool fill_record(THD * thd, List<Item> &fields, List<Item> &values, bool ignore_errors);
525
525
bool fill_record(THD *thd, Field **field, List<Item> &values, bool ignore_errors);
526
 
OPEN_TABLE_LIST *list_open_tables(THD *thd, const char *db, const char *wild);
 
526
OPEN_TableList *list_open_tables(THD *thd, const char *db, const char *wild);
527
527
 
528
 
inline TABLE_LIST *find_table_in_global_list(TABLE_LIST *table,
 
528
inline TableList *find_table_in_global_list(TableList *table,
529
529
                                             const char *db_name,
530
530
                                             const char *table_name)
531
531
{
532
 
  return find_table_in_list(table, &TABLE_LIST::next_global,
 
532
  return find_table_in_list(table, &TableList::next_global,
533
533
                            db_name, table_name);
534
534
}
535
535
 
536
 
inline TABLE_LIST *find_table_in_local_list(TABLE_LIST *table,
 
536
inline TableList *find_table_in_local_list(TableList *table,
537
537
                                            const char *db_name,
538
538
                                            const char *table_name)
539
539
{
540
 
  return find_table_in_list(table, &TABLE_LIST::next_local,
 
540
  return find_table_in_list(table, &TableList::next_local,
541
541
                            db_name, table_name);
542
542
}
543
543
 
546
546
bool eval_const_cond(COND *cond);
547
547
 
548
548
/* sql_load.cc */
549
 
int mysql_load(THD *thd, sql_exchange *ex, TABLE_LIST *table_list,
 
549
int mysql_load(THD *thd, sql_exchange *ex, TableList *table_list,
550
550
                List<Item> &fields_vars, List<Item> &set_fields,
551
551
                List<Item> &set_values_list,
552
552
                enum enum_duplicates handle_duplicates, bool ignore,
561
561
void print_plan(JOIN* join,uint idx, double record_count, double read_time,
562
562
                double current_read_time, const char *info);
563
563
void print_keyuse_array(DYNAMIC_ARRAY *keyuse_array);
564
 
void dump_TABLE_LIST_graph(SELECT_LEX *select_lex, TABLE_LIST* tl);
 
564
void dump_TableList_graph(SELECT_LEX *select_lex, TableList* tl);
565
565
void mysql_print_status();
566
566
 
567
567
/* key.cc */
715
715
 
716
716
extern DRIZZLE_BIN_LOG mysql_bin_log;
717
717
extern LOGGER logger;
718
 
extern TABLE_LIST general_log, slow_log;
 
718
extern TableList general_log, slow_log;
719
719
extern FILE *stderror_file;
720
720
extern pthread_key(MEM_ROOT**,THR_MALLOC);
721
721
extern pthread_mutex_t LOCK_mysql_create_db,LOCK_open, LOCK_lock_db,
788
788
                                thr_lock_type new_lock_type);
789
789
bool mysql_lock_abort_for_thread(THD *thd, Table *table);
790
790
DRIZZLE_LOCK *mysql_lock_merge(DRIZZLE_LOCK *a,DRIZZLE_LOCK *b);
791
 
TABLE_LIST *mysql_lock_have_duplicate(THD *thd, TABLE_LIST *needle,
792
 
                                      TABLE_LIST *haystack);
 
791
TableList *mysql_lock_have_duplicate(THD *thd, TableList *needle,
 
792
                                      TableList *haystack);
793
793
bool lock_global_read_lock(THD *thd);
794
794
void unlock_global_read_lock(THD *thd);
795
795
bool wait_if_global_read_lock(THD *thd, bool abort_on_refresh,
799
799
bool set_protect_against_global_read_lock(void);
800
800
void unset_protect_against_global_read_lock(void);
801
801
void broadcast_refresh(void);
802
 
int try_transactional_lock(THD *thd, TABLE_LIST *table_list);
803
 
int check_transactional_lock(THD *thd, TABLE_LIST *table_list);
804
 
int set_handler_table_locks(THD *thd, TABLE_LIST *table_list,
 
802
int try_transactional_lock(THD *thd, TableList *table_list);
 
803
int check_transactional_lock(THD *thd, TableList *table_list);
 
804
int set_handler_table_locks(THD *thd, TableList *table_list,
805
805
                            bool transactional);
806
806
 
807
807
/* Lock based on name */
808
 
int lock_and_wait_for_table_name(THD *thd, TABLE_LIST *table_list);
809
 
int lock_table_name(THD *thd, TABLE_LIST *table_list, bool check_in_use);
810
 
void unlock_table_name(THD *thd, TABLE_LIST *table_list);
811
 
bool wait_for_locked_table_names(THD *thd, TABLE_LIST *table_list);
812
 
bool lock_table_names(THD *thd, TABLE_LIST *table_list);
813
 
void unlock_table_names(THD *thd, TABLE_LIST *table_list,
814
 
                        TABLE_LIST *last_table);
815
 
bool lock_table_names_exclusively(THD *thd, TABLE_LIST *table_list);
 
808
int lock_and_wait_for_table_name(THD *thd, TableList *table_list);
 
809
int lock_table_name(THD *thd, TableList *table_list, bool check_in_use);
 
810
void unlock_table_name(THD *thd, TableList *table_list);
 
811
bool wait_for_locked_table_names(THD *thd, TableList *table_list);
 
812
bool lock_table_names(THD *thd, TableList *table_list);
 
813
void unlock_table_names(THD *thd, TableList *table_list,
 
814
                        TableList *last_table);
 
815
bool lock_table_names_exclusively(THD *thd, TableList *table_list);
816
816
bool is_table_name_exclusively_locked_by_this_thread(THD *thd, 
817
 
                                                     TABLE_LIST *table_list);
 
817
                                                     TableList *table_list);
818
818
bool is_table_name_exclusively_locked_by_this_thread(THD *thd, uchar *key,
819
819
                                                     int key_length);
820
820
 
838
838
                  char * *errpos);
839
839
 
840
840
/* table.cc */
841
 
TABLE_SHARE *alloc_table_share(TABLE_LIST *table_list, char *key,
 
841
TABLE_SHARE *alloc_table_share(TableList *table_list, char *key,
842
842
                               uint key_length);
843
843
void init_tmp_table_share(THD *thd, TABLE_SHARE *share, const char *key,
844
844
                          uint key_length,
1024
1024
  clean/setup table fields and map.
1025
1025
 
1026
1026
  @param table        Table structure pointer (which should be setup)
1027
 
  @param table_list   TABLE_LIST structure pointer (owner of Table)
 
1027
  @param table_list   TableList structure pointer (owner of Table)
1028
1028
  @param tablenr     table number
1029
1029
*/
1030
 
inline void setup_table_map(Table *table, TABLE_LIST *table_list, uint tablenr)
 
1030
inline void setup_table_map(Table *table, TableList *table_list, uint tablenr)
1031
1031
{
1032
1032
  table->used_fields= 0;
1033
1033
  table->const_table= 0;
1034
1034
  table->null_row= 0;
1035
1035
  table->status= STATUS_NO_RECORD;
1036
1036
  table->maybe_null= table_list->outer_join;
1037
 
  TABLE_LIST *embedding= table_list->embedding;
 
1037
  TableList *embedding= table_list->embedding;
1038
1038
  while (!table->maybe_null && embedding)
1039
1039
  {
1040
1040
    table->maybe_null= embedding->outer_join;