~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/join_cache.h

  • Committer: Brian Aker
  • Date: 2010-12-02 05:20:13 UTC
  • mto: This revision was merged to the branch mainline in revision 1968.
  • Revision ID: brian@tangent.org-20101202052013-idifz62qat1ayhsn
Style change around session list.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
typedef JoinTable JoinTable;
28
28
 
29
29
/**
30
 
  CACHE_FIELD and JOIN_CACHE is used on full join to cache records in outer
 
30
  CacheField and JoinCache is used on full join to cache records in outer
31
31
  table
32
32
*/
33
 
typedef struct st_cache_field {
 
33
class CacheField {
34
34
  /*
35
35
    Where source data is located (i.e. this points to somewhere in
36
 
    tableX->record[0])
 
36
    tableX->getInsertRecord())
37
37
  */
 
38
public:
38
39
  unsigned char *str;
39
40
  uint32_t length; /* Length of data at *str, in bytes */
40
41
  uint32_t blob_length; /* Valid IFF blob_field != 0 */
41
42
  Field_blob *blob_field;
42
43
  bool strip; /* true <=> Strip endspaces ?? */
43
 
 
44
44
  Table *get_rowid; /* _ != NULL <=> */
45
 
} CACHE_FIELD;
46
 
 
47
 
typedef struct st_join_cache
 
45
 
 
46
  CacheField():
 
47
    str(NULL),
 
48
    length(0),
 
49
    blob_length(0),
 
50
    blob_field(NULL),
 
51
    strip(false),
 
52
    get_rowid(NULL)
 
53
  {}
 
54
 
 
55
};
 
56
 
 
57
class JoinCache
48
58
{
 
59
public:
49
60
  unsigned char *buff;
50
61
  unsigned char *pos;    /* Start of free space in the buffer */
51
62
  unsigned char *end;
62
73
  uint32_t fields;
63
74
  uint32_t length;
64
75
  uint32_t blobs;
65
 
  CACHE_FIELD *field;
66
 
  CACHE_FIELD **blob_ptr;
 
76
  CacheField *field;
 
77
  CacheField **blob_ptr;
67
78
  optimizer::SqlSelect *select;
68
 
} JOIN_CACHE;
 
79
 
 
80
  JoinCache():
 
81
    buff(NULL),
 
82
    pos(NULL),
 
83
    end(NULL),
 
84
    records(0),
 
85
    record_nr(0),
 
86
    ptr_record(0),
 
87
    fields(0),
 
88
    length(0),
 
89
    blobs(0),
 
90
    field(NULL),
 
91
    blob_ptr(NULL),
 
92
    select(NULL)
 
93
  {}
 
94
 
 
95
  void reset_cache_read();
 
96
  void reset_cache_write();
 
97
  bool store_record_in_cache();
 
98
};
69
99
 
70
100
int join_init_cache(Session *session, JoinTable *tables, uint32_t table_count);
71
 
void reset_cache_read(JOIN_CACHE *cache);
72
 
void reset_cache_write(JOIN_CACHE *cache);
73
 
bool store_record_in_cache(JOIN_CACHE *cache);
74
101
 
75
102
} /* namespace drizzled */
76
103