mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 11:01:52 +01:00
Non-functional change: convert the switch in convert_search_mode_to_innobase()
to the InnoDB coding style.
This commit is contained in:
parent
eddb125877
commit
6c6208ac94
1 changed files with 39 additions and 32 deletions
|
@ -3976,38 +3976,45 @@ convert_search_mode_to_innobase(
|
||||||
enum ha_rkey_function find_flag)
|
enum ha_rkey_function find_flag)
|
||||||
{
|
{
|
||||||
switch (find_flag) {
|
switch (find_flag) {
|
||||||
case HA_READ_KEY_EXACT: return(PAGE_CUR_GE);
|
case HA_READ_KEY_EXACT:
|
||||||
/* the above does not require the index to be UNIQUE */
|
/* this does not require the index to be UNIQUE */
|
||||||
case HA_READ_KEY_OR_NEXT: return(PAGE_CUR_GE);
|
return(PAGE_CUR_GE);
|
||||||
case HA_READ_KEY_OR_PREV: return(PAGE_CUR_LE);
|
case HA_READ_KEY_OR_NEXT:
|
||||||
case HA_READ_AFTER_KEY: return(PAGE_CUR_G);
|
return(PAGE_CUR_GE);
|
||||||
case HA_READ_BEFORE_KEY: return(PAGE_CUR_L);
|
case HA_READ_KEY_OR_PREV:
|
||||||
case HA_READ_PREFIX: return(PAGE_CUR_GE);
|
return(PAGE_CUR_LE);
|
||||||
case HA_READ_PREFIX_LAST: return(PAGE_CUR_LE);
|
case HA_READ_AFTER_KEY:
|
||||||
case HA_READ_PREFIX_LAST_OR_PREV:return(PAGE_CUR_LE);
|
return(PAGE_CUR_G);
|
||||||
/* In MySQL-4.0 HA_READ_PREFIX and HA_READ_PREFIX_LAST always
|
case HA_READ_BEFORE_KEY:
|
||||||
pass a complete-field prefix of a key value as the search
|
return(PAGE_CUR_L);
|
||||||
tuple. I.e., it is not allowed that the last field would
|
case HA_READ_PREFIX:
|
||||||
just contain n first bytes of the full field value.
|
return(PAGE_CUR_GE);
|
||||||
MySQL uses a 'padding' trick to convert LIKE 'abc%'
|
case HA_READ_PREFIX_LAST:
|
||||||
type queries so that it can use as a search tuple
|
return(PAGE_CUR_LE);
|
||||||
a complete-field-prefix of a key value. Thus, the InnoDB
|
case HA_READ_PREFIX_LAST_OR_PREV:
|
||||||
search mode PAGE_CUR_LE_OR_EXTENDS is never used.
|
return(PAGE_CUR_LE);
|
||||||
TODO: when/if MySQL starts to use also partial-field
|
/* In MySQL-4.0 HA_READ_PREFIX and HA_READ_PREFIX_LAST always
|
||||||
prefixes, we have to deal with stripping of spaces
|
pass a complete-field prefix of a key value as the search
|
||||||
and comparison of non-latin1 char type fields in
|
tuple. I.e., it is not allowed that the last field would
|
||||||
innobase_mysql_cmp() to get PAGE_CUR_LE_OR_EXTENDS to
|
just contain n first bytes of the full field value.
|
||||||
work correctly. */
|
MySQL uses a 'padding' trick to convert LIKE 'abc%'
|
||||||
case HA_READ_MBR_CONTAIN:
|
type queries so that it can use as a search tuple
|
||||||
case HA_READ_MBR_INTERSECT:
|
a complete-field-prefix of a key value. Thus, the InnoDB
|
||||||
case HA_READ_MBR_WITHIN:
|
search mode PAGE_CUR_LE_OR_EXTENDS is never used.
|
||||||
case HA_READ_MBR_DISJOINT:
|
TODO: when/if MySQL starts to use also partial-field
|
||||||
my_error(ER_TABLE_CANT_HANDLE_SPKEYS, MYF(0));
|
prefixes, we have to deal with stripping of spaces
|
||||||
return(PAGE_CUR_UNSUPP);
|
and comparison of non-latin1 char type fields in
|
||||||
/* do not use "default:" in order to produce a gcc warning:
|
innobase_mysql_cmp() to get PAGE_CUR_LE_OR_EXTENDS to
|
||||||
enumeration value '...' not handled in switch
|
work correctly. */
|
||||||
(if -Wswitch or -Wall is used)
|
case HA_READ_MBR_CONTAIN:
|
||||||
*/
|
case HA_READ_MBR_INTERSECT:
|
||||||
|
case HA_READ_MBR_WITHIN:
|
||||||
|
case HA_READ_MBR_DISJOINT:
|
||||||
|
my_error(ER_TABLE_CANT_HANDLE_SPKEYS, MYF(0));
|
||||||
|
return(PAGE_CUR_UNSUPP);
|
||||||
|
/* do not use "default:" in order to produce a gcc warning:
|
||||||
|
enumeration value '...' not handled in switch
|
||||||
|
(if -Wswitch or -Wall is used) */
|
||||||
}
|
}
|
||||||
|
|
||||||
my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), "this functionality");
|
my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), "this functionality");
|
||||||
|
|
Loading…
Add table
Reference in a new issue