summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.h
diff options
context:
space:
mode:
authorGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2010-08-13 16:05:46 +0300
committerGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2010-08-13 16:05:46 +0300
commit8b25c0e4dc6cb18de7ce4be25eb49c44eeab35cf (patch)
treecee46d5fbf50847d147c9723e7461a8f9cd4eab3 /sql/item_timefunc.h
parent41cfa3e76966b55b8a5354f0d0b57ce624a8c95c (diff)
downloadmariadb-git-8b25c0e4dc6cb18de7ce4be25eb49c44eeab35cf.tar.gz
Bug #55565: debug assertion when ordering by expressions with user
variable assignments The assert() that is firing is checking if expressions that can't be null return a NULL when evaluated. MAKEDATE() function can return NULL if the second argument is less then or equal to 0. Thus its nullability depends not only on the nullability of its arguments but also on their values. Fixed by (overoptimistically) setting MAKEDATE() to be nullable despite the nullability of its arguments. Test added. Had to update one test result to reflect the metadata change.
Diffstat (limited to 'sql/item_timefunc.h')
-rw-r--r--sql/item_timefunc.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index a7a64090f6c..11eed70f399 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -881,6 +881,8 @@ public:
{
decimals=0;
max_length=MAX_DATE_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
+ /* It returns NULL when the second argument is less or equal to 0 */
+ maybe_null= 1;
}
longlong val_int();
};