summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/merge.result2
-rw-r--r--sql/ha_innodb.cc14
-rw-r--r--sql/mysqld.cc2
-rw-r--r--sql/opt_sum.cc7
4 files changed, 6 insertions, 19 deletions
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index 86586d5950d..0bffc93c284 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -536,7 +536,7 @@ INSERT INTO t2 VALUES (1,2), (2,2);
CREATE TABLE t ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', KEY a (a,b)) TYPE=MRG_MyISAM UNION=(t1,t2);
select max(b) from t where a = 2;
max(b)
-NULL
+2
select max(b) from t1 where a = 2;
max(b)
1
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index f8321064683..b4fe6130e9b 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -2249,19 +2249,7 @@ 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:
- /* ut_print_timestamp(stderr);
- fprintf(stderr,
- " InnoDB: Warning: Using HA_READ_PREFIX_LAST\n"); */
- return(PAGE_CUR_LE);
-
- /* InnoDB does not yet support ..PREFIX_LAST!
- We have to add a new search flag
- PAGE_CUR_LE_OR_PREFIX to InnoDB. */
-
- /* the above PREFIX flags mean that the last
- field in the key value may just be a prefix
- of the complete fixed length field */
+ case HA_READ_PREFIX_LAST: return(PAGE_CUR_LE_OR_EXTENDS);
default: assert(0);
}
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index e7190f575db..46fbee0a7ea 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -749,7 +749,7 @@ static void *kill_server(void *sig_ptr)
#define RETURN_FROM_KILL_SERVER DBUG_RETURN(0)
#else
static void __cdecl kill_server(int sig_ptr)
-#define RETURN_FROM_KILL_SERVER DBUG_RETURN
+#define RETURN_FROM_KILL_SERVER DBUG_VOID_RETURN
#endif
{
int sig=(int) (long) sig_ptr; // This is passed a int
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index 4b6a196051e..ecfa97586e9 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -38,7 +38,7 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
table_map removed_tables=0;
Item *item;
COND *org_conds= conds;
-
+
/* Add all ON conditions to WHERE condition */
for (TABLE_LIST *tl=tables; tl ; tl= tl->next)
{
@@ -165,10 +165,9 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
error=table->file->index_last(table->record[0]) !=0;
else
{
- (void)table->file->index_read(table->record[0], key_buff,
+ error = table->file->index_read(table->record[0], key_buff,
ref.key_length,
- HA_READ_AFTER_KEY);
- error=table->file->index_prev(table->record[0]) ||
+ HA_READ_PREFIX_LAST) ||
key_cmp(table,key_buff,ref.key,ref.key_length);
}
if (table->key_read)