71
71
static const std::string INFORMATION_SCHEMA_NAME("information_schema");
74
#define is_schema_db(X) \
75
!my_strcasecmp(system_charset_info, INFORMATION_SCHEMA_NAME.str, (X))
78
void print_where(COND *cond,const char *info, enum_query_type query_type);
79
void print_cached_tables(void);
80
void print_plan(JOIN* join,uint32_t idx, double record_count, double read_time,
81
double current_read_time, const char *info);
82
void print_keyuse_array(DYNAMIC_ARRAY *keyuse_array);
83
void dump_TableList_graph(SELECT_LEX *select_lex, TableList* tl);
84
void mysql_print_status();
87
bool init_errmessage(void);
88
File open_binlog(IO_CACHE *log, const char *log_file_name,
92
76
void refresh_status(Session *session);
259
240
extern pthread_t signal_thread;
261
DRIZZLE_LOCK *mysql_lock_tables(Session *session, Table **table, uint32_t count,
262
uint32_t flags, bool *need_reopen);
263
/* mysql_lock_tables() and open_table() flags bits */
264
#define DRIZZLE_LOCK_IGNORE_GLOBAL_READ_LOCK 0x0001
265
#define DRIZZLE_LOCK_IGNORE_FLUSH 0x0002
266
#define DRIZZLE_LOCK_NOTIFY_IF_NEED_REOPEN 0x0004
267
#define DRIZZLE_OPEN_TEMPORARY_ONLY 0x0008
268
#define DRIZZLE_LOCK_IGNORE_GLOBAL_READ_ONLY 0x0010
269
#define DRIZZLE_LOCK_PERF_SCHEMA 0x0020
271
void mysql_unlock_tables(Session *session, DRIZZLE_LOCK *sql_lock);
272
void mysql_unlock_read_tables(Session *session, DRIZZLE_LOCK *sql_lock);
273
void mysql_unlock_some_tables(Session *session, Table **table,uint32_t count);
274
void mysql_lock_remove(Session *session, DRIZZLE_LOCK *locked,Table *table,
276
void mysql_lock_abort(Session *session, Table *table, bool upgrade_lock);
277
void mysql_lock_downgrade_write(Session *session, Table *table,
278
thr_lock_type new_lock_type);
279
bool mysql_lock_abort_for_thread(Session *session, Table *table);
280
DRIZZLE_LOCK *mysql_lock_merge(DRIZZLE_LOCK *a,DRIZZLE_LOCK *b);
281
TableList *mysql_lock_have_duplicate(Session *session, TableList *needle,
282
TableList *haystack);
283
bool lock_global_read_lock(Session *session);
284
void unlock_global_read_lock(Session *session);
285
bool wait_if_global_read_lock(Session *session, bool abort_on_refresh,
287
void start_waiting_global_read_lock(Session *session);
288
bool make_global_read_lock_block_commit(Session *session);
289
bool set_protect_against_global_read_lock(void);
290
void unset_protect_against_global_read_lock(void);
291
void broadcast_refresh(void);
292
int try_transactional_lock(Session *session, TableList *table_list);
293
int check_transactional_lock(Session *session, TableList *table_list);
294
int set_handler_table_locks(Session *session, TableList *table_list,
297
/* Lock based on name */
298
int lock_and_wait_for_table_name(Session *session, TableList *table_list);
299
int lock_table_name(Session *session, TableList *table_list, bool check_in_use);
300
void unlock_table_name(Session *session, TableList *table_list);
301
bool wait_for_locked_table_names(Session *session, TableList *table_list);
302
bool lock_table_names(Session *session, TableList *table_list);
303
void unlock_table_names(Session *session, TableList *table_list,
304
TableList *last_table);
305
bool lock_table_names_exclusively(Session *session, TableList *table_list);
306
bool is_table_name_exclusively_locked_by_this_thread(Session *session,
307
TableList *table_list);
308
bool is_table_name_exclusively_locked_by_this_thread(Session *session, unsigned char *key,
312
/* old unireg functions */
314
void unireg_init(ulong options);
315
void unireg_end(void) __attribute__((noreturn));
316
bool mysql_create_frm(Session *session, const char *file_name,
317
const char *db, const char *table,
318
HA_CREATE_INFO *create_info,
319
List<Create_field> &create_field,
320
uint32_t key_count,KEY *key_info,handler *db_type);
321
int rea_create_table(Session *session, const char *path,
322
const char *db, const char *table_name,
323
HA_CREATE_INFO *create_info,
324
List<Create_field> &create_field,
325
uint32_t key_count,KEY *key_info,
327
int format_number(uint32_t inputflag,uint32_t max_length,char * pos,uint32_t length,
331
244
TABLE_SHARE *alloc_table_share(TableList *table_list, char *key,