~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/definitions.h

  • Committer: Diego Medina
  • Date: 2009-10-05 04:05:29 UTC
  • mfrom: (1161 staging)
  • mto: This revision was merged to the branch mainline in revision 1178.
  • Revision ID: diego.medina@sun.com-20091005040529-5g1qe9gxzslpgefd
resolved small merge issue

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 * Mostly constants and some macros/functions used by the server
24
24
 */
25
25
 
26
 
#ifndef DRIZZLE_SERVER_DEFINITIONS_H
27
 
#define DRIZZLE_SERVER_DEFINITIONS_H
 
26
#ifndef DRIZZLED_DEFINITIONS_H
 
27
#define DRIZZLED_DEFINITIONS_H
28
28
 
29
29
#include <drizzled/enum.h>
30
30
 
329
329
typedef uint64_t query_id_t;
330
330
typedef void *range_seq_t;
331
331
 
 
332
enum ha_stat_type { HA_ENGINE_STATUS, HA_ENGINE_LOGS, HA_ENGINE_MUTEX };
332
333
// the following is for checking tables
333
334
 
334
335
#define HA_ADMIN_ALREADY_DONE     1
578
579
 * The following are for the interface with the .frm file
579
580
 */
580
581
 
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!
588
 
 
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
596
584
 
597
585
#define MTYP_TYPENR(type) (type & 127)  /* Remove bits from type */
598
586
 
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) & \
605
 
                                     FIELDFLAG_MAX_DEC))
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)) == \
609
 
                         FIELDFLAG_INTERVAL)
610
 
#define f_is_blob(x)    (((x) & (FIELDFLAG_BLOB | FIELDFLAG_NUMBER)) == \
611
 
                         FIELDFLAG_BLOB)
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)
617
 
 
618
 
#endif /* DRIZZLE_SERVER_DEFINITIONS_H */
619
 
 
 
589
 
 
590
#endif /* DRIZZLED_DEFINITIONS_H */