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,
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,
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,
290
290
IGNORE_EXCEPT_NON_UNIQUE};
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);
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);
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);
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,
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,
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);
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,
426
List<TableList> *from_clause,
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,
446
int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves,
446
int setup_conds(THD *thd, TableList *tables, TableList *leaves,
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)
458
458
return open_and_lock_tables_derived(thd, tables, false);
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)
463
463
return open_and_lock_tables_derived(thd, tables, true);
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);
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);
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,