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

ODBC driver works in a wrong way with UTF-16 encoding on Linux

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.7
    • Fix Version/s: None
    • Component/s: odbc
    • Labels:
      None
    • Ignite Flags:
      Docs Required

      Description

      When ones run a SQL statement, like SELECT Id FROM MyTable, the value is "garbled" returning a value like 8\00\05\07\09\0d\09\08\0-\0 for the the Id column. It's similar to the expected value, though, which is 80579d98-9010-4610-b12e-ed33ed7d3c62.

      When SQLLine tool is used, the values are not "garbled". This behaviour can be only observed on Linux.

      It might have something to do with UTF-16 due to a similar SO question where characters are separated with a \0.

      Maybe something to do with the UNICODE setting in this line from the ODBC logs

      More info can be found on SO: https://stackoverflow.com/questions/55875927/apache-ignite-2-7-odbc-linux-bad-data-returned

      Reproducer instructions (in attachment)

      Build

      docker build . -t ignitegarbleddatareproducer -f IgniteGarbledDataReproducer/Dockerfile
      

      Execute

      PS C:\IgniteGarbledDataReproducer> docker-compose up
      Starting ignitegarbleddatareproducer_ignitegarbleddatareproducer_1 ... done
      Attaching to ignitegarbleddatareproducer_ignitegarbleddatareproducer_1
      ignitegarbleddatareproducer_1  | START
      ignitegarbleddatareproducer_1  | DRIVER={Apache Ignite};ADDRESS=my-ignite-3e8b8cb9a4e192af.elb.us-east-1.amazonaws.com:10800;SSL_MODE=disable;
      ignitegarbleddatareproducer_1  | Connection Opened
      ignitegarbleddatareproducer_1  | DROP TABLE IF EXISTS MyTable;
      ignitegarbleddatareproducer_1  | Table Dropped (if it existed)
      ignitegarbleddatareproducer_1  | CREATE TABLE MyTable (Id varchar(36) not null, FirstName varchar(255), LastName varchar(255), PRIMARY KEY (Id));
      ignitegarbleddatareproducer_1  | Table Created
      ignitegarbleddatareproducer_1  | INSERT INTO MyTable (Id) VALUES ('80579d98-9010-4610-b12e-ed33ed7d3c62');
      ignitegarbleddatareproducer_1  | Data Inserted
      ignitegarbleddatareproducer_1  | SELECT Id FROM MyTable;
      ignitegarbleddatareproducer_1  | Id = '8 0 5 7 9 d 9 8 - '
      ignitegarbleddatareproducer_1  | Data Returned
      ignitegarbleddatareproducer_1  | DONE
      ignitegarbleddatareproducer_ignitegarbleddatareproducer_1 exited with code 0
      

        Attachments

        1. docker-compose.yml
          0.2 kB
          Igor Sapego
        2. docker-compose-override.yml
          0.3 kB
          Igor Sapego
        3. Dockerfile
          2 kB
          Igor Sapego
        4. IgniteGarbledDataReproducer.csproj
          0.3 kB
          Igor Sapego
        5. odbc.log
          3 kB
          Igor Sapego
        6. Program.cs
          2 kB
          Igor Sapego

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              isapego Igor Sapego
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: