~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to drizzled/base.h

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-11-12 12:26:01 UTC
  • mfrom: (1.1.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20101112122601-myppfj3tfmlkccuq
Tags: upstream-2010.11.03
ImportĀ upstreamĀ versionĀ 2010.11.03

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 * @TODO Convert HA_XXX defines into enums and/or bitmaps
26
26
 */
27
27
 
 
28
#include "definitions.h"
 
29
 
28
30
#ifndef DRIZZLED_BASE_H
29
31
#define DRIZZLED_BASE_H
30
32
 
192
194
  HA_KEYTYPE_ULONG_INT=9,
193
195
  HA_KEYTYPE_LONGLONG=10,
194
196
  HA_KEYTYPE_ULONGLONG=11,
195
 
  HA_KEYTYPE_UINT24=13,
196
197
  /* Varchar (0-255 bytes) with length packed with 1 byte */
197
198
  HA_KEYTYPE_VARTEXT1=15,               /* Key is sorted as letters */
198
199
  HA_KEYTYPE_VARBINARY1=16,             /* Key is sorted as unsigned chars */
474
475
*/
475
476
#define NULL_RANGE      64
476
477
 
477
 
typedef struct st_key_range
 
478
class key_range
478
479
{
 
480
public:
479
481
  const unsigned char *key;
480
482
  uint32_t length;
481
483
  enum ha_rkey_function flag;
482
484
  key_part_map keypart_map;
483
 
} key_range;
 
485
};
484
486
 
485
 
typedef struct st_key_multi_range
 
487
class KEY_MULTI_RANGE
486
488
{
 
489
public:
487
490
  key_range start_key;
488
491
  key_range end_key;
489
492
  char  *ptr;                 /* Free to use by caller (ptr to row etc) */
490
493
  uint32_t  range_flag;           /* key range flags see above */
491
 
} KEY_MULTI_RANGE;
 
494
};
492
495
 
493
496
 
494
497
/* For number of records */
495
498
typedef uint64_t        ha_rows;
496
 
#define rows2double(A)  uint64_t2double(A)
 
499
inline static double rows2double(ha_rows rows)
 
500
{  
 
501
  return uint64_t2double(rows);
 
502
}
497
503
 
498
504
#define HA_POS_ERROR    (~ (::drizzled::ha_rows) 0)
499
505
#define HA_OFFSET_ERROR (~ (::drizzled::internal::my_off_t) 0)
504
510
#define MAX_FILE_SIZE   INT64_MAX
505
511
#endif
506
512
 
507
 
#define HA_VARCHAR_PACKLENGTH(field_length) ((field_length) < 256 ? 1 :2)
 
513
inline static uint32_t ha_varchar_packlength(uint32_t field_length)
 
514
{
 
515
  return (field_length < 256 ? 1 :2);
 
516
}
 
517
 
508
518
 
509
519
} /* namespace drizzled */
510
520