• Alexander Barkov's avatar
    MDEV-32645 CAST(AS UNSIGNED) fails with --view-protocol · 9322ef03
    Alexander Barkov authored
    Item_float::neg() did not preserve the "presentation" from "this".
    So
      CAST(-1e0 AS UNSIGNED)  -- cast from double to unsigned
    changes its meaning to:
      CAST(-1 AS UNSIGNED)  -- cast signed to undigned
    
    Fixing Item_float::neg() to construct the new value for
    Item_float::presentation as follows:
    - if the old value starts with minus, then the minus is truncated:
      '-2e0' -> '2e0'
    - otherwise, minus sign followed by its old value:
      '1e0'  -> '-1e0'
    9322ef03
cast.test 22.1 KB