Apache Ignite & unixODBC and truncating text

classic Classic list List threaded Threaded
10 messages Options
bagsiur bagsiur
Reply | Threaded
Open this post in threaded view
|

Apache Ignite & unixODBC and truncating text

This post was updated on .
Hello I try to create table with TEXT type. TEXT data type is not supported
by ODBC driver but I can use types like: VARCHAR or LONGVARCHAR.

Problem is that every time my text is truncating to 64 characters. Why? Haw
Can I configure Apache Ignite / unixODBC to work with normal TEXT type?

I tested every text types in ODBC. I try to change ODBC configuration to add
in DSN options in my connection description like:

/etc/odbc.ini

[Apache Ignite]
description=Apache Ignite
driver=Apache Ignite
ADDRESS=127.0.0.1:10800
TextSize = 20971520
TextLimit = 20971520
PacketSize = 20971520

But nothing is resolve my problem...
bagsiur bagsiur
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite & unixODBC and truncating text

This post was updated on .
Hello, I refresh this post

When I try to add TEXT > 64 characters in another way, Apache Ignite show me this errors:

[08-01-2018 08:09:47][INFO ][exchange-worker-#38][time] Started exchange init [topVer=AffinityTopologyVersion [topVer=3, minorTopVer=1], crd=true, evt=DISCOVERY_CUSTOM_
EVT, evtNode=431c6316-5fb1-4f3f-85e8-2a4c58ee7363, customEvt=DynamicCacheChangeBatch [id=f636ec4d061-f1cf4cde-4028-4405-a8be-9181a688447e, reqs=[DynamicCacheChangeReque
st [cacheName=SQL_PUBLIC_TEST_MD5, hasCfg=true, nodeId=431c6316-5fb1-4f3f-85e8-2a4c58ee7363, clientStartOnly=false, stop=false, destroy=false]], exchangeActions=Exchang
eActions [startCaches=[SQL_PUBLIC_TEST_MD5], stopCaches=null, startGrps=[SQL_PUBLIC_TEST_MD5], stopGrps=[], resetParts=null, stateChangeRequest=null], startCaches=false
], allowMerge=false]
[08-01-2018 08:09:47][INFO ][exchange-worker-#38][GridCacheProcessor] Started cache [name=SQL_PUBLIC_TEST_MD5, memoryPolicyName=Default_Region, mode=PARTITIONED, atomic
ity=ATOMIC]
[08-01-2018 08:09:47][INFO ][exchange-worker-#38][GridDhtPartitionsExchangeFuture] Finished waiting for partition release future [topVer=AffinityTopologyVersion [topVer
=3, minorTopVer=1], waitTime=0ms, futInfo=NA]
[08-01-2018 08:09:47][INFO ][exchange-worker-#38][GridDhtPartitionsExchangeFuture] finishExchangeOnCoordinator [topVer=AffinityTopologyVersion [topVer=3, minorTopVer=1]
, resVer=AffinityTopologyVersion [topVer=3, minorTopVer=1]]
[08-01-2018 08:09:47][INFO ][exchange-worker-#38][GridDhtPartitionsExchangeFuture] Finish exchange future [startVer=AffinityTopologyVersion [topVer=3, minorTopVer=1], r
esVer=AffinityTopologyVersion [topVer=3, minorTopVer=1], err=null]
[08-01-2018 08:09:47][INFO ][exchange-worker-#38][time] Finished exchange init [topVer=AffinityTopologyVersion [topVer=3, minorTopVer=1], crd=true]
[08-01-2018 08:09:47][INFO ][exchange-worker-#38][GridCachePartitionExchangeManager] Skipping rebalancing (nothing scheduled) [top=AffinityTopologyVersion [topVer=3, mi
norTopVer=1], evt=DISCOVERY_CUSTOM_EVT, node=431c6316-5fb1-4f3f-85e8-2a4c58ee7363]




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Alexey Popov Alexey Popov
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite & unixODBC and truncating text

Hi Bagsuir,

What Ignite version are you using?

Could you please share a reproducible example of the issue you have?
Or can you try the C# example attached (VS 2017)?

Thank you,
Alexey

odbcvarchar.cs
<http://apache-ignite-users.70518.x6.nabble.com/file/t1428/odbcvarchar.cs>  



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
bagsiur bagsiur
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite & unixODBC and truncating text

This post was updated on .
So, I use Apache Ignite in 2.3.0 version.

"Could you please share a reproducible example of the issue you have? " - what exactly do you need? I will prepare it.

Im not C# programmer but I compile attached C# example by mono:

mcs -out:odbcvarchar.exe -r:System.dll -r:System.Data.dll odbcvarchar.cs

And after when I run it I have fallowing errors:

[ERROR] FATAL UNHANDLED EXCEPTION: System.EntryPointNotFoundException:
LocalAlloc
  at (wrapper managed-to-native)
System.Data.Common.SafeNativeMethods:LocalAlloc (int,intptr)
  at System.Data.ProviderBase.DbBuffer..ctor (System.Int32 initialSize,
System.Boolean zeroBuffer) [0x0002f] in <23f11074adc346a7bcd76c006d949301>:0
  at System.Data.ProviderBase.DbBuffer..ctor (System.Int32 initialSize)
[0x00000] in <23f11074adc346a7bcd76c006d949301>:0
  at System.Data.Odbc.CNativeBuffer..ctor (System.Int32 initialSize)
[0x00000] in <23f11074adc346a7bcd76c006d949301>:0
  at System.Data.Odbc.OdbcCommand.GetStatementHandle () [0x00033] in
<23f11074adc346a7bcd76c006d949301>:0
  at System.Data.Odbc.OdbcCommand.ExecuteReaderObject
(System.Data.CommandBehavior behavior, System.String method, System.Boolean
needReader, System.Object[] methodArguments, System.Data.Odbc.ODBC32+SQL_API
odbcApiMethod) [0x00019] in <23f11074adc346a7bcd76c006d949301>:0
  at System.Data.Odbc.OdbcCommand.ExecuteReaderObject
(System.Data.CommandBehavior behavior, System.String method, System.Boolean
needReader) [0x0001c] in <23f11074adc346a7bcd76c006d949301>:0
  at System.Data.Odbc.OdbcCommand.ExecuteNonQuery () [0x0000a] in
<23f11074adc346a7bcd76c006d949301>:0
  at OdbcVarchars.Program.Main (System.String[] args) [0x00023] in
<873514a817794f1297b9f0b2be86f821>:0




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Alexey Popov Alexey Popov
Reply | Threaded
Open this post in threaded view
|

RE: Apache Ignite & unixODBC and truncating text

Hi Bagsiur,

 

It is some mono lib error below, not a user-code.

 

Can you share a simple code reproducer? Just to see the order of actions in your code.

 

Thank you,
Alexey

 

From: [hidden email]
Sent: Tuesday, January 9, 2018 10:36 AM
To: [hidden email]
Subject: Re: Apache Ignite & unixODBC and truncating text

 

So, I use Apache Ignite in 2.3.0 version.

 

Im not C# programmer but I compile attached C# example by mono:

 

mcs -out:odbcvarchar.exe -r:System.dll -r:System.Data.dll odbcvarchar.cs

 

And after when I run it I have fallowing errors:

 

[ERROR] FATAL UNHANDLED EXCEPTION: System.EntryPointNotFoundException:

LocalAlloc

  at (wrapper managed-to-native)

System.Data.Common.SafeNativeMethods:LocalAlloc (int,intptr)

  at System.Data.ProviderBase.DbBuffer..ctor (System.Int32 initialSize,

System.Boolean zeroBuffer) [0x0002f] in <23f11074adc346a7bcd76c006d949301>:0

  at System.Data.ProviderBase.DbBuffer..ctor (System.Int32 initialSize)

[0x00000] in <23f11074adc346a7bcd76c006d949301>:0

  at System.Data.Odbc.CNativeBuffer..ctor (System.Int32 initialSize)

[0x00000] in <23f11074adc346a7bcd76c006d949301>:0

  at System.Data.Odbc.OdbcCommand.GetStatementHandle () [0x00033] in

<23f11074adc346a7bcd76c006d949301>:0

  at System.Data.Odbc.OdbcCommand.ExecuteReaderObject

(System.Data.CommandBehavior behavior, System.String method, System.Boolean

needReader, System.Object[] methodArguments, System.Data.Odbc.ODBC32+SQL_API

odbcApiMethod) [0x00019] in <23f11074adc346a7bcd76c006d949301>:0

  at System.Data.Odbc.OdbcCommand.ExecuteReaderObject

(System.Data.CommandBehavior behavior, System.String method, System.Boolean

needReader) [0x0001c] in <23f11074adc346a7bcd76c006d949301>:0

  at System.Data.Odbc.OdbcCommand.ExecuteNonQuery () [0x0000a] in

<23f11074adc346a7bcd76c006d949301>:0

  at OdbcVarchars.Program.Main (System.String[] args) [0x00023] in

<873514a817794f1297b9f0b2be86f821>:0

 

 

 

 

--

Sent from: http://apache-ignite-users.70518.x6.nabble.com/

 

bagsiur bagsiur
Reply | Threaded
Open this post in threaded view
|

RE: Apache Ignite & unixODBC and truncating text

Yes, and maybe will difficult to find solution on this error:
https://bugzilla.xamarin.com/show_bug.cgi?id=37368

If will be nessesery I can try to prepare VS 2017 and compile it one more
time...

So, here is my simple script:

<?php

        ini_set("display_errors", 1);
        error_reporting(E_ALL);

        try {

                $ignite = new PDO('odbc:Apache Ignite');
                $ignite->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
               
                $sql = 'CREATE TABLE IF NOT EXISTS test_md5 (id int PRIMARY KEY, userkey
LONGVARCHAR, server LONGVARCHAR, tsession LONGVARCHAR, tpost LONGVARCHAR,
tget LONGVARCHAR, adddate int) WITH
"atomicity=transactional,cachegroup=somegroup"';
                $ignite->exec($sql);

                for($i=0; $i <= 10; $i++){
                        $dbs = $ignite->prepare("INSERT INTO test_md5 (id, userkey, server,
tsession, tpost, tget, adddate) VALUES ($i, 'Lorem ipsum dolor sit amet,
consectetur adipiscing elit, sed do elit, sed', 'b', 'c', 'd', 'e', 1)");
                        $dbs->execute();
                }
               
       
        } catch (PDOException $e) {
                print "Error!: " . $e->getMessage() . "\n";
                die();
        }
       
?>

If TEXT is a little bit longer I have error like in my second post.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Igor Sapego-2 Igor Sapego-2
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite & unixODBC and truncating text

I've checked the scenario with the pure ODBC and it seems like
the issue is not with the ODBC driver, as it lets you insert and
select varchar data of any length, but with the tools, which truncate
any data that user passes to column size, which set to 64 by default
for variable length columns.

I've created a ticket [1] for this issue so you can track our progress
with it.


Best Regards,
Igor

On Tue, Jan 9, 2018 at 11:06 AM, bagsiur <[hidden email]> wrote:
Yes, and maybe will difficult to find solution on this error:
https://bugzilla.xamarin.com/show_bug.cgi?id=37368

If will be nessesery I can try to prepare VS 2017 and compile it one more
time...

So, here is my simple script:

<?php

        ini_set("display_errors", 1);
        error_reporting(E_ALL);

        try {

                $ignite = new PDO('odbc:Apache Ignite');
                $ignite->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

                $sql = 'CREATE TABLE IF NOT EXISTS test_md5 (id int PRIMARY KEY, userkey
LONGVARCHAR, server LONGVARCHAR, tsession LONGVARCHAR, tpost LONGVARCHAR,
tget LONGVARCHAR, adddate int) WITH
"atomicity=transactional,cachegroup=somegroup"';
                $ignite->exec($sql);

                for($i=0; $i <= 10; $i++){
                        $dbs = $ignite->prepare("INSERT INTO test_md5 (id, userkey, server,
tsession, tpost, tget, adddate) VALUES ($i, 'Lorem ipsum dolor sit amet,
consectetur adipiscing elit, sed do elit, sed', 'b', 'c', 'd', 'e', 1)");
                        $dbs->execute();
                }


        } catch (PDOException $e) {
                print "Error!: " . $e->getMessage() . "\n";
                die();
        }

?>

If TEXT is a little bit longer I have error like in my second post.

bagsiur bagsiur
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite & unixODBC and truncating text

Ok, thank you very much for your time nad reply.

So, if I understend corectly, this is bug of Apache Ignite. How much time
will take to resolve and fix this problem?

I will track progress :)



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Igor Sapego-2 Igor Sapego-2
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite & unixODBC and truncating text

Well, yes, it's a bug. I hope to close it by the end of the next week,
so the fix could be included in the Ignite 2.4

Best Regards,
Igor

On Wed, Jan 10, 2018 at 3:42 PM, bagsiur <[hidden email]> wrote:
Ok, thank you very much for your time nad reply.

So, if I understend corectly, this is bug of Apache Ignite. How much time
will take to resolve and fix this problem?

I will track progress :)

bagsiur bagsiur
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite & unixODBC and truncating text

This post was updated on .
ok,

I ask becouse I want to be sure. Fix will be included in Ignite 2.4 or 2.5?

On the ticket: https://issues.apache.org/jira/browse/IGNITE-7362 in details
is write that fix this bug is planning for 2.5 version...



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/