189
199
HA_KEYTYPE_END=0,
190
200
HA_KEYTYPE_TEXT=1, /* Key is sorted as letters */
191
201
HA_KEYTYPE_BINARY=2, /* Key is sorted as unsigned chars */
202
HA_KEYTYPE_SHORT_INT=3,
192
203
HA_KEYTYPE_LONG_INT=4,
193
205
HA_KEYTYPE_DOUBLE=6,
206
HA_KEYTYPE_NUM=7, /* Not packed num with pre-space */
207
HA_KEYTYPE_USHORT_INT=8,
194
208
HA_KEYTYPE_ULONG_INT=9,
195
209
HA_KEYTYPE_LONGLONG=10,
196
210
HA_KEYTYPE_ULONGLONG=11,
212
HA_KEYTYPE_UINT24=13,
197
214
/* Varchar (0-255 bytes) with length packed with 1 byte */
198
215
HA_KEYTYPE_VARTEXT1=15, /* Key is sorted as letters */
199
216
HA_KEYTYPE_VARBINARY1=16, /* Key is sorted as unsigned chars */
200
217
/* Varchar (0-65535 bytes) with length packed with 2 bytes */
201
218
HA_KEYTYPE_VARTEXT2=17, /* Key is sorted as letters */
202
HA_KEYTYPE_VARBINARY2=18 /* Key is sorted as unsigned chars */
219
HA_KEYTYPE_VARBINARY2=18, /* Key is sorted as unsigned chars */
223
#define HA_MAX_KEYTYPE 31 /* Must be log2-1 */
205
225
/* These flags kan be OR:ed to key-flag */
207
227
#define HA_NOSAME 1 /* Set if not dupplicated records */
303
339
Errorcodes given by handler functions
305
optimizer::sum_query() assumes these codes are > 1
341
opt_sum_query() assumes these codes are > 1
306
342
Do not add error numbers before HA_ERR_FIRST.
307
343
If necessary to add lower numbers, change HA_ERR_FIRST accordingly.
309
345
#define HA_ERR_FIRST 120 /* Copy of first error nr.*/
311
/* Other constants */
313
typedef unsigned long key_part_map;
347
#define HA_ERR_KEY_NOT_FOUND 120 /* Didn't find key on read or update */
348
#define HA_ERR_FOUND_DUPP_KEY 121 /* Dupplicate key on write */
349
#define HA_ERR_INTERNAL_ERROR 122 /* Internal error */
350
#define HA_ERR_RECORD_CHANGED 123 /* Uppdate with is recoverable */
351
#define HA_ERR_WRONG_INDEX 124 /* Wrong index given to function */
352
#define HA_ERR_CRASHED 126 /* Indexfile is crashed */
353
#define HA_ERR_WRONG_IN_RECORD 127 /* Record-file is crashed */
354
#define HA_ERR_OUT_OF_MEM 128 /* Record-file is crashed */
355
#define HA_ERR_NOT_A_TABLE 130 /* not a MYI file - no signature */
356
#define HA_ERR_WRONG_COMMAND 131 /* Command not supported */
357
#define HA_ERR_OLD_FILE 132 /* old databasfile */
358
#define HA_ERR_NO_ACTIVE_RECORD 133 /* No record read in update() */
359
#define HA_ERR_RECORD_DELETED 134 /* A record is not there */
360
#define HA_ERR_RECORD_FILE_FULL 135 /* No more room in file */
361
#define HA_ERR_INDEX_FILE_FULL 136 /* No more room in file */
362
#define HA_ERR_END_OF_FILE 137 /* end in next/prev/first/last */
363
#define HA_ERR_UNSUPPORTED 138 /* unsupported extension used */
364
#define HA_ERR_TO_BIG_ROW 139 /* Too big row */
365
#define HA_WRONG_CREATE_OPTION 140 /* Wrong create option */
366
#define HA_ERR_FOUND_DUPP_UNIQUE 141 /* Dupplicate unique on write */
367
#define HA_ERR_UNKNOWN_CHARSET 142 /* Can't open charset */
368
#define HA_ERR_WRONG_MRG_TABLE_DEF 143 /* conflicting tables in MERGE */
369
#define HA_ERR_CRASHED_ON_REPAIR 144 /* Last (automatic?) repair failed */
370
#define HA_ERR_CRASHED_ON_USAGE 145 /* Table must be repaired */
371
#define HA_ERR_LOCK_WAIT_TIMEOUT 146
372
#define HA_ERR_LOCK_TABLE_FULL 147
373
#define HA_ERR_READ_ONLY_TRANSACTION 148 /* Updates not allowed */
374
#define HA_ERR_LOCK_DEADLOCK 149
375
#define HA_ERR_CANNOT_ADD_FOREIGN 150 /* Cannot add a foreign key constr. */
376
#define HA_ERR_NO_REFERENCED_ROW 151 /* Cannot add a child row */
377
#define HA_ERR_ROW_IS_REFERENCED 152 /* Cannot delete a parent row */
378
#define HA_ERR_NO_SAVEPOINT 153 /* No savepoint with that name */
379
#define HA_ERR_NON_UNIQUE_BLOCK_SIZE 154 /* Non unique key block size */
380
#define HA_ERR_NO_SUCH_TABLE 155 /* The table does not exist in engine */
381
#define HA_ERR_TABLE_EXIST 156 /* The table existed in storage engine */
382
#define HA_ERR_NO_CONNECTION 157 /* Could not connect to storage engine */
383
/* NULLs are not supported in spatial index */
384
#define HA_ERR_NULL_IN_SPATIAL 158
385
#define HA_ERR_TABLE_DEF_CHANGED 159 /* The table changed in storage engine */
386
/* There's no partition in table for given value */
387
#define HA_ERR_NO_PARTITION_FOUND 160
388
#define HA_ERR_RBR_LOGGING_FAILED 161 /* Row-based binlogging of row failed */
389
#define HA_ERR_DROP_INDEX_FK 162 /* Index needed in foreign key constr */
391
Upholding foreign key constraints would lead to a duplicate key error
394
#define HA_ERR_FOREIGN_DUPLICATE_KEY 163
395
/* The table changed in storage engine */
396
#define HA_ERR_TABLE_NEEDS_UPGRADE 164
397
#define HA_ERR_TABLE_READONLY 165 /* The table is not writable */
399
#define HA_ERR_AUTOINC_READ_FAILED 166 /* Failed to get next autoinc value */
400
#define HA_ERR_AUTOINC_ERANGE 167 /* Failed to set row autoinc value */
401
#define HA_ERR_GENERIC 168 /* Generic error */
402
/* row not actually updated: new values same as the old values */
403
#define HA_ERR_RECORD_IS_THE_SAME 169
404
/* It is not possible to log this statement */
405
#define HA_ERR_LOGGING_IMPOSSIBLE 170 /* It is not possible to log this
407
#define HA_ERR_TABLESPACE_EXIST 171
408
#define HA_ERR_CORRUPT_EVENT 172 /* The event was corrupt, leading to
409
illegal data being read */
410
#define HA_ERR_NEW_FILE 173 /* New file format */
411
#define HA_ERR_ROWS_EVENT_APPLY 174 /* The event could not be processed
412
no other hanlder error happened */
413
#define HA_ERR_INITIALIZATION 175 /* Error during initialization */
414
#define HA_ERR_FILE_TOO_SHORT 176 /* File too short */
415
#define HA_ERR_WRONG_CRC 177 /* Wrong CRC on page */
416
#define HA_ERR_LOCK_OR_ACTIVE_TRANSACTION 178
417
#define HA_ERR_NO_SUCH_TABLESPACE 179
418
#define HA_ERR_TABLESPACE_NOT_EMPTY 180
419
#define HA_ERR_LAST 180 /* Copy of last error nr */
421
/* Number of different errors */
422
#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)
424
/* Other constants */
426
#define HA_NAMELEN 64 /* Max length of saved filename */
427
#define NO_SUCH_KEY (~(uint32_t)0) /* used as a key no. */
429
typedef ulong key_part_map;
314
430
#define HA_WHOLE_KEY (~(key_part_map)0)
316
432
/* Intern constants in databases */
399
519
#define NULL_RANGE 64
521
typedef struct st_key_range
404
523
const unsigned char *key;
525
key_part_map keypart_map;
406
526
enum ha_rkey_function flag;
407
key_part_map keypart_map;
410
class KEY_MULTI_RANGE
529
typedef struct st_key_multi_range
413
531
key_range start_key;
414
532
key_range end_key;
415
533
char *ptr; /* Free to use by caller (ptr to row etc) */
416
534
uint32_t range_flag; /* key range flags see above */
420
538
/* For number of records */
421
539
typedef uint64_t ha_rows;
540
#define rows2double(A) uint64_t2double(A)
423
#define HA_POS_ERROR (~ (::drizzled::ha_rows) 0)
424
#define HA_OFFSET_ERROR (~ (::drizzled::internal::my_off_t) 0)
542
#define HA_POS_ERROR (~ (ha_rows) 0)
543
#define HA_OFFSET_ERROR (~ (my_off_t) 0)
426
545
#if SIZEOF_OFF_T == 4
427
546
#define MAX_FILE_SIZE INT32_MAX