Derby
  1. Derby
  2. DERBY-4658

Allow explicit casts of string values to BOOLEAN

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10.7.1.1
    • Component/s: SQL
    • Labels:
      None

      Description

      The SQL Standard allows strings to be explicitly cast to BOOLEAN values. Strings are the only type (other than BOOLEAN itself) which can be cast to BOOLEAN. As part of our expanding support for the BOOLEAN datatype, we should allow these casts.

      Casting string types to boolean is defined by part 2, section 6.12 (<cast specification>), general rule 20:

      a) Trim whitespace off the string

      b) Then apply the rules in section 5.3 (<literal>). This means that the trimmed string must be 'TRUE', 'FALSE', or 'UNKNOWN', regardless of case.

      c) Otherwise, raise an exception.

      1. nullability.diff
        3 kB
        Knut Anders Hatlen
      2. derby-4658-01-ab-booleanCasts.diff
        15 kB
        Rick Hillegas
      3. derby-4658-01-aa-booleanCasts.diff
        13 kB
        Rick Hillegas

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Rick Hillegas
              Reporter:
              Rick Hillegas
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development