summaryrefslogtreecommitdiff
path: root/sql/item.h
diff options
context:
space:
mode:
authorunknown <bar@mysql.com>2004-11-10 14:05:28 +0400
committerunknown <bar@mysql.com>2004-11-10 14:05:28 +0400
commitc5e6941e75454a01953ff542ceda7e4aeb1c22ae (patch)
treee0ac510e9f74790b5573d5dcf11694810143adda /sql/item.h
parentfdc79aa30a4dc00eb4f2666901b0ff388aab185a (diff)
downloadmariadb-git-c5e6941e75454a01953ff542ceda7e4aeb1c22ae.tar.gz
1. When mixing NULL to a character string,
the result takes its charset/collation attributes from the character string, e.g. SELECT func(NULL, _latin2'string') now returns a latin2 result. This is done by introducing a new derivation (aka coercibility) level DERIVATION_IGNORABLE, which is used with Item_null. 2. 'Pure' NULL is now BINARY(0), not CHAR(0). I.e. NULL is now more typeless. mysql-test/r/metadata.result: Fixing test results: CHAR(0) -> BINARY(0) for NULLs mysql-test/r/null.result: Testing mixing NULL with a character string with a number of functions. mysql-test/r/ps_2myisam.result: Fixing test results: CHAR(0) -> BINARY(0) for NULLs mysql-test/r/ps_3innodb.result: Fixing test results: CHAR(0) -> BINARY(0) for NULLs mysql-test/r/ps_4heap.result: Fixing test results: CHAR(0) -> BINARY(0) for NULLs mysql-test/r/ps_5merge.result: Fixing test results: CHAR(0) -> BINARY(0) for NULLs mysql-test/r/ps_6bdb.result: Fixing test results: CHAR(0) -> BINARY(0) for NULLs mysql-test/r/ps_7ndb.result: Fixing test results: CHAR(0) -> BINARY(0) for NULLs mysql-test/t/null.test: Testing mixing NULL with a character string with a number of functions. sql/item.cc: New derivation level. sql/item.h: New derivation level.
Diffstat (limited to 'sql/item.h')
-rw-r--r--sql/item.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/item.h b/sql/item.h
index fea3aa010a8..547577a7ee0 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -31,6 +31,7 @@ void item_init(void); /* Init item functions */
enum Derivation
{
+ DERIVATION_IGNORABLE= 4,
DERIVATION_COERCIBLE= 3,
DERIVATION_IMPLICIT= 2,
DERIVATION_NONE= 1,
@@ -98,6 +99,7 @@ public:
{
switch(derivation)
{
+ case DERIVATION_IGNORABLE: return "IGNORABLE";
case DERIVATION_COERCIBLE: return "COERCIBLE";
case DERIVATION_IMPLICIT: return "IMPLICIT";
case DERIVATION_EXPLICIT: return "EXPLICIT";
@@ -440,6 +442,7 @@ public:
max_length= 0;
name= name_par ? name_par : (char*) "NULL";
fixed= 1;
+ collation.set(&my_charset_bin, DERIVATION_IGNORABLE);
}
enum Type type() const { return NULL_ITEM; }
bool eq(const Item *item, bool binary_cmp) const;