diff options
author | unknown <heikki@hundin.mysql.fi> | 2004-03-17 19:37:48 +0200 |
---|---|---|
committer | unknown <heikki@hundin.mysql.fi> | 2004-03-17 19:37:48 +0200 |
commit | 68273f0f84597c92a8b727f415564df87bcdb0a5 (patch) | |
tree | c5d75fedad7590ad42c86f32a245754a2a6e548e /innobase/include | |
parent | 8bdbfee96b876e48387cdc14d6b44a18d82a1043 (diff) | |
download | mariadb-git-68273f0f84597c92a8b727f415564df87bcdb0a5.tar.gz |
Many files:
Fix Bug #1942: do not retrieve all columns in a table if we only need the 'ref' of the row (usually, the PRIMARY KEY) to calculate an ORDER BY
innobase/dict/dict0dict.c:
Fix Bug #1942: do not retrieve all columns in a table if we only need the 'ref' of the row (usually, the PRIMARY KEY) to calculate an ORDER BY
innobase/include/dict0dict.h:
Fix Bug #1942: do not retrieve all columns in a table if we only need the 'ref' of the row (usually, the PRIMARY KEY) to calculate an ORDER BY
innobase/include/row0mysql.h:
Fix Bug #1942: do not retrieve all columns in a table if we only need the 'ref' of the row (usually, the PRIMARY KEY) to calculate an ORDER BY
sql/ha_innodb.cc:
Fix Bug #1942: do not retrieve all columns in a table if we only need the 'ref' of the row (usually, the PRIMARY KEY) to calculate an ORDER BY
sql/sql_select.cc:
Fix Bug #1942: do not retrieve all columns in a table if we only need the 'ref' of the row (usually, the PRIMARY KEY) to calculate an ORDER BY
include/my_base.h:
Fix Bug #1942: do not retrieve all columns in a table if we only need the 'ref' of the row (usually, the PRIMARY KEY) to calculate an ORDER BY
Diffstat (limited to 'innobase/include')
-rw-r--r-- | innobase/include/dict0dict.h | 11 | ||||
-rw-r--r-- | innobase/include/row0mysql.h | 21 |
2 files changed, 25 insertions, 7 deletions
diff --git a/innobase/include/dict0dict.h b/innobase/include/dict0dict.h index 534c9e380b8..688685cff8b 100644 --- a/innobase/include/dict0dict.h +++ b/innobase/include/dict0dict.h @@ -493,6 +493,17 @@ dict_table_get_sys_col_no( /* out: column number */ dict_table_t* table, /* in: table */ ulint sys); /* in: DATA_ROW_ID, ... */ +/************************************************************************ +Checks if a column is in the ordering columns of the clustered index of a +table. Column prefixes are treated like whole columns. */ + +ibool +dict_table_col_in_clustered_key( +/*============================*/ + /* out: TRUE if the column, or its prefix, is + in the clustered key */ + dict_table_t* table, /* in: table */ + ulint n); /* in: column number */ /*********************************************************************** Copies types of columns contained in table to tuple. */ diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h index fade3709631..32a0c8b5d75 100644 --- a/innobase/include/row0mysql.h +++ b/innobase/include/row0mysql.h @@ -510,13 +510,15 @@ struct row_prebuilt_struct { byte* ins_upd_rec_buff;/* buffer for storing data converted to the Innobase format from the MySQL format */ - ibool hint_no_need_to_fetch_extra_cols; - /* normally this is TRUE, but - MySQL will set this to FALSE - if we might be required to fetch also - other columns than mentioned in the - query: the clustered index column(s), - or an auto-increment column*/ + ulint hint_need_to_fetch_extra_cols; + /* normally this is set to 0; if this + is set to ROW_RETRIEVE_PRIMARY_KEY, + then we should at least retrieve all + columns in the primary key; if this + is set to ROW_RETRIEVE_ALL_COLS, then + we must retrieve all columns in the + key (if read_just_key == 1), or all + columns in the table */ upd_node_t* upd_node; /* Innobase SQL update node used to perform updates and deletes */ que_fork_t* ins_graph; /* Innobase SQL query graph used @@ -572,6 +574,11 @@ struct row_prebuilt_struct { #define ROW_MYSQL_DUMMY_TEMPLATE 3 /* dummy template used in row_scan_and_check_index */ +/* Values for hint_need_to_fetch_extra_cols */ +#define ROW_RETRIEVE_PRIMARY_KEY 1 +#define ROW_RETRIEVE_ALL_COLS 2 + + #ifndef UNIV_NONINL #include "row0mysql.ic" #endif |