Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-5537

Casting to a shorter string type does not warn about truncation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 10.8.2.2
    • None
    • SQL
    • Normal
    • Release Note Needed, Repro attached
    • Deviation from standard

    Description

      SQL:2003, part 2, 6.12 <cast specification> specifies that a truncation warning should be raised when casting from one (character or binary) string data type to another. Derby does truncate, but it doesn't raise a warning:

      ij> values cast('abc' as char(2));
      1

      ab

      1 row selected
      ij> values cast(x'cafebabe' as char(2) for bit data);
      1


      cafe

      1 row selected

      We should generate a warning in order to be compliant.

      Attachments

        1. warn.diff
          12 kB
          Knut Anders Hatlen

        Issue Links

          Activity

            People

              Unassigned Unassigned
              knutanders Knut Anders Hatlen
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: