summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2003-02-07 13:28:18 +0200
committerunknown <heikki@hundin.mysql.fi>2003-02-07 13:28:18 +0200
commit2760ecc829a85507c8aefc1e6592b09874791946 (patch)
tree35ffe62836a7fef630091d405bb05fc37bffd174
parentb2f8f07d92095297b6ebf5822c321aa7157f73fc (diff)
downloadmariadb-git-2760ecc829a85507c8aefc1e6592b09874791946.tar.gz
ha_innodb.cc:
Since MySQL uses HA_READ_PREFIX_LAST in a wrong place, we make InnoDB to convert it to a right search condition sql/ha_innodb.cc: Since MySQL uses HA_READ_PREFIX_LAST in a wrong place, we make InnoDB to convert it to a right search condition
-rw-r--r--sql/ha_innodb.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 7ea18453b13..52aeefc5cfe 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -2255,7 +2255,18 @@ convert_search_mode_to_innobase(
case HA_READ_AFTER_KEY: return(PAGE_CUR_G);
case HA_READ_BEFORE_KEY: return(PAGE_CUR_L);
case HA_READ_PREFIX: return(PAGE_CUR_GE);
- case HA_READ_PREFIX_LAST: return(PAGE_CUR_LE_OR_EXTENDS);
+ case HA_READ_PREFIX_LAST: return(PAGE_CUR_LE);
+ /* TODO: 1) this should really be
+ return(PAGE_CUR_LE_OR_EXTENDS); but since MySQL uses
+ a wrong flag in search, we convert this to PAGE_CUR_LE;
+ 2) if the character set is not latin1, then InnoDB
+ uses a MySQL function innobase_mysql_cmp() to
+ compare CHAR and VARCHAR strings; since that function
+ does not return the number of matched bytes,
+ PAGE_CUR_LE_OR_EXTENDS does not currently work: we
+ should probably write my_sortncmp_with_n_matcehd_bytes()
+ to determine if a field 'extends' another;
+ see dev-public discussion on Feb 7th, 2003 */
default: assert(0);
}