~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/mysql_priv.h

  • Committer: Jay Pipes
  • Date: 2008-08-01 04:24:45 UTC
  • mto: (264.1.6 codestyle)
  • mto: This revision was merged to the branch mainline in revision 247.
  • Revision ID: jay@mysql.com-20080801042445-1hrxlgfx4w7xe2x1
* Pulled the remainder of the log and parse stuff out into
  appropriate header files and cleaned up some of the enums...
* Builds and tests just fine

Show diffs side-by-side

added added

removed removed

Lines of Context:
438
438
 
439
439
enum enum_parsing_place
440
440
{
441
 
  NO_MATTER,
442
 
  IN_HAVING,
443
 
  SELECT_LIST,
444
 
  IN_WHERE,
445
 
  IN_ON
 
441
  NO_MATTER
 
442
  , IN_HAVING
 
443
  , SELECT_LIST
 
444
  , IN_WHERE
 
445
  , IN_ON
 
446
};
 
447
 
 
448
enum enum_mysql_completiontype {
 
449
  ROLLBACK_RELEASE= -2
 
450
  , ROLLBACK= 1
 
451
  , ROLLBACK_AND_CHAIN= 7
 
452
  , COMMIT_RELEASE= -1
 
453
  , COMMIT= 0
 
454
  , COMMIT_AND_CHAIN= 6
 
455
};
 
456
 
 
457
enum enum_check_fields
 
458
{
 
459
  CHECK_FIELD_IGNORE
 
460
  , CHECK_FIELD_WARN
 
461
  , CHECK_FIELD_ERROR_FOR_NULL
 
462
};
 
463
 
 
464
enum enum_var_type
 
465
{
 
466
  OPT_DEFAULT= 0
 
467
  , OPT_SESSION
 
468
  , OPT_GLOBAL
446
469
};
447
470
 
448
471
/* Forward declarations */
461
484
 
462
485
#define thd_proc_info(thd, msg)  set_thd_proc_info(thd, msg, __func__, __FILE__, __LINE__)
463
486
 
464
 
enum enum_check_fields
465
 
{
466
 
  CHECK_FIELD_IGNORE,
467
 
  CHECK_FIELD_WARN,
468
 
  CHECK_FIELD_ERROR_FOR_NULL
469
 
};
470
 
 
471
487
extern pthread_key(THD*, THR_THD);
472
488
inline THD *_current_thd(void)
473
489
{
490
506
*/
491
507
extern ulong server_id;
492
508
 
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"
500
 
 
501
 
/* Field definitions */
502
516
#include "field.h"
503
 
 
504
517
#include "protocol.h"
505
518
#include "sql_udf.h"
506
 
enum enum_var_type
507
 
{
508
 
  OPT_DEFAULT= 0, OPT_SESSION, OPT_GLOBAL
509
 
};
510
519
#include "item.h"
 
520
 
511
521
extern my_decimal decimal_zero;
512
522
 
513
 
/* sql_parse.cc */
514
 
void free_items(Item *item);
515
 
void cleanup_items(Item *item);
516
 
class THD;
 
523
/** @TODO Find a good header to put this guy... */
517
524
void close_thread_tables(THD *thd);
518
525
 
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);
531
 
 
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,
536
 
                              bool no_error);
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)
540
 
{
541
 
  return check_identifier_name(str, NAME_CHAR_LEN, err_code, "");
542
 
}
543
 
inline bool check_identifier_name(LEX_STRING *str)
544
 
{
545
 
  return check_identifier_name(str, NAME_CHAR_LEN, 0, "");
546
 
}
547
 
 
548
 
bool test_if_data_home_dir(const char *dir);
549
 
 
550
 
bool parse_sql(THD *thd,
551
 
               class Lex_input_stream *lip,
552
 
               class Object_creation_ctx *creation_ctx);
553
 
 
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
557
 
};
558
 
 
559
 
bool begin_trans(THD *thd);
560
 
bool end_active_trans(THD *thd);
561
 
int end_trans(THD *thd, enum enum_mysql_completiontype completion);
562
 
 
563
 
Item *negate_expression(THD *thd, Item *expr);
564
 
 
565
 
/* log.cc */
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[];
574
 
 
575
 
int error_log_print(enum loglevel level, const char *format,
576
 
                    va_list args);
577
 
 
578
 
bool slow_log_print(THD *thd, const char *query, uint query_length,
579
 
                    uint64_t current_utime);
580
 
 
581
 
bool general_log_print(THD *thd, enum enum_server_command command,
582
 
                       const char *format,...);
583
 
 
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>
586
527
 
587
528
#include "sql_class.h"
588
529
#include "slave.h" // for tables_ok(), rpl_filter