~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/join_cache.h

  • Committer: Jay Pipes
  • Date: 2010-03-09 20:02:29 UTC
  • mto: This revision was merged to the branch mainline in revision 1339.
  • Revision ID: jpipes@serialcoder-20100309200229-dfrliy4fads9vyf4
Fixes Bug #535296 by only incrementing ha_commit_count when its a normal transaction commit.

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
27
27
typedef JoinTable JoinTable;
28
28
 
29
29
/**
30
 
  CacheField and JoinCache is used on full join to cache records in outer
 
30
  CACHE_FIELD and JOIN_CACHE is used on full join to cache records in outer
31
31
  table
32
32
*/
33
 
class CacheField {
 
33
typedef struct st_cache_field {
34
34
  /*
35
35
    Where source data is located (i.e. this points to somewhere in
36
 
    tableX->getInsertRecord())
 
36
    tableX->record[0])
37
37
  */
38
 
public:
39
38
  unsigned char *str;
40
39
  uint32_t length; /* Length of data at *str, in bytes */
41
40
  uint32_t blob_length; /* Valid IFF blob_field != 0 */
42
41
  Field_blob *blob_field;
43
42
  bool strip; /* true <=> Strip endspaces ?? */
 
43
 
44
44
  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
 
45
} CACHE_FIELD;
 
46
 
 
47
typedef struct st_join_cache
58
48
{
59
 
public:
60
49
  unsigned char *buff;
61
50
  unsigned char *pos;    /* Start of free space in the buffer */
62
51
  unsigned char *end;
73
62
  uint32_t fields;
74
63
  uint32_t length;
75
64
  uint32_t blobs;
76
 
  CacheField *field;
77
 
  CacheField **blob_ptr;
 
65
  CACHE_FIELD *field;
 
66
  CACHE_FIELD **blob_ptr;
78
67
  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
 
};
 
68
} JOIN_CACHE;
99
69
 
100
70
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);
101
74
 
102
75
} /* namespace drizzled */
103
76