1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2010 Brian Aker
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
This is a "work in progress". The concept needs to be replicated throughout
23
the code, but we will start with baby steps for the moment. To not incur
24
cost until we are complete, for the moment it will do no allocation.
26
This is mainly here so that it can be used in the SE interface for
29
This will replace Table_ident.
32
#ifndef DRIZZLED_FILESORT_H
33
#define DRIZZLED_FILESORT_H
48
uint32_t sortlength(SortField *sortorder, uint32_t s_length, bool *multi_byte_charset);
49
sort_addon_field *get_addon_fields(Field **ptabfield, uint32_t sortlength, uint32_t *plength);
50
ha_rows find_all_keys(SORTPARAM *param,
51
optimizer::SqlSelect *select,
52
unsigned char **sort_keys,
53
internal::IO_CACHE *buffpek_pointers,
54
internal::IO_CACHE *tempfile, internal::IO_CACHE *indexfile);
56
int merge_buffers(SORTPARAM *param,internal::IO_CACHE *from_file,
57
internal::IO_CACHE *to_file, unsigned char *sort_buffer,
60
buffpek *Tb,int flag);
62
int merge_index(SORTPARAM *param,
63
unsigned char *sort_buffer,
66
internal::IO_CACHE *tempfile,
67
internal::IO_CACHE *outfile);
69
int merge_many_buff(SORTPARAM *param, unsigned char *sort_buffer,
71
uint32_t *maxbuffer, internal::IO_CACHE *t_file);
73
uint32_t read_to_buffer(internal::IO_CACHE *fromfile, buffpek *buffpek,
74
uint32_t sort_length);
80
FileSort(Session &arg);
87
ha_rows run(Table *table, SortField *sortorder, uint32_t s_length,
88
optimizer::SqlSelect *select, ha_rows max_rows,
89
bool sort_positions, ha_rows *examined_rows);
93
} /* namespace drizzled */
95
#endif /* DRIZZLED_FILESORT_H */