summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
authorunknown <sanja@askmonty.org>2012-12-28 14:41:46 +0200
committerunknown <sanja@askmonty.org>2012-12-28 14:41:46 +0200
commit6f26aac9409e3456798e58a4ee4306e43c7ebf7b (patch)
treedf8ad17736247d1493460205865fb75757a00ae1 /sql/item_strfunc.cc
parente99aa91e90adfd54cc1f460dd8cdd19614f30abc (diff)
downloadmariadb-git-6f26aac9409e3456798e58a4ee4306e43c7ebf7b.tar.gz
MDEV-3873 & MDEV-3876 & MDEV-3912 : Wrong result (extra rows) with ALL subquery
from a MERGE view. The problem was in the lost ability to be null for the table of a left join if it is a view/derived table. It hapenned because setup_table_map(), was called earlier then we merged the view or derived. Fixed by propagating new maybe_null flag during Item::update_used_tables(). Change in join_outer.test and join_outer_jcl6.test appeared because IS NULL reported no used tables (i.e. constant) for argument which could not be NULL and new maybe_null flag was propagated for IS NULL argument (Item_field) because table the Item_field belonged to changed its maybe_null status.
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r--sql/item_strfunc.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 1b228a344f4..d0b284a363d 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -272,7 +272,7 @@ String *Item_func_aes_decrypt::val_str(String *str)
void Item_func_aes_decrypt::fix_length_and_dec()
{
max_length=args[0]->max_length;
- maybe_null= 1;
+ set_persist_maybe_null(1);
}
@@ -435,7 +435,7 @@ void Item_func_concat::fix_length_and_dec()
if (max_result_length >= MAX_BLOB_WIDTH)
{
max_result_length= MAX_BLOB_WIDTH;
- maybe_null= 1;
+ set_persist_maybe_null(1);
}
max_length= (ulong) max_result_length;
}
@@ -795,7 +795,7 @@ void Item_func_concat_ws::fix_length_and_dec()
if (max_result_length >= MAX_BLOB_WIDTH)
{
max_result_length= MAX_BLOB_WIDTH;
- maybe_null= 1;
+ set_persist_maybe_null(1);
}
max_length= (ulong) max_result_length;
}
@@ -997,7 +997,7 @@ void Item_func_replace::fix_length_and_dec()
if (max_result_length >= MAX_BLOB_WIDTH)
{
max_result_length= MAX_BLOB_WIDTH;
- maybe_null= 1;
+ set_persist_maybe_null(1);
}
max_length= (ulong) max_result_length;
@@ -1081,7 +1081,7 @@ void Item_func_insert::fix_length_and_dec()
if (max_result_length >= MAX_BLOB_WIDTH)
{
max_result_length= MAX_BLOB_WIDTH;
- maybe_null= 1;
+ set_persist_maybe_null(1);
}
max_length= (ulong) max_result_length;
}
@@ -2184,7 +2184,7 @@ void Item_func_elt::fix_length_and_dec()
set_if_bigger(max_length,args[i]->max_length);
set_if_bigger(decimals,args[i]->decimals);
}
- maybe_null=1; // NULL if wrong first arg
+ set_persist_maybe_null(1); // NULL if wrong first arg
}
@@ -2419,14 +2419,14 @@ void Item_func_repeat::fix_length_and_dec()
if (max_result_length >= MAX_BLOB_WIDTH)
{
max_result_length= MAX_BLOB_WIDTH;
- maybe_null= 1;
+ set_persist_maybe_null(1);
}
max_length= (ulong) max_result_length;
}
else
{
max_length= MAX_BLOB_WIDTH;
- maybe_null= 1;
+ set_persist_maybe_null(1);
}
}
@@ -2509,14 +2509,14 @@ void Item_func_rpad::fix_length_and_dec()
if (length >= MAX_BLOB_WIDTH)
{
length= MAX_BLOB_WIDTH;
- maybe_null= 1;
+ set_persist_maybe_null(1);
}
max_length= (ulong) length;
}
else
{
max_length= MAX_BLOB_WIDTH;
- maybe_null= 1;
+ set_persist_maybe_null(1);
}
}
@@ -2626,14 +2626,14 @@ void Item_func_lpad::fix_length_and_dec()
if (length >= MAX_BLOB_WIDTH)
{
length= MAX_BLOB_WIDTH;
- maybe_null= 1;
+ set_persist_maybe_null(1);
}
max_length= (ulong) length;
}
else
{
max_length= MAX_BLOB_WIDTH;
- maybe_null= 1;
+ set_persist_maybe_null(1);
}
}
@@ -3548,7 +3548,7 @@ bool Item_func_dyncol_create::fix_fields(THD *thd, Item **ref)
void Item_func_dyncol_create::fix_length_and_dec()
{
- maybe_null= TRUE;
+ set_persist_maybe_null(1);
collation.set(&my_charset_bin);
decimals= 0;
}