Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-18662

Sql. Numeric to/from decimal cast with overflow does not produce an error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0
    • sql

    Description

      Casts from numeric type to decimal with overflow must fail but they return a result:

      SELECT 10000000::BIGINT::DECIMAL(3,1)
      

      Returns

      ----
      1000000
      

      And the following query:

      SELECT 2147483648::DECIMAL(18,0)::INTEGER
      ----
      -2147483648
      # Integer.MIN_VALUE
      
      query I
      SELECT 128::DECIMAL(3,0)::TINYINT
      ----
      -128
      # Byte.MIN_VALUE 
      

      See skipif-ed examples in cast_to_decimal.test and cast_from_decimal.test

      Attachments

        Issue Links

          Activity

            People

              zstan Evgeny Stanilovsky
              mzhuravkov Maksim Zhuravkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 3h 10m
                  3h 10m