• unknown's avatar
    Fix bug#14186 select datefield is null not updated · 0c094f2a
    unknown authored
    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'
    0c094f2a
sql_select.h 14.1 KB