00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #pragma once
00021
00022 namespace drizzled
00023 {
00024
00025 class Field_blob;
00026 typedef JoinTable JoinTable;
00027
00032 class CacheField {
00033
00034
00035
00036
00037 public:
00038 unsigned char *str;
00039 uint32_t length;
00040 uint32_t blob_length;
00041 Field_blob *blob_field;
00042 bool strip;
00043 Table *get_rowid;
00044
00045 CacheField():
00046 str(NULL),
00047 length(0),
00048 blob_length(0),
00049 blob_field(NULL),
00050 strip(false),
00051 get_rowid(NULL)
00052 {}
00053
00054 };
00055
00056 class JoinCache
00057 {
00058 public:
00059 unsigned char *buff;
00060 unsigned char *pos;
00061 unsigned char *end;
00062 uint32_t records;
00063 uint32_t record_nr;
00064 uint32_t ptr_record;
00065
00066
00067
00068
00069
00070
00071
00072 uint32_t fields;
00073 uint32_t length;
00074 uint32_t blobs;
00075 CacheField *field;
00076 CacheField **blob_ptr;
00077 optimizer::SqlSelect *select;
00078
00079 JoinCache():
00080 buff(NULL),
00081 pos(NULL),
00082 end(NULL),
00083 records(0),
00084 record_nr(0),
00085 ptr_record(0),
00086 fields(0),
00087 length(0),
00088 blobs(0),
00089 field(NULL),
00090 blob_ptr(NULL),
00091 select(NULL)
00092 {}
00093
00094 void reset_cache_read();
00095 void reset_cache_write();
00096 bool store_record_in_cache();
00097 };
00098
00099 int join_init_cache(Session *session, JoinTable *tables, uint32_t table_count);
00100
00101 }
00102