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

Calcite. Functions extends string parameters by trailing spaces

    XMLWordPrintableJSON

Details

    • Bug
    • Status: In Progress
    • Major
    • Resolution: Unresolved
    • None
    • None
    • sql
    • None
    • Docs Required, Release Notes Required

    Description

      I discovered the strange behavior of functions with several string parameters, which then returns one of these parameters. In this case, the returned parameter string is expanded with trailing spaces to the length of the longest string.

      query T
      SELECT COALESCE(COALESCE(null, 'world'), 'blabla')
      ----
      world  - result is 'world ' - so we have extra trailing spaces from max length string parameter'blabla'
      query I
      SELECT DECODE(102, 101, 'IBM', 102, 'GRIDGAIN', 103, 'Hewlett Packard','BALL')
      ----
      GRIDGAIN   - result is 'GRIDGAIN       ' - so we have extra traiing spaces from max length string parameter 'Hewlett Packard'

      see src/test/sql/function/generic/test_decode.test_ignore

      seeĀ src/test/sql/function/generic/test_coalesce.test_ignore

      Attachments

        Issue Links

          Activity

            People

              alex_pl Aleksey Plekhanov
              jooger Yury Gerzhedovich
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: