summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2002-09-18 02:04:56 +0300
committerunknown <monty@mashka.mysql.fi>2002-09-18 02:04:56 +0300
commit081023e8fd9a5ab196ca56d55ea256f33ea76f3f (patch)
tree8a07e18388ef6432b1dfbdd5138e6ad09fd57e21
parent00b310fa54d6ab7dabcb626595ff35a980a85d9c (diff)
parente4860747ebc5fddac571526d7c9c5e3f7452ab85 (diff)
downloadmariadb-git-081023e8fd9a5ab196ca56d55ea256f33ea76f3f.tar.gz
merge with 3.23.53 (only code cleanup and new test case)
Docs/manual.texi: Auto merged mysql-test/t/binary.test: Auto merged mysql-test/r/binary.result: merge with 3.23.53 sql/item_strfunc.h: Code cleanup
-rw-r--r--Docs/manual.texi2
-rw-r--r--mysql-test/t/binary.test10
-rw-r--r--sql/item_strfunc.h6
3 files changed, 17 insertions, 1 deletions
diff --git a/Docs/manual.texi b/Docs/manual.texi
index 53d70c0ba33..331589a0674 100644
--- a/Docs/manual.texi
+++ b/Docs/manual.texi
@@ -51235,6 +51235,8 @@ not yet 100% confident in this code.
@appendixsubsec Changes in release 3.23.53
@itemize @bullet
@item
+Fixed core dump bug when using the @code{BINARY} cast on a @code{NULL} value.
+@item
Fixed bug in @code{ALTER TABLE} and @code{RENAME TABLE} when running with
@code{-O lower_case_table_names=1} (typically on windows) when giving the
table name in uppercase.
diff --git a/mysql-test/t/binary.test b/mysql-test/t/binary.test
index be9917dc888..fc2d91e20fe 100644
--- a/mysql-test/t/binary.test
+++ b/mysql-test/t/binary.test
@@ -32,3 +32,13 @@ select * from t1 where a="hello ";
select * from t1 where b="hello ";
select * from t1 where b="hello";
drop table t1;
+
+#
+# Test of binary and NULL
+#
+create table t1 (b char(8));
+insert into t1 values(NULL);
+select b from t1 where binary b like '';
+select b from t1 group by binary b like '';
+select b from t1 having binary b like '';
+drop table t1;
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index 3bbec149e9c..181aa8fb6ba 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -486,7 +486,11 @@ public:
Item_func_binary(Item *a) :Item_str_func(a) {}
const char *func_name() const { return "binary"; }
String *val_str(String *a)
- { a=args[0]->val_str(a); null_value=args[0]->null_value; return a; }
+ {
+ String *tmp=args[0]->val_str(a);
+ null_value=args[0]->null_value;
+ return tmp;
+ }
void fix_length_and_dec() { binary=1; max_length=args[0]->max_length; }
void print(String *str) { print_op(str); }
};