~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/heap/ha_heap.cc

Merged build changes from Antony.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#endif
20
20
 
21
21
#define MYSQL_SERVER 1
22
 
#include "mysql_priv.h"
23
 
#include <mysql/plugin.h>
 
22
#include <drizzled/mysql_priv.h>
24
23
#include "ha_heap.h"
25
24
#include "heapdef.h"
26
25
 
28
27
                                    TABLE_SHARE *table, 
29
28
                                    MEM_ROOT *mem_root);
30
29
 
31
 
int heap_panic(handlerton *hton __attribute__((__unused__)),
32
 
               ha_panic_function flag)
 
30
int heap_deinit(void *p __attribute__((unused)))
 
31
            
33
32
{
34
 
  return hp_panic(flag);
 
33
  return hp_panic(HA_PANIC_CLOSE);
35
34
}
36
35
 
37
36
 
43
42
  heap_hton->state=      SHOW_OPTION_YES;
44
43
  heap_hton->db_type=    DB_TYPE_HEAP;
45
44
  heap_hton->create=     heap_create_handler;
46
 
  heap_hton->panic=      heap_panic;
47
45
  heap_hton->flags=      HTON_CAN_RECREATE;
48
46
 
49
47
  return 0;
95
93
  {
96
94
    HA_CREATE_INFO create_info;
97
95
    internal_table= test(test_if_locked & HA_OPEN_INTERNAL_TABLE);
98
 
    bzero(&create_info, sizeof(create_info));
 
96
    memset(&create_info, 0, sizeof(create_info));
99
97
    file= 0;
100
98
    if (!create(name, table, &create_info))
101
99
    {
356
354
  int error;
357
355
  HEAP_PTR heap_position;
358
356
  ha_statistic_increment(&SSV::ha_read_rnd_count);
359
 
  memcpy_fixed((char*) &heap_position, pos, sizeof(HEAP_PTR));
 
357
  memcpy((char*) &heap_position, pos, sizeof(HEAP_PTR));
360
358
  error=heap_rrnd(file, buf, heap_position);
361
359
  table->status=error ? STATUS_NOT_FOUND: 0;
362
360
  return error;
363
361
}
364
362
 
365
 
void ha_heap::position(const uchar *record __attribute__((__unused__)))
 
363
void ha_heap::position(const uchar *record __attribute__((unused)))
366
364
{
367
365
  *(HEAP_PTR*) ref= heap_position(file);        // Ref is aligned
368
366
}
419
417
  return 0;
420
418
}
421
419
 
422
 
int ha_heap::external_lock(THD *thd __attribute__((__unused__)),
423
 
                           int lock_type __attribute__((__unused__)))
 
420
int ha_heap::external_lock(THD *thd __attribute__((unused)),
 
421
                           int lock_type __attribute__((unused)))
424
422
{
425
423
  return 0;                                     // No external locking
426
424
}
533
531
  return heap_indexes_are_disabled(file);
534
532
}
535
533
 
536
 
THR_LOCK_DATA **ha_heap::store_lock(THD *thd __attribute__((__unused__)),
 
534
THR_LOCK_DATA **ha_heap::store_lock(THD *thd __attribute__((unused)),
537
535
                                    THR_LOCK_DATA **to,
538
536
                                    enum thr_lock_type lock_type)
539
537
{
555
553
}
556
554
 
557
555
 
558
 
void ha_heap::drop_table(const char *name __attribute__((__unused__)))
 
556
void ha_heap::drop_table(const char *name __attribute__((unused)))
559
557
{
560
558
  file->s->delete_on_close= 1;
561
559
  close();
717
715
    create_info->auto_increment_value= stats.auto_increment_value;
718
716
}
719
717
 
720
 
void ha_heap::get_auto_increment(uint64_t offset __attribute__((__unused__)),
721
 
                                 uint64_t increment __attribute__((__unused__)),
722
 
                                 uint64_t nb_desired_values __attribute__((__unused__)),
 
718
void ha_heap::get_auto_increment(uint64_t offset __attribute__((unused)),
 
719
                                 uint64_t increment __attribute__((unused)),
 
720
                                 uint64_t nb_desired_values __attribute__((unused)),
723
721
                                 uint64_t *first_value,
724
722
                                 uint64_t *nb_reserved_values)
725
723
{
751
749
  "Hash based, stored in memory, useful for temporary tables",
752
750
  PLUGIN_LICENSE_GPL,
753
751
  heap_init,
754
 
  NULL,
 
752
  heap_deinit,
755
753
  NULL,                       /* status variables                */
756
754
  NULL,                       /* system variables                */
757
755
  NULL                        /* config options                  */