23
23
* Mostly constants and some macros/functions used by the server
26
#ifndef DRIZZLE_SERVER_DEFINITIONS_H
27
#define DRIZZLE_SERVER_DEFINITIONS_H
26
#ifndef DRIZZLED_DEFINITIONS_H
27
#define DRIZZLED_DEFINITIONS_H
29
29
#include <drizzled/enum.h>
329
329
typedef uint64_t query_id_t;
330
330
typedef void *range_seq_t;
332
enum ha_stat_type { HA_ENGINE_STATUS, HA_ENGINE_LOGS, HA_ENGINE_MUTEX };
332
333
// the following is for checking tables
334
335
#define HA_ADMIN_ALREADY_DONE 1
578
579
* The following are for the interface with the .frm file
581
#define FIELDFLAG_DECIMAL 1
582
#define FIELDFLAG_BINARY 1 // Shares same flag
583
#define FIELDFLAG_NUMBER 2
584
#define FIELDFLAG_DECIMAL_POSITION 4
585
#define FIELDFLAG_PACK 120 // Bits used for packing
586
#define FIELDFLAG_INTERVAL 256 // mangled with decimals!
587
#define FIELDFLAG_BLOB 1024 // mangled with decimals!
589
#define FIELDFLAG_NO_DEFAULT 16384 /* sql */
590
#define FIELDFLAG_SUM ((uint32_t) 32768)// predit: +#fieldflag
591
#define FIELDFLAG_MAYBE_NULL ((uint32_t) 32768)// sql
592
#define FIELDFLAG_HEX_ESCAPE ((uint32_t) 0x10000)
593
582
#define FIELDFLAG_PACK_SHIFT 3
594
#define FIELDFLAG_DEC_SHIFT 8
595
583
#define FIELDFLAG_MAX_DEC 31
597
585
#define MTYP_TYPENR(type) (type & 127) /* Remove bits from type */
599
#define f_is_dec(x) ((x) & FIELDFLAG_DECIMAL)
600
#define f_is_num(x) ((x) & FIELDFLAG_NUMBER)
601
#define f_is_decimal_precision(x) ((x) & FIELDFLAG_DECIMAL_POSITION)
602
#define f_is_packed(x) ((x) & FIELDFLAG_PACK)
603
587
#define f_packtype(x) (((x) >> FIELDFLAG_PACK_SHIFT) & 15)
604
#define f_decimals(x) ((uint8_t) (((x) >> FIELDFLAG_DEC_SHIFT) & \
606
#define f_is_alpha(x) (!f_is_num(x))
607
#define f_is_binary(x) ((x) & FIELDFLAG_BINARY) // 4.0- compatibility
608
#define f_is_enum(x) (((x) & (FIELDFLAG_INTERVAL | FIELDFLAG_NUMBER)) == \
610
#define f_is_blob(x) (((x) & (FIELDFLAG_BLOB | FIELDFLAG_NUMBER)) == \
612
#define f_is_equ(x) ((x) & (1+2+FIELDFLAG_PACK+31*256))
613
588
#define f_settype(x) (((int) x) << FIELDFLAG_PACK_SHIFT)
614
#define f_maybe_null(x) (x & FIELDFLAG_MAYBE_NULL)
615
#define f_no_default(x) (x & FIELDFLAG_NO_DEFAULT)
616
#define f_is_hex_escape(x) ((x) & FIELDFLAG_HEX_ESCAPE)
618
#endif /* DRIZZLE_SERVER_DEFINITIONS_H */
590
#endif /* DRIZZLED_DEFINITIONS_H */