Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-3052

Cannot JOIN on comparing CHAR columns of differing length

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 4.7.0
    • None
    • None

    Description

      create table testchar1 (pk char(10) primary key)
      create table testchar2 (pk char(20) primary key)
      
      upsert into testchar1 values('a')
      upsert into testchar2 values('a')
      
      upsert into testchar1 values('b')
      upsert into testchar2 values('b')
      
      select * from testchar1 INNER JOIN testchar2 ON testchar1.pk = testchar2.pk
      

      `testchar1` and `testchar2` contain the same data so two rows should be returned.

      Note that the following query works when testchar3.pk has the same column length as testchar1.pk:

      select * from testchar1 INNER JOIN testchar3 ON testchar1.pk = testchar3.pk
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kliew Kevin Liew
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: