1268
1279
#define trans_need_2pc(session, all) ((total_ha_2pc > 1) && \
1269
1280
!((all ? &session->transaction.all : &session->transaction.stmt)->no_2pc))
1283
bool mysql_xa_recover(Session *session);
1285
SORT_FIELD * make_unireg_sortorder(order_st *order, uint32_t *length,
1286
SORT_FIELD *sortorder);
1287
int setup_order(Session *session, Item **ref_pointer_array, TableList *tables,
1288
List<Item> &fields, List <Item> &all_fields, order_st *order);
1289
int setup_group(Session *session, Item **ref_pointer_array, TableList *tables,
1290
List<Item> &fields, List<Item> &all_fields, order_st *order,
1291
bool *hidden_group_fields);
1292
bool fix_inner_refs(Session *session, List<Item> &all_fields, SELECT_LEX *select,
1293
Item **ref_pointer_array);
1295
bool handle_select(Session *session, LEX *lex, select_result *result,
1296
ulong setup_tables_done_option);
1297
bool mysql_select(Session *session, Item ***rref_pointer_array,
1298
TableList *tables, uint32_t wild_num, List<Item> &list,
1299
COND *conds, uint32_t og_num, order_st *order, order_st *group,
1300
Item *having, order_st *proc_param, uint64_t select_type,
1301
select_result *result, SELECT_LEX_UNIT *unit,
1302
SELECT_LEX *select_lex);
1303
void free_underlaid_joins(Session *session, SELECT_LEX *select);
1304
bool mysql_explain_union(Session *session, SELECT_LEX_UNIT *unit,
1305
select_result *result);
1306
int mysql_explain_select(Session *session, SELECT_LEX *sl, char const *type,
1307
select_result *result);
1308
bool mysql_union(Session *session, LEX *lex, select_result *result,
1309
SELECT_LEX_UNIT *unit, ulong setup_tables_done_option);
1310
bool mysql_handle_derived(LEX *lex, bool (*processor)(Session *session,
1313
bool mysql_derived_prepare(Session *session, LEX *lex, TableList *t);
1314
bool mysql_derived_filling(Session *session, LEX *lex, TableList *t);
1315
void sp_prepare_create_field(Session *session, Create_field *sql_field);
1316
int prepare_create_field(Create_field *sql_field,
1317
uint32_t *blob_columns,
1318
int *timestamps, int *timestamps_with_niladic,
1319
int64_t table_flags);
1320
bool mysql_create_table(Session *session,const char *db, const char *table_name,
1321
HA_CREATE_INFO *create_info,
1322
Alter_info *alter_info,
1323
bool tmp_table, uint32_t select_field_count);
1324
bool mysql_create_table_no_lock(Session *session, const char *db,
1325
const char *table_name,
1326
HA_CREATE_INFO *create_info,
1327
Alter_info *alter_info,
1328
bool tmp_table, uint32_t select_field_count,
1329
bool lock_open_lock);
1331
bool mysql_alter_table(Session *session, char *new_db, char *new_name,
1332
HA_CREATE_INFO *create_info,
1333
TableList *table_list,
1334
Alter_info *alter_info,
1335
uint32_t order_num, order_st *order, bool ignore);
1336
bool mysql_recreate_table(Session *session, TableList *table_list);
1337
bool mysql_create_like_table(Session *session, TableList *table,
1338
TableList *src_table,
1339
HA_CREATE_INFO *create_info);
1340
bool mysql_rename_table(handlerton *base, const char *old_db,
1341
const char * old_name, const char *new_db,
1342
const char * new_name, uint32_t flags);
1343
bool mysql_prepare_update(Session *session, TableList *table_list,
1344
Item **conds, uint32_t order_num, order_st *order);
1345
int mysql_update(Session *session,TableList *tables,List<Item> &fields,
1346
List<Item> &values,COND *conds,
1347
uint32_t order_num, order_st *order, ha_rows limit,
1348
enum enum_duplicates handle_duplicates, bool ignore);
1349
bool mysql_multi_update(Session *session, TableList *table_list,
1350
List<Item> *fields, List<Item> *values,
1351
COND *conds, uint64_t options,
1352
enum enum_duplicates handle_duplicates, bool ignore,
1353
SELECT_LEX_UNIT *unit, SELECT_LEX *select_lex);
1354
bool mysql_prepare_insert(Session *session, TableList *table_list, Table *table,
1355
List<Item> &fields, List_item *values,
1356
List<Item> &update_fields,
1357
List<Item> &update_values, enum_duplicates duplic,
1358
COND **where, bool select_insert,
1359
bool check_fields, bool abort_on_warning);
1360
bool mysql_insert(Session *session,TableList *table,List<Item> &fields,
1361
List<List_item> &values, List<Item> &update_fields,
1362
List<Item> &update_values, enum_duplicates flag,
1364
int check_that_all_fields_are_given_values(Session *session, Table *entry,
1365
TableList *table_list);
1366
void prepare_triggers_for_insert_stmt(Table *table);
1367
int mysql_prepare_delete(Session *session, TableList *table_list, Item **conds);
1368
bool mysql_delete(Session *session, TableList *table_list, COND *conds,
1369
SQL_LIST *order, ha_rows rows, uint64_t options,
1370
bool reset_auto_increment);
1371
bool mysql_truncate(Session *session, TableList *table_list, bool dont_send_ok);
1372
uint32_t create_table_def_key(Session *session, char *key, TableList *table_list,
1374
TABLE_SHARE *get_table_share(Session *session, TableList *table_list, char *key,
1375
uint32_t key_length, uint32_t db_flags, int *error);
1376
void release_table_share(TABLE_SHARE *share, enum release_type type);
1377
TABLE_SHARE *get_cached_table_share(const char *db, const char *table_name);
1378
Table *open_ltable(Session *session, TableList *table_list, thr_lock_type update,
1379
uint32_t lock_flags);
1380
Table *open_table(Session *session, TableList *table_list, bool *refresh, uint32_t flags);
1381
bool name_lock_locked_table(Session *session, TableList *tables);
1382
bool reopen_name_locked_table(Session* session, TableList* table_list, bool link_in);
1383
Table *table_cache_insert_placeholder(Session *session, const char *key,
1384
uint32_t key_length);
1385
bool lock_table_name_if_not_cached(Session *session, const char *db,
1386
const char *table_name, Table **table);
1387
Table *find_locked_table(Session *session, const char *db,const char *table_name);
1388
void detach_merge_children(Table *table, bool clear_refs);
1389
bool fix_merge_after_open(TableList *old_child_list, TableList **old_last,
1390
TableList *new_child_list, TableList **new_last);
1391
bool reopen_table(Table *table);
1392
bool reopen_tables(Session *session,bool get_locks,bool in_refresh);
1393
void close_data_files_and_morph_locks(Session *session, const char *db,
1394
const char *table_name);
1395
void close_handle_and_leave_table_as_lock(Table *table);
1396
bool open_new_frm(Session *session, TABLE_SHARE *share, const char *alias,
1397
uint32_t db_stat, uint32_t prgflag,
1398
uint32_t ha_open_flags, Table *outparam,
1399
TableList *table_desc, MEM_ROOT *mem_root);
1400
bool wait_for_tables(Session *session);
1401
bool table_is_used(Table *table, bool wait_for_name_lock);
1402
Table *drop_locked_tables(Session *session,const char *db, const char *table_name);
1403
void abort_locked_tables(Session *session,const char *db, const char *table_name);
1404
void execute_init_command(Session *session, sys_var_str *init_command_var,
1405
rw_lock_t *var_mutex);
1406
extern Field *not_found_field;
1407
extern Field *view_ref_found;
1409
enum find_item_error_report_type {REPORT_ALL_ERRORS, REPORT_EXCEPT_NOT_FOUND,
1410
IGNORE_ERRORS, REPORT_EXCEPT_NON_UNIQUE,
1411
IGNORE_EXCEPT_NON_UNIQUE};
1413
find_field_in_tables(Session *session, Item_ident *item,
1414
TableList *first_table, TableList *last_table,
1415
Item **ref, find_item_error_report_type report_error,
1416
bool check_privileges, bool register_tree_change);
1418
find_field_in_table_ref(Session *session, TableList *table_list,
1419
const char *name, uint32_t length,
1420
const char *item_name, const char *db_name,
1421
const char *table_name, Item **ref,
1422
bool check_privileges, bool allow_rowid,
1423
uint32_t *cached_field_index_ptr,
1424
bool register_tree_change, TableList **actual_table);
1426
find_field_in_table(Session *session, Table *table, const char *name, uint32_t length,
1427
bool allow_rowid, uint32_t *cached_field_index_ptr);
1429
find_field_in_table_sef(Table *table, const char *name);
1430
int update_virtual_fields_marked_for_write(Table *table,
1431
bool ignore_stored=true);
1271
1434
#endif /* DRIZZLED_HANDLER_H */