My Project
records.h
00001 #ifndef SQL_RECORDS_H
00002 #define SQL_RECORDS_H 
00003 /* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
00004 
00005    This program is free software; you can redistribute it and/or modify
00006    it under the terms of the GNU General Public License as published by
00007    the Free Software Foundation; version 2 of the License.
00008 
00009    This program is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012    GNU General Public License for more details.
00013 
00014    You should have received a copy of the GNU General Public License
00015    along with this program; if not, write to the Free Software Foundation,
00016    51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
00017 
00018 #include <my_global.h>                /* for uint typedefs */
00019 
00020 typedef struct st_join_table JOIN_TAB;
00021 class handler;
00022 struct TABLE;
00023 class THD;
00024 class SQL_SELECT;
00025 
00043 struct READ_RECORD
00044 {
00045   typedef int (*Read_func)(READ_RECORD*);
00046   typedef void (*Unlock_row_func)(st_join_table *);
00047   typedef int (*Setup_func)(JOIN_TAB*);
00048 
00049   TABLE *table;                                 /* Head-form */
00050   TABLE **forms;                                /* head and ref forms */
00051   Unlock_row_func unlock_row;
00052   Read_func read_record;
00053   THD *thd;
00054   SQL_SELECT *select;
00055   uint cache_records;
00056   uint ref_length,struct_length,reclength,rec_cache_size,error_offset;
00057   uint index;
00058   uchar *ref_pos;                               /* pointer to form->refpos */
00059   uchar *record;
00060   uchar *rec_buf;                /* to read field values  after filesort */
00061   uchar *cache,*cache_pos,*cache_end,*read_positions;
00062   struct st_io_cache *io_cache;
00063   bool print_error, ignore_not_found_rows;
00064 
00065 public:
00066   READ_RECORD() {}
00067 };
00068 
00069 bool init_read_record(READ_RECORD *info, THD *thd, TABLE *reg_form,
00070                       SQL_SELECT *select, int use_record_cache,
00071                       bool print_errors, bool disable_rr_cache);
00072 bool init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table,
00073                           bool print_error, uint idx, bool reverse);
00074 void end_read_record(READ_RECORD *info);
00075 
00076 void rr_unlock_row(st_join_table *tab);
00077 int rr_sequential(READ_RECORD *info);
00078 
00079 #endif /* SQL_RECORDS_H */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines