summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2007-01-12 16:43:52 +0300
committerunknown <evgen@moonbone.local>2007-01-12 16:43:52 +0300
commitcb96e8bcd8e4593929e2f1226468097963b5a793 (patch)
tree73dbb4bdf18a95157622cc3458f0541da6215366 /sql
parent0f0d0f5bd45ef87ff75bc15c3faac8d9cb97c154 (diff)
parent52c100ae0cfbf5588fe3fa1917aba3934241e3f6 (diff)
downloadmariadb-git-cb96e8bcd8e4593929e2f1226468097963b5a793.tar.gz
Merge moonbone.local:/work/latest-4.1-opt-mysql
into moonbone.local:/work/latest-5.0-opt-mysql mysql-test/t/func_str.test: Auto merged sql/item_strfunc.cc: Auto merged sql/item_strfunc.h: Auto merged sql/sql_delete.cc: Auto merged mysql-test/r/delete.result: Manual merge mysql-test/r/func_str.result: Manual merge mysql-test/t/delete.test: Manual merge
Diffstat (limited to 'sql')
-rw-r--r--sql/item_strfunc.cc13
-rw-r--r--sql/item_strfunc.h11
-rw-r--r--sql/sql_delete.cc2
3 files changed, 22 insertions, 4 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index f98a14d2cc6..95cc32b5c8e 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -1694,6 +1694,19 @@ String *Item_func_encode::val_str(String *str)
return res;
}
+void Item_func_encode::print(String *str)
+{
+ str->append(func_name());
+ str->append('(');
+ args[0]->print(str);
+ str->append(',');
+ str->append('\'');
+ str->append(seed);
+ str->append('\'');
+ str->append(')');
+}
+
+
String *Item_func_decode::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index 67dd71fc886..60547d00a5c 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -358,19 +358,24 @@ class Item_func_encode :public Item_str_func
{
protected:
SQL_CRYPT sql_crypt;
+ String seed;
public:
- Item_func_encode(Item *a, char *seed):
- Item_str_func(a),sql_crypt(seed) {}
+ Item_func_encode(Item *a, char *seed_arg):
+ Item_str_func(a), sql_crypt(seed_arg)
+ {
+ seed.copy(seed_arg, strlen(seed_arg), default_charset_info);
+ }
String *val_str(String *);
void fix_length_and_dec();
const char *func_name() const { return "encode"; }
+ void print(String *str);
};
class Item_func_decode :public Item_func_encode
{
public:
- Item_func_decode(Item *a, char *seed): Item_func_encode(a,seed) {}
+ Item_func_decode(Item *a, char *seed_arg): Item_func_encode(a, seed_arg) {}
String *val_str(String *);
const char *func_name() const { return "decode"; }
};
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 9264362a1c8..7752ac80adb 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -162,7 +162,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
DBUG_RETURN(TRUE);
}
- if (!select && limit != HA_POS_ERROR)
+ if ((!select || table->quick_keys.is_clear_all()) && limit != HA_POS_ERROR)
usable_index= get_index_for_order(table, (ORDER*)(order->first), limit);
if (usable_index == MAX_KEY)