~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/join_cache.h

  • Committer: Brian Aker
  • Date: 2009-08-17 01:44:23 UTC
  • mto: This revision was merged to the branch mainline in revision 1118.
  • Revision ID: brian@gaz-20090817014423-jxi2qonsumm8mndf
Remove SQL level reference for DELAY (just now done correctly by default in
engine).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2008 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
20
20
#ifndef DRIZZLED_JOIN_CACHE_H
21
21
#define DRIZZLED_JOIN_CACHE_H
22
22
 
23
 
namespace drizzled
24
 
{
 
23
#include "drizzled/server_includes.h"
25
24
 
26
25
class Field_blob;
27
26
typedef JoinTable JoinTable;
28
27
 
29
28
/**
30
 
  CacheField and JoinCache is used on full join to cache records in outer
 
29
  CACHE_FIELD and JOIN_CACHE is used on full join to cache records in outer
31
30
  table
32
31
*/
33
 
class CacheField {
 
32
typedef struct st_cache_field {
34
33
  /*
35
34
    Where source data is located (i.e. this points to somewhere in
36
 
    tableX->getInsertRecord())
 
35
    tableX->record[0])
37
36
  */
38
 
public:
39
37
  unsigned char *str;
40
38
  uint32_t length; /* Length of data at *str, in bytes */
41
39
  uint32_t blob_length; /* Valid IFF blob_field != 0 */
42
40
  Field_blob *blob_field;
43
41
  bool strip; /* true <=> Strip endspaces ?? */
 
42
 
44
43
  Table *get_rowid; /* _ != NULL <=> */
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
 
44
} CACHE_FIELD;
 
45
 
 
46
typedef struct st_join_cache
58
47
{
59
 
public:
60
48
  unsigned char *buff;
61
49
  unsigned char *pos;    /* Start of free space in the buffer */
62
50
  unsigned char *end;
73
61
  uint32_t fields;
74
62
  uint32_t length;
75
63
  uint32_t blobs;
76
 
  CacheField *field;
77
 
  CacheField **blob_ptr;
78
 
  optimizer::SqlSelect *select;
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
 
};
 
64
  CACHE_FIELD *field;
 
65
  CACHE_FIELD **blob_ptr;
 
66
  SQL_SELECT *select;
 
67
} JOIN_CACHE;
99
68
 
100
69
int join_init_cache(Session *session, JoinTable *tables, uint32_t table_count);
101
 
 
102
 
} /* namespace drizzled */
 
70
void reset_cache_read(JOIN_CACHE *cache);
 
71
void reset_cache_write(JOIN_CACHE *cache);
 
72
bool store_record_in_cache(JOIN_CACHE *cache);
103
73
 
104
74
#endif /* DRIZZLED_JOIN_CACHE_H */