~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table.h

  • Committer: Lee Bieber
  • Date: 2011-02-11 20:30:05 UTC
  • mfrom: (2157.1.3 build)
  • Revision ID: kalebral@gmail.com-20110211203005-757o1y2yf78dxzqr
Merge Stewart - 716848: drizzleimport displays wrong program_name
Merge Stewart - update README file
Merge Andrew and Joe - Exposes the InnoDB SYS_REPLICATION_LOG to data_dictionary so that it is fast and fixes many issues we have been having

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#include <string>
29
29
#include <boost/dynamic_bitset.hpp>
30
30
 
31
 
#include <drizzled/order.h>
32
 
#include <drizzled/filesort_info.h>
33
 
#include <drizzled/natural_join_column.h>
34
 
#include <drizzled/field_iterator.h>
35
 
#include <drizzled/cursor.h>
36
 
#include <drizzled/lex_string.h>
37
 
#include <drizzled/table/instance.h>
38
 
#include <drizzled/atomics.h>
39
 
#include <drizzled/query_id.h>
 
31
#include "drizzled/order.h"
 
32
#include "drizzled/filesort_info.h"
 
33
#include "drizzled/natural_join_column.h"
 
34
#include "drizzled/field_iterator.h"
 
35
#include "drizzled/cursor.h"
 
36
#include "drizzled/lex_string.h"
 
37
#include "drizzled/table_list.h"
 
38
#include "drizzled/table/instance.h"
 
39
#include "drizzled/atomics.h"
 
40
#include "drizzled/query_id.h"
40
41
 
41
 
#include <drizzled/visibility.h>
 
42
#include "drizzled/visibility.h"
42
43
 
43
44
namespace drizzled
44
45
{
45
46
 
46
 
class COND_EQUAL;
47
 
class Field_blob;
48
47
class Item;
49
48
class Item_subselect;
 
49
class Select_Lex_Unit;
 
50
class Select_Lex;
 
51
class COND_EQUAL;
50
52
class SecurityContext;
51
 
class Select_Lex;
52
 
class Select_Lex_Unit;
53
53
class TableList;
54
 
namespace field { class Epoch; }
55
 
namespace plugin { class StorageEngine; }
 
54
namespace field {
 
55
class Epoch;
 
56
}
 
57
class Field_blob;
 
58
 
 
59
extern uint64_t refresh_version;
56
60
 
57
61
typedef enum enum_table_category TABLE_CATEGORY;
58
62
typedef struct st_columndef MI_COLUMNDEF;
64
68
class DRIZZLED_API Table 
65
69
{
66
70
  Field **field; /**< Pointer to fields collection */
 
71
public:
67
72
 
68
 
public:
69
73
  Field **getFields() const
70
74
  {
71
75
    return field;
147
151
    return in_use;
148
152
  }
149
153
 
150
 
  unsigned char *getInsertRecord() const
 
154
  unsigned char *getInsertRecord()
151
155
  {
152
156
    return record[0];
153
157
  }
424
428
  inline bool isDatabaseLowByteFirst() const { return getShare()->db_low_byte_first; } /* Portable row format */
425
429
  inline bool isNameLock() const { return open_placeholder; }
426
430
 
427
 
  uint32_t index_flags(uint32_t idx) const;
 
431
  uint32_t index_flags(uint32_t idx) const
 
432
  {
 
433
    return getShare()->storage_engine->index_flags(getShare()->getKeyInfo(idx).algorithm);
 
434
  }
428
435
 
429
436
  inline plugin::StorageEngine *getEngine() const   /* table_type for handler */
430
437
  {
431
 
    return getShare()->getEngine();
 
438
    return getShare()->storage_engine;
432
439
  }
433
440
 
434
441
  Cursor &getCursor() const /* table_type for handler */
499
506
  }
500
507
 
501
508
  /* Both of the below should go away once we can move this bit to the field objects */
502
 
  inline bool isReadSet(uint32_t index) const
 
509
  inline bool isReadSet(uint32_t index)
503
510
  {
504
511
    return read_set->test(index);
505
512
  }
554
561
  {
555
562
    return db_stat || open_placeholder;
556
563
  }
557
 
 
558
564
  /*
559
565
    Is this instance of the table should be reopen or represents a name-lock?
560
566
  */
561
 
  bool needs_reopen_or_name_lock() const;
 
567
  inline bool needs_reopen_or_name_lock()
 
568
  { 
 
569
    return getShare()->getVersion() != refresh_version;
 
570
  }
562
571
 
563
572
  /**
564
573
    clean/setup table fields and map.
579
588
  void filesort_free_buffers(bool full= false);
580
589
  void intern_close_table();
581
590
 
582
 
  void print_error(int error, myf errflag) const;
 
591
  void print_error(int error, myf errflag)
 
592
  {
 
593
    getShare()->storage_engine->print_error(error, errflag, *this);
 
594
  }
583
595
 
584
596
  /**
585
597
    @return
586
598
    key if error because of duplicated keys
587
599
  */
588
 
  uint32_t get_dup_key(int error) const
 
600
  uint32_t get_dup_key(int error)
589
601
  {
590
602
    cursor->errkey  = (uint32_t) -1;
591
603
    if (error == HA_ERR_FOUND_DUPP_KEY || error == HA_ERR_FOREIGN_DUPLICATE_KEY ||
829
841
namespace optimizer { class SqlSelect; }
830
842
 
831
843
void change_double_for_sort(double nr,unsigned char *to);
 
844
double my_double_round(double value, int64_t dec, bool dec_unsigned,
 
845
                       bool truncate);
832
846
int get_quick_record(optimizer::SqlSelect *select);
833
847
 
834
848
void find_date(char *pos,uint32_t *vek,uint32_t flag);
839
853
 
840
854
DRIZZLED_API int rename_file_ext(const char * from,const char * to,const char * ext);
841
855
bool check_column_name(const char *name);
 
856
bool check_db_name(Session *session, identifier::Schema &schema);
842
857
bool check_table_name(const char *name, uint32_t length);
843
858
 
844
859
} /* namespace drizzled */
845
860
 
846
 
#include <drizzled/table/singular.h>
847
 
#include <drizzled/table/concurrent.h>
 
861
#include "drizzled/table/singular.h"
 
862
#include "drizzled/table/concurrent.h"
848
863
 
849
864
#endif /* DRIZZLED_TABLE_H */