summaryrefslogtreecommitdiff
path: root/sql/sql_sort.h
diff options
context:
space:
mode:
authorunknown <igor@hundin.mysql.fi>2003-04-24 14:33:33 +0300
committerunknown <igor@hundin.mysql.fi>2003-04-24 14:33:33 +0300
commita7f8b1cb4d5c36f55fffa09ce8b84a1741aeb9f0 (patch)
tree6de7abb070ee2d000b388d96503497e5aed12979 /sql/sql_sort.h
parent1db8654191c18def869c03d246e75be704411d03 (diff)
downloadmariadb-git-a7f8b1cb4d5c36f55fffa09ce8b84a1741aeb9f0.tar.gz
Many files:
Added the MAX_LENGTH_FOR_SORT_DATA option filesort.cc: Added the MAX_LENGTH_FOR_SORT_DATA option sql/filesort.cc: Added the MAX_LENGTH_FOR_SORT_DATA option sql/mysqld.cc: Added the MAX_LENGTH_FOR_SORT_DATA option sql/opt_range.cc: Added the MAX_LENGTH_FOR_SORT_DATA option sql/records.cc: Added the MAX_LENGTH_FOR_SORT_DATA option sql/set_var.cc: Added the MAX_LENGTH_FOR_SORT_DATA option sql/sql_base.cc: Added the MAX_LENGTH_FOR_SORT_DATA option sql/sql_class.h: Added the MAX_LENGTH_FOR_SORT_DATA option sql/sql_delete.cc: Added the MAX_LENGTH_FOR_SORT_DATA option sql/sql_select.cc: Added the MAX_LENGTH_FOR_SORT_DATA option sql/sql_sort.h: Added the MAX_LENGTH_FOR_SORT_DATA option sql/sql_table.cc: Added the MAX_LENGTH_FOR_SORT_DATA option sql/sql_update.cc: Added the MAX_LENGTH_FOR_SORT_DATA option sql/structs.h: Added the MAX_LENGTH_FOR_SORT_DATA option sql/table.h: Added the MAX_LENGTH_FOR_SORT_DATA option sql/uniques.cc: Added the MAX_LENGTH_FOR_SORT_DATA option
Diffstat (limited to 'sql/sql_sort.h')
-rw-r--r--sql/sql_sort.h33
1 files changed, 30 insertions, 3 deletions
diff --git a/sql/sql_sort.h b/sql/sql_sort.h
index 14463a67a28..9f95ffa4884 100644
--- a/sql/sql_sort.h
+++ b/sql/sql_sort.h
@@ -19,6 +19,30 @@
#define MERGEBUFF 7
#define MERGEBUFF2 15
+/*
+ The structure SORT_ADDON_FIELD describes a fixed layout
+ for field values appended to sorted values in records to be sorted
+ in the sort buffer.
+ Only fixed layout is supported now.
+ Null bit maps for the appended values is placed before the values
+ themselves. Offsets are from the last sorted field, that is from the
+ record referefence, which is still last component of sorted records.
+ It is preserved for backward compatiblility.
+ The structure is used tp store values of the additional fields
+ in the sort buffer. It is used also when these values are read
+ from a temporary file/buffer. As the reading procedures are beyond the
+ scope of the 'filesort' code the values have to be retrieved via
+ the callback function 'unpack_addon_fields'.
+*/
+
+typedef struct st_sort_addon_field { /* Sort addon packed field */
+ Field *field; /* Original field */
+ uint offset; /* Offset from the last sorted field */
+ uint null_offset; /* Offset to to null bit from the last sorted field */
+ uint length; /* Length in the sort buffer */
+ uint8 null_bit; /* Null bit mask for the field */
+} SORT_ADDON_FIELD;
+
typedef struct st_buffpek { /* Struktur om sorteringsbuffrarna */
my_off_t file_pos; /* Where we are in the sort file */
uchar *base,*key; /* key pointers */
@@ -27,15 +51,18 @@ typedef struct st_buffpek { /* Struktur om sorteringsbuffrarna */
ulong max_keys; /* Max keys in buffert */
} BUFFPEK;
-
typedef struct st_sort_param {
- uint sort_length; /* Length of sort columns */
- uint keys; /* Max keys / buffert */
+ uint rec_length; /* Length of sorted records */
+ uint sort_length; /* Length of sorted columns */
uint ref_length; /* Length of record ref. */
+ uint addon_length; /* Length of added packed fields */
+ uint res_length; /* Length of records in final sorted file/buffer */
+ uint keys; /* Max keys / buffer */
ha_rows max_rows,examined_rows;
TABLE *sort_form; /* For quicker make_sortkey */
SORT_FIELD *local_sortorder;
SORT_FIELD *end;
+ SORT_ADDON_FIELD *addon_field; /* Descriptors for companion fields */
uchar *unique_buff;
bool not_killable;
char* tmp_buffer;