diff options
author | evgen@moonbone.local <> | 2005-10-28 01:24:11 +0400 |
---|---|---|
committer | evgen@moonbone.local <> | 2005-10-28 01:24:11 +0400 |
commit | 77723c2438f0fba7cd19e6b746391ede7e3135da (patch) | |
tree | 1c104e30ad0a076a4b630b5718784f64bd29484b /sql/sql_select.cc | |
parent | 0e6b53f172cb3b3e9d5694ca650b5d25c1b474d7 (diff) | |
download | mariadb-git-77723c2438f0fba7cd19e6b746391ede7e3135da.tar.gz |
Fix bug#14186 select datefield is null not updated
Date field was declared as not null, thus expression 'datefield is null'
was always false. For SELECT special handling of such cases is used.
There 'datefield is null' converted to 'datefield eq "0000-00-00"'.
In mysql_update() before creation of select added remove_eq_conds() call.
It makes some optimization of conds and in particular performs conversion
from 'is null' to 'eq'.
Also remove_eq_conds() makes some evaluation of conds and if it founds that
conds is always false then update statement is not processed further.
All this allows to perform some update statements process faster due to
optimized conds, and not wasting resources if conds known to be false.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index c485d6cd04e..fe5b3d453de 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -69,8 +69,6 @@ static int return_zero_rows(JOIN *join, select_result *res,TABLE_LIST *tables, SELECT_LEX_UNIT *unit); static COND *optimize_cond(THD *thd, COND *conds, Item::cond_result *cond_value); -static COND *remove_eq_conds(THD *thd, COND *cond, - Item::cond_result *cond_value); static bool const_expression_in_where(COND *conds,Item *item, Item **comp_item); static bool open_tmp_table(TABLE *table); static bool create_myisam_tmp_table(TABLE *table,TMP_TABLE_PARAM *param, @@ -4611,7 +4609,7 @@ optimize_cond(THD *thd, COND *conds, Item::cond_result *cond_value) COND_FALSE always false ( 1 = 2 ) */ -static COND * +COND * remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value) { if (cond->type() == Item::COND_ITEM) |