Drizzled Public API Documentation

filesort_info.h
00001 /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
00002  *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
00003  *
00004  *  Copyright (C) 2008 Sun Microsystems, Inc.
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; version 2 of the License.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018  */
00019 
00020 #include <drizzled/sql_sort.h>
00021 #pragma once
00022 
00023 
00024 namespace drizzled
00025 {
00026 
00027 /* Information on state of filesort */
00028 class filesort_info
00029 {
00030 public:
00031   internal::st_io_cache *io_cache;           /* If sorted through filesort */
00032   unsigned char     **sort_keys;        /* Buffer for sorting keys */
00033   unsigned char     *buffpek;           /* Buffer for buffpek structures */
00034   uint32_t      buffpek_len;        /* Max number of buffpeks in the buffer */
00035   unsigned char     *addon_buf;         /* Pointer to a buffer if sorted with fields */
00036   size_t    addon_length;       /* Length of the buffer */
00037   sort_addon_field *addon_field;     /* Pointer to the fields info */
00038   void    (*unpack)(sort_addon_field *, unsigned char *); /* To unpack back */
00039   unsigned char     *record_pointers;    /* If sorted in memory */
00040   ha_rows   found_records;      /* How many records in sort */
00041 
00042   filesort_info() :
00043     io_cache(0),
00044     sort_keys(0),
00045     buffpek(0),
00046     buffpek_len(0),
00047     addon_buf(0),
00048     addon_length(0),
00049     addon_field(0),
00050     unpack(0),
00051     record_pointers(0),
00052     found_records()
00053   { }
00054 
00055   filesort_info(const filesort_info& arg) :
00056     io_cache(arg.io_cache),
00057     sort_keys(arg.sort_keys),
00058     buffpek(arg.buffpek),
00059     buffpek_len(arg.buffpek_len),
00060     addon_buf(arg.addon_buf),
00061     addon_length(arg.addon_length),
00062     addon_field(arg.addon_field),
00063     unpack(arg.unpack),
00064     record_pointers(arg.record_pointers),
00065     found_records(arg.found_records)
00066   {
00067   }
00068 
00069   ~filesort_info()
00070   {
00071   }
00072 
00073 };
00074 
00075 } /* namespace drizzled */
00076