• Alexander Barkov's avatar
    Bug#52849 [Com]: datetime index not work · f90f3414
    Alexander Barkov authored
    Problem: after introduction of "WL#2649 Number-to-string conversions"
    
    This query:
      SET NAMES cp850; -- Or any other non-latin1 ASCII-based character set
      SELECT * FROM t1
      WHERE datetime_column='2010-01-01 00:00:00'
    started to add extra character set conversion: 
      SELECT * FROM t1
      WHERE CONVERT(datetime_column USING cp850)='2010-01-01 00:00:00';
    
    so index on DATETIME column was not used anymore.
    Fix:
      avoid convertion of NUMERIC/DATETIME items
      (i.e. those with derivation DERIVATION_NUMERIC).
    f90f3414
item.cc 223 KB