summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2003-02-08 01:12:58 +0200
committerunknown <monty@mashka.mysql.fi>2003-02-08 01:12:58 +0200
commitcb38070e9f4e3dcaf3e2f9dc42577802ba035085 (patch)
treed54b65dfc052978dab95842c84f1a39745ef0d0c /sql
parent5dd528a2fda1412b8b75a6311dbc7262670983b6 (diff)
parent133ed0bf6ffde95d02ea35b6c02b5a042d73ecc0 (diff)
downloadmariadb-git-cb38070e9f4e3dcaf3e2f9dc42577802ba035085.tar.gz
merge
configure.in: Auto merged mysql-test/t/explain.test: Auto merged sql/ha_innodb.cc: Auto merged sql/item_create.cc: Auto merged sql/item_create.h: Auto merged sql/opt_range.cc: Auto merged sql/opt_sum.cc: Auto merged
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_innodb.cc19
-rw-r--r--sql/item_create.cc5
-rw-r--r--sql/item_create.h1
-rw-r--r--sql/opt_range.cc2
-rw-r--r--sql/opt_sum.cc11
5 files changed, 23 insertions, 15 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 23c6082da92..a037c6989aa 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -2293,17 +2293,14 @@ convert_search_mode_to_innobase(
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);
- /* 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 */
+ /* In MySQL HA_READ_PREFIX and HA_READ_PREFIX_LAST always
+ use a complete-field-prefix of a kay value as the search
+ tuple. I.e., it is not allowed that the last field would
+ just contain n first bytes of the full field value.
+ MySQL uses a 'padding' trick to convert LIKE 'abc%'
+ type queries so that it can use as a search tuple
+ a complete-field-prefix of a key value. Thus, the InnoDB
+ search mode PAGE_CUR_LE_OR_EXTENDS is never used. */
default: assert(0);
}
diff --git a/sql/item_create.cc b/sql/item_create.cc
index 610b7d77184..5c37abb230f 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -320,6 +320,11 @@ Item *create_func_quarter(Item* a)
return new Item_func_quarter(a);
}
+Item *create_func_password(Item* a)
+{
+ return new Item_func_password(a);
+}
+
Item *create_func_radians(Item *a)
{
return new Item_func_units((char*) "radians",a,M_PI/180,0.0);
diff --git a/sql/item_create.h b/sql/item_create.h
index 0c469e82db8..0c51886180f 100644
--- a/sql/item_create.h
+++ b/sql/item_create.h
@@ -73,6 +73,7 @@ Item *create_func_pi(void);
Item *create_func_pow(Item* a, Item *b);
Item *create_func_current_user(void);
Item *create_func_quarter(Item* a);
+Item *create_func_password(Item* a);
Item *create_func_radians(Item *a);
Item *create_func_release_lock(Item* a);
Item *create_func_repeat(Item* a, Item *b);
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 3dbcdaf0537..879c75eb2e2 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -23,8 +23,6 @@
*/
-
-
#ifdef __GNUC__
#pragma implementation // gcc: Class implementation
#endif
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index 2ca6ddbab10..d8c61fa1a1d 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -245,8 +245,15 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
const_result=0;
}
}
- if (used_tables != removed_tables)
- const_result=0; // We didn't remove all tables
+ /*
+ If we have a where clause, we can only ignore searching in the
+ tables if MIN/MAX optimisation replaced all used tables
+ This is to not to use replaced values in case of:
+ SELECT MIN(key) FROM table_1, empty_table
+ removed_tables is != 0 if we have used MIN() or MAX().
+ */
+ if (removed_tables && used_tables != removed_tables)
+ const_result= 0; // We didn't remove all tables
return const_result;
}