~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/base.h

  • Committer: Lee Bieber
  • Date: 2011-03-29 22:31:41 UTC
  • mfrom: (2257.1.3 build)
  • Revision ID: kalebral@gmail.com-20110329223141-yxc22h3l2he58sk0
Merge Andrew - 743842: Build failure using GCC 4.6
Merge Stewart - 738022: CachedDirectory silently fails to add entries if stat() fails
Merge Olaf - Common fwd: add copyright, add more declaration

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"
 
28
#include <drizzled/definitions.h>
29
29
 
30
 
#ifndef DRIZZLED_BASE_H
31
 
#define DRIZZLED_BASE_H
 
30
#pragma once
32
31
 
33
32
namespace drizzled
34
33
{
87
86
  HA_KEY_ALG_HASH=      3               /* HASH keys (HEAP tables) */
88
87
};
89
88
 
90
 
        /* Index and table build methods */
91
 
 
92
 
enum ha_build_method {
93
 
  HA_BUILD_DEFAULT,
94
 
  HA_BUILD_ONLINE,
95
 
  HA_BUILD_OFFLINE
96
 
};
97
 
 
98
89
        /* The following is parameter to ha_extra() */
99
90
 
100
91
enum ha_extra_function {
308
299
*/
309
300
#define HA_ERR_FIRST            120     /* Copy of first error nr.*/
310
301
 
311
 
#define HA_ERR_KEY_NOT_FOUND    120     /* Didn't find key on read or update */
312
 
#define HA_ERR_FOUND_DUPP_KEY   121     /* Dupplicate key on write */
313
 
#define HA_ERR_INTERNAL_ERROR   122     /* Internal error */
314
 
#define HA_ERR_RECORD_CHANGED   123     /* Uppdate with is recoverable */
315
 
#define HA_ERR_WRONG_INDEX      124     /* Wrong index given to function */
316
 
#define HA_ERR_CRASHED          126     /* Indexfile is crashed */
317
 
#define HA_ERR_WRONG_IN_RECORD  127     /* Record-file is crashed */
318
 
#define HA_ERR_OUT_OF_MEM       128     /* Record-file is crashed */
319
 
#define HA_ERR_NOT_A_TABLE      130     /* not a MYI file - no signature */
320
 
#define HA_ERR_WRONG_COMMAND    131     /* Command not supported */
321
 
#define HA_ERR_OLD_FILE         132     /* old databasfile */
322
 
#define HA_ERR_NO_ACTIVE_RECORD 133     /* No record read in update() */
323
 
#define HA_ERR_RECORD_DELETED   134     /* A record is not there */
324
 
#define HA_ERR_RECORD_FILE_FULL 135     /* No more room in file */
325
 
#define HA_ERR_INDEX_FILE_FULL  136     /* No more room in file */
326
 
#define HA_ERR_END_OF_FILE      137     /* end in next/prev/first/last */
327
 
#define HA_ERR_UNSUPPORTED      138     /* unsupported extension used */
328
 
#define HA_ERR_TO_BIG_ROW       139     /* Too big row */
329
 
#define HA_WRONG_CREATE_OPTION  140     /* Wrong create option */
330
 
#define HA_ERR_FOUND_DUPP_UNIQUE 141    /* Dupplicate unique on write */
331
 
#define HA_ERR_UNKNOWN_CHARSET   142    /* Can't open charset */
332
 
#define HA_ERR_WRONG_MRG_TABLE_DEF 143  /* conflicting tables in MERGE */
333
 
#define HA_ERR_CRASHED_ON_REPAIR 144    /* Last (automatic?) repair failed */
334
 
#define HA_ERR_CRASHED_ON_USAGE  145    /* Table must be repaired */
335
 
#define HA_ERR_LOCK_WAIT_TIMEOUT 146
336
 
#define HA_ERR_LOCK_TABLE_FULL   147
337
 
#define HA_ERR_READ_ONLY_TRANSACTION 148 /* Updates not allowed */
338
 
#define HA_ERR_LOCK_DEADLOCK     149
339
 
#define HA_ERR_CANNOT_ADD_FOREIGN 150    /* Cannot add a foreign key constr. */
340
 
#define HA_ERR_NO_REFERENCED_ROW 151     /* Cannot add a child row */
341
 
#define HA_ERR_ROW_IS_REFERENCED 152     /* Cannot delete a parent row */
342
 
#define HA_ERR_NO_SAVEPOINT      153     /* No savepoint with that name */
343
 
#define HA_ERR_NON_UNIQUE_BLOCK_SIZE 154 /* Non unique key block size */
344
 
#define HA_ERR_NO_SUCH_TABLE     155  /* The table does not exist in engine */
345
 
#define HA_ERR_TABLE_EXIST       156  /* The table existed in storage engine */
346
 
#define HA_ERR_NO_CONNECTION     157  /* Could not connect to storage engine */
347
 
/* NULLs are not supported in spatial index */
348
 
#define HA_ERR_NULL_IN_SPATIAL   158
349
 
#define HA_ERR_TABLE_DEF_CHANGED 159  /* The table changed in storage engine */
350
 
/* There's no partition in table for given value */
351
 
#define HA_ERR_NO_PARTITION_FOUND 160
352
 
#define HA_ERR_RBR_LOGGING_FAILED 161  /* Row-based binlogging of row failed */
353
 
#define HA_ERR_DROP_INDEX_FK      162  /* Index needed in foreign key constr */
354
 
/*
355
 
  Upholding foreign key constraints would lead to a duplicate key error
356
 
  in some other table.
357
 
*/
358
 
#define HA_ERR_FOREIGN_DUPLICATE_KEY 163
359
 
/* The table changed in storage engine */
360
 
#define HA_ERR_TABLE_NEEDS_UPGRADE 164
361
 
#define HA_ERR_TABLE_READONLY      165   /* The table is not writable */
362
 
 
363
 
#define HA_ERR_AUTOINC_READ_FAILED 166   /* Failed to get next autoinc value */
364
 
#define HA_ERR_AUTOINC_ERANGE    167     /* Failed to set row autoinc value */
365
 
#define HA_ERR_GENERIC           168     /* Generic error */
366
 
/* row not actually updated: new values same as the old values */
367
 
#define HA_ERR_RECORD_IS_THE_SAME 169
368
 
/* It is not possible to log this statement */
369
 
#define HA_ERR_LOGGING_IMPOSSIBLE 170    /* It is not possible to log this
370
 
                                            statement */
371
 
#define HA_ERR_TABLESPACE_EXIST   171
372
 
#define HA_ERR_CORRUPT_EVENT      172    /* The event was corrupt, leading to
373
 
                                            illegal data being read */
374
 
#define HA_ERR_NEW_FILE           173    /* New file format */
375
 
#define HA_ERR_ROWS_EVENT_APPLY   174    /* The event could not be processed
376
 
                                            no other hanlder error happened */
377
 
#define HA_ERR_INITIALIZATION     175    /* Error during initialization */
378
 
#define HA_ERR_FILE_TOO_SHORT     176    /* File too short */
379
 
#define HA_ERR_WRONG_CRC          177    /* Wrong CRC on page */
380
 
#define HA_ERR_LOCK_OR_ACTIVE_TRANSACTION 178
381
 
#define HA_ERR_NO_SUCH_TABLESPACE 179
382
 
#define HA_ERR_TABLESPACE_NOT_EMPTY 180
383
 
#define HA_ERR_LAST               180    /* Copy of last error nr */
384
 
 
385
 
/* Number of different errors */
386
 
#define HA_ERR_ERRORS            (HA_ERR_LAST - HA_ERR_FIRST + 1)
387
 
 
388
 
        /* Other constants */
 
302
/* Other constants */
389
303
 
390
304
typedef unsigned long key_part_map;
391
305
#define HA_WHOLE_KEY  (~(key_part_map)0)
496
410
 
497
411
/* For number of records */
498
412
typedef uint64_t        ha_rows;
499
 
inline static double rows2double(ha_rows rows)
500
 
{  
501
 
  return uint64_t2double(rows);
502
 
}
503
413
 
504
414
#define HA_POS_ERROR    (~ (::drizzled::ha_rows) 0)
505
415
#define HA_OFFSET_ERROR (~ (::drizzled::internal::my_off_t) 0)
518
428
 
519
429
} /* namespace drizzled */
520
430
 
521
 
#endif /* DRIZZLED_BASE_H */