You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Charles Rene <ch...@gmail.com> on 2019/05/01 22:14:35 UTC

Need help with Linux ODBC Driver

Hello,

I'm having trouble using the Apache Ignite 2.7.0 Linux built ODBC driver.
I'm running a .Net Core 2.2 console application in a Linux environment in
Docker.

The problem is that when I run a SELECT statement through .Net's
System.Data.Odbc, I get back "bad data". It looks like a mismatch in
encoding.

The data looks like  "8\00\05\07\09\0d\09\08\0-\0" where as it should be "
80579d98-9010-4610-b12e-ed33ed7d3c62".

Details about my investigation can be found here:
https://stackoverflow.com/questions/55875927/apache-ignite-2-7-odbc-linux-bad-data-returned


Any idea what the problem might be?

Thank you,
Charlie

Re: Need help with Linux ODBC Driver

Posted by Igor Sapego <is...@apache.org>.
Charles,

Thanks for the reproducer, I'll check it out.

Best Regards,
Igor


On Thu, May 16, 2019 at 6:59 PM Charles Rene <ch...@gmail.com>
wrote:

> Thanks Igor. I also noticed that the Linux ODBC Driver deserializes the
> Ignite UUID data type into a byte[] instead of the .Net Guid type. That is
> contrary to what is stated in the documentation (
> https://apacheignite-sql.readme.io/docs/data-types#section-uuid).
>
> SQL Example:
> CREATE TABLE MyTable (Id INT not null, myUUID UUID, PRIMARY KEY (Id));
> INSERT INTO MyTable (Id, myUUID) VALUES (0,
> '24E4A97A-96DC-47EB-89C0-9C44E60DC048');
> SELECT myUUID FROM MyTable;
>
> C#:
> using System;
> using System.Data.Odbc;
>
> namespace IgniteUUIDWrongDataTypeReproducer {
>     internal class Program {
>         private static void Main(string[] args) {
>             var connectionString =
> Environment.GetEnvironmentVariable("IGNITE_CONNECTION_STRING");
>
>             using (var conn = new OdbcConnection(connectionString)) {
>                 conn.Open();
>
>                 using (var cmd = conn.CreateCommand()) {
>                     cmd.CommandText = "DROP TABLE IF EXISTS MyTable;";
>                     cmd.ExecuteNonQuery();
>                 }
>
>                 using (var cmd = conn.CreateCommand()) {
>                     cmd.CommandText = "CREATE TABLE MyTable (Id INT not
> null, myUUID UUID, PRIMARY KEY (Id));";
>                     cmd.ExecuteNonQuery();
>                 }
>
>                 using (var cmd = conn.CreateCommand()) {
>                     cmd.CommandText = "INSERT INTO MyTable (Id, myUUID)
> VALUES (0, '24E4A97A-96DC-47EB-89C0-9C44E60DC048');";
>                     cmd.ExecuteNonQuery();
>                 }
>
>                 using (var cmd = conn.CreateCommand()) {
>                     cmd.CommandText = "SELECT myUUID FROM MyTable;";
>                     using (var rdr = cmd.ExecuteReader()) {
>                         rdr.Read();
>                         var value = rdr[0];
>                         Console.WriteLine($"{rdr.GetName(0)}='{value}'
> DotnetType='{value.GetType()}' DBType='{rdr.GetDataTypeName(0)}'");
>                     }
>                 }
>             }
>         }
>     }
> }
>
> Console Output:
> MYUUID='System.Byte[]' DotnetType='System.Byte[]' DBType='VARBINARY'
>
> Should be: (According to
> https://docs.microsoft.com/en-us/sql/odbc/reference/appendixes/sql-data-types?view=sql-server-2017
> )
> MYUUID='24E4A97A-96DC-47EB-89C0-9C44E60DC048' DotnetType='System.Guid'
> DBType='GUID'
>
>
>
>
>
> On Mon, May 13, 2019 at 9:55 AM Igor Sapego <is...@gridgain.com> wrote:
>
>> It seems like some encoding related issue to me.
>> Added a Jira ticket: [1].
>>
>> [1] - https://issues.apache.org/jira/browse/IGNITE-11845
>>
>> Best Regards,
>> Igor
>>
>>
>> On Thu, May 2, 2019 at 1:15 AM Charles Rene <ch...@gmail.com>
>> wrote:
>>
>>> Hello,
>>>
>>> I'm having trouble using the Apache Ignite 2.7.0 Linux built ODBC
>>> driver. I'm running a .Net Core 2.2 console application in a Linux
>>> environment in Docker.
>>>
>>> The problem is that when I run a SELECT statement through .Net's
>>> System.Data.Odbc, I get back "bad data". It looks like a mismatch in
>>> encoding.
>>>
>>> The data looks like  "8\00\05\07\09\0d\09\08\0-\0" where as it should
>>> be "80579d98-9010-4610-b12e-ed33ed7d3c62".
>>>
>>> Details about my investigation can be found here:
>>>
>>> https://stackoverflow.com/questions/55875927/apache-ignite-2-7-odbc-linux-bad-data-returned
>>>
>>>
>>> Any idea what the problem might be?
>>>
>>> Thank you,
>>> Charlie
>>>
>>

Re: Need help with Linux ODBC Driver

Posted by Charles Rene <ch...@gmail.com>.
Thanks Igor. I also noticed that the Linux ODBC Driver deserializes the
Ignite UUID data type into a byte[] instead of the .Net Guid type. That is
contrary to what is stated in the documentation (
https://apacheignite-sql.readme.io/docs/data-types#section-uuid).

SQL Example:
CREATE TABLE MyTable (Id INT not null, myUUID UUID, PRIMARY KEY (Id));
INSERT INTO MyTable (Id, myUUID) VALUES (0,
'24E4A97A-96DC-47EB-89C0-9C44E60DC048');
SELECT myUUID FROM MyTable;

C#:
using System;
using System.Data.Odbc;

namespace IgniteUUIDWrongDataTypeReproducer {
    internal class Program {
        private static void Main(string[] args) {
            var connectionString =
Environment.GetEnvironmentVariable("IGNITE_CONNECTION_STRING");

            using (var conn = new OdbcConnection(connectionString)) {
                conn.Open();

                using (var cmd = conn.CreateCommand()) {
                    cmd.CommandText = "DROP TABLE IF EXISTS MyTable;";
                    cmd.ExecuteNonQuery();
                }

                using (var cmd = conn.CreateCommand()) {
                    cmd.CommandText = "CREATE TABLE MyTable (Id INT not
null, myUUID UUID, PRIMARY KEY (Id));";
                    cmd.ExecuteNonQuery();
                }

                using (var cmd = conn.CreateCommand()) {
                    cmd.CommandText = "INSERT INTO MyTable (Id, myUUID)
VALUES (0, '24E4A97A-96DC-47EB-89C0-9C44E60DC048');";
                    cmd.ExecuteNonQuery();
                }

                using (var cmd = conn.CreateCommand()) {
                    cmd.CommandText = "SELECT myUUID FROM MyTable;";
                    using (var rdr = cmd.ExecuteReader()) {
                        rdr.Read();
                        var value = rdr[0];
                        Console.WriteLine($"{rdr.GetName(0)}='{value}'
DotnetType='{value.GetType()}' DBType='{rdr.GetDataTypeName(0)}'");
                    }
                }
            }
        }
    }
}

Console Output:
MYUUID='System.Byte[]' DotnetType='System.Byte[]' DBType='VARBINARY'

Should be: (According to
https://docs.microsoft.com/en-us/sql/odbc/reference/appendixes/sql-data-types?view=sql-server-2017
)
MYUUID='24E4A97A-96DC-47EB-89C0-9C44E60DC048' DotnetType='System.Guid'
DBType='GUID'





On Mon, May 13, 2019 at 9:55 AM Igor Sapego <is...@gridgain.com> wrote:

> It seems like some encoding related issue to me.
> Added a Jira ticket: [1].
>
> [1] - https://issues.apache.org/jira/browse/IGNITE-11845
>
> Best Regards,
> Igor
>
>
> On Thu, May 2, 2019 at 1:15 AM Charles Rene <ch...@gmail.com>
> wrote:
>
>> Hello,
>>
>> I'm having trouble using the Apache Ignite 2.7.0 Linux built ODBC driver.
>> I'm running a .Net Core 2.2 console application in a Linux environment in
>> Docker.
>>
>> The problem is that when I run a SELECT statement through .Net's
>> System.Data.Odbc, I get back "bad data". It looks like a mismatch in
>> encoding.
>>
>> The data looks like  "8\00\05\07\09\0d\09\08\0-\0" where as it should be
>> "80579d98-9010-4610-b12e-ed33ed7d3c62".
>>
>> Details about my investigation can be found here:
>>
>> https://stackoverflow.com/questions/55875927/apache-ignite-2-7-odbc-linux-bad-data-returned
>>
>>
>> Any idea what the problem might be?
>>
>> Thank you,
>> Charlie
>>
>

Re: Need help with Linux ODBC Driver

Posted by Igor Sapego <is...@apache.org>.
Hi,

I'm not working on this issue currently and is not aware
if anyone else in the community looking at it.

But I think it's going to be fixed by 2.8 or 2.9 as it looks
quite important.

Best Regards,
Igor


On Fri, Jun 7, 2019 at 7:53 PM Charles Rene <ch...@gmail.com>
wrote:

> Hi Igor, When will this issue be addressed? Thanks, Charlie
>
> On Mon, May 13, 2019 at 9:55 AM Igor Sapego <is...@gridgain.com> wrote:
>
>> It seems like some encoding related issue to me.
>> Added a Jira ticket: [1].
>>
>> [1] - https://issues.apache.org/jira/browse/IGNITE-11845
>>
>> Best Regards,
>> Igor
>>
>>
>> On Thu, May 2, 2019 at 1:15 AM Charles Rene <ch...@gmail.com>
>> wrote:
>>
>>> Hello,
>>>
>>> I'm having trouble using the Apache Ignite 2.7.0 Linux built ODBC
>>> driver. I'm running a .Net Core 2.2 console application in a Linux
>>> environment in Docker.
>>>
>>> The problem is that when I run a SELECT statement through .Net's
>>> System.Data.Odbc, I get back "bad data". It looks like a mismatch in
>>> encoding.
>>>
>>> The data looks like  "8\00\05\07\09\0d\09\08\0-\0" where as it should
>>> be "80579d98-9010-4610-b12e-ed33ed7d3c62".
>>>
>>> Details about my investigation can be found here:
>>>
>>> https://stackoverflow.com/questions/55875927/apache-ignite-2-7-odbc-linux-bad-data-returned
>>>
>>>
>>> Any idea what the problem might be?
>>>
>>> Thank you,
>>> Charlie
>>>
>>

Re: Need help with Linux ODBC Driver

Posted by Charles Rene <ch...@gmail.com>.
Hi Igor, When will this issue be addressed? Thanks, Charlie

On Mon, May 13, 2019 at 9:55 AM Igor Sapego <is...@gridgain.com> wrote:

> It seems like some encoding related issue to me.
> Added a Jira ticket: [1].
>
> [1] - https://issues.apache.org/jira/browse/IGNITE-11845
>
> Best Regards,
> Igor
>
>
> On Thu, May 2, 2019 at 1:15 AM Charles Rene <ch...@gmail.com>
> wrote:
>
>> Hello,
>>
>> I'm having trouble using the Apache Ignite 2.7.0 Linux built ODBC driver.
>> I'm running a .Net Core 2.2 console application in a Linux environment in
>> Docker.
>>
>> The problem is that when I run a SELECT statement through .Net's
>> System.Data.Odbc, I get back "bad data". It looks like a mismatch in
>> encoding.
>>
>> The data looks like  "8\00\05\07\09\0d\09\08\0-\0" where as it should be
>> "80579d98-9010-4610-b12e-ed33ed7d3c62".
>>
>> Details about my investigation can be found here:
>>
>> https://stackoverflow.com/questions/55875927/apache-ignite-2-7-odbc-linux-bad-data-returned
>>
>>
>> Any idea what the problem might be?
>>
>> Thank you,
>> Charlie
>>
>

Re: Need help with Linux ODBC Driver

Posted by Igor Sapego <is...@gridgain.com>.
It seems like some encoding related issue to me.
Added a Jira ticket: [1].

[1] - https://issues.apache.org/jira/browse/IGNITE-11845

Best Regards,
Igor


On Thu, May 2, 2019 at 1:15 AM Charles Rene <ch...@gmail.com>
wrote:

> Hello,
>
> I'm having trouble using the Apache Ignite 2.7.0 Linux built ODBC driver.
> I'm running a .Net Core 2.2 console application in a Linux environment in
> Docker.
>
> The problem is that when I run a SELECT statement through .Net's
> System.Data.Odbc, I get back "bad data". It looks like a mismatch in
> encoding.
>
> The data looks like  "8\00\05\07\09\0d\09\08\0-\0" where as it should be "
> 80579d98-9010-4610-b12e-ed33ed7d3c62".
>
> Details about my investigation can be found here:
>
> https://stackoverflow.com/questions/55875927/apache-ignite-2-7-odbc-linux-bad-data-returned
>
>
> Any idea what the problem might be?
>
> Thank you,
> Charlie
>