491
507
extern ulong server_id;
493
#include "sql_string.h"
509
#include <drizzled/sql_string.h>
494
510
#include "sql_list.h"
495
511
#include "sql_map.h"
496
512
#include "my_decimal.h"
497
513
#include "handler.h"
498
514
#include "table.h"
499
515
#include "sql_error.h"
501
/* Field definitions */
502
516
#include "field.h"
504
517
#include "protocol.h"
505
518
#include "sql_udf.h"
508
OPT_DEFAULT= 0, OPT_SESSION, OPT_GLOBAL
510
519
#include "item.h"
511
521
extern my_decimal decimal_zero;
514
void free_items(Item *item);
515
void cleanup_items(Item *item);
523
/** @TODO Find a good header to put this guy... */
517
524
void close_thread_tables(THD *thd);
519
bool multi_update_precheck(THD *thd, TABLE_LIST *tables);
520
bool multi_delete_precheck(THD *thd, TABLE_LIST *tables);
521
int mysql_multi_update_prepare(THD *thd);
522
int mysql_multi_delete_prepare(THD *thd);
523
bool mysql_insert_select_prepare(THD *thd);
524
bool update_precheck(THD *thd, TABLE_LIST *tables);
525
bool delete_precheck(THD *thd, TABLE_LIST *tables);
526
bool insert_precheck(THD *thd, TABLE_LIST *tables);
527
bool create_table_precheck(THD *thd, TABLE_LIST *tables,
528
TABLE_LIST *create_table);
529
int append_query_string(CHARSET_INFO *csinfo,
530
String const *from, String *to);
532
bool check_string_byte_length(LEX_STRING *str, const char *err_msg,
533
uint max_byte_length);
534
bool check_string_char_length(LEX_STRING *str, const char *err_msg,
535
uint max_char_length, CHARSET_INFO *cs,
537
bool check_identifier_name(LEX_STRING *str, uint max_char_length,
538
uint err_code, const char *param_for_err_msg);
539
inline bool check_identifier_name(LEX_STRING *str, uint err_code)
541
return check_identifier_name(str, NAME_CHAR_LEN, err_code, "");
543
inline bool check_identifier_name(LEX_STRING *str)
545
return check_identifier_name(str, NAME_CHAR_LEN, 0, "");
548
bool test_if_data_home_dir(const char *dir);
550
bool parse_sql(THD *thd,
551
class Lex_input_stream *lip,
552
class Object_creation_ctx *creation_ctx);
554
enum enum_mysql_completiontype {
555
ROLLBACK_RELEASE=-2, ROLLBACK=1, ROLLBACK_AND_CHAIN=7,
556
COMMIT_RELEASE=-1, COMMIT=0, COMMIT_AND_CHAIN=6
559
bool begin_trans(THD *thd);
560
bool end_active_trans(THD *thd);
561
int end_trans(THD *thd, enum enum_mysql_completiontype completion);
563
Item *negate_expression(THD *thd, Item *expr);
566
int vprint_msg_to_log(enum loglevel level, const char *format, va_list args);
567
void sql_print_error(const char *format, ...) __attribute__((format(printf, 1, 2)));
568
void sql_print_warning(const char *format, ...) __attribute__((format(printf, 1, 2)));
569
void sql_print_information(const char *format, ...)
570
__attribute__((format(printf, 1, 2)));
571
typedef void (*sql_print_message_func)(const char *format, ...)
572
__attribute__((format(printf, 1, 2)));
573
extern sql_print_message_func sql_print_message_handlers[];
575
int error_log_print(enum loglevel level, const char *format,
578
bool slow_log_print(THD *thd, const char *query, uint query_length,
579
uint64_t current_utime);
581
bool general_log_print(THD *thd, enum enum_server_command command,
582
const char *format,...);
584
bool general_log_write(THD *thd, enum enum_server_command command,
585
const char *query, uint query_length);
526
#include <drizzled/sql_parse.h>
587
528
#include "sql_class.h"
588
529
#include "slave.h" // for tables_ok(), rpl_filter