diff options
author | unknown <evgen@moonbone.local> | 2005-10-28 01:24:11 +0400 |
---|---|---|
committer | unknown <evgen@moonbone.local> | 2005-10-28 01:24:11 +0400 |
commit | 6020281e9511f96cb99cf7d55643d75fa1a4a4a4 (patch) | |
tree | 1c104e30ad0a076a4b630b5718784f64bd29484b /sql/sql_select.h | |
parent | fe90e5677c702b65b4f246d8a7a1af0d41284e91 (diff) | |
download | mariadb-git-6020281e9511f96cb99cf7d55643d75fa1a4a4a4.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.
sql/sql_select.cc:
Fix bug#14186 select datefield is null not updated
Remove static from remove_eq_conds()
sql/sql_select.h:
Fix bug#14186 select datefield is null not updated
Added remove_eq_conds() prototype.
mysql-test/r/update.result:
Test case for bug#14186 select datefield is null not updated
mysql-test/t/update.test:
Test case for bug#14186 select datefield is null not updated
sql/sql_update.cc:
Fix bug#14186 select datefield is null not updated
To mysql_update() added call to remove_eq_conds() to optimize conds and convert 'datefield is null' to 'datefield eq 0000-00-00'
Diffstat (limited to 'sql/sql_select.h')
-rw-r--r-- | sql/sql_select.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sql_select.h b/sql/sql_select.h index c7440fe4c3a..b92576587fe 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -456,3 +456,4 @@ bool cp_buffer_from_ref(THD *thd, TABLE_REF *ref); bool error_if_full_join(JOIN *join); int report_error(TABLE *table, int error); int safe_index_read(JOIN_TAB *tab); +COND *remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value); |