• unknown's avatar
    Fix for bug #32021: Using Date 000-00-01 in WHERE causes wrong result · f2a631f0
    unknown authored
      
    Problem: caching 00000000-00000099 dates as integer values we're 
    improperly shifting them up twice in the get_datetime_value().
      
    Fix: don't shift cached DATETIME values up for the second time.
    
    
    mysql-test/r/type_date.result:
      Fix for bug #32021: Using Date 000-00-01 in WHERE causes wrong result
        - test result.
    mysql-test/t/type_date.test:
      Fix for bug #32021: Using Date 000-00-01 in WHERE causes wrong result
        - test case.
    sql/item.h:
      Fix for bug #32021: Using Date 000-00-01 in WHERE causes wrong result
        - Item_cache::field_type() method added.
        - new Item_cache(enum_field_types) and Item_cache_int(enum_field_types) 
          constructors added.
    sql/item_cmpfunc.cc:
      Fix for bug #32021: Using Date 000-00-01 in WHERE causes wrong result
        - don't shift cached DATETIME values for the second time in the
          get_datetime_value():
            creating new Item_cache_int set DATETIME filed type,
            check the type before shifting.
    f2a631f0
item.h 92.6 KB