[ 
https://issues.apache.org/jira/browse/IGNITE-7362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16376634#comment-16376634
 ] 

Sergey Kalashnikov commented on IGNITE-7362:
--------------------------------------------

[~isapego], Looks good to me. Thanks!

> ODBC: Third party libraries truncate any inserted varlen data to ColumnSize
> ---------------------------------------------------------------------------
>
>                 Key: IGNITE-7362
>                 URL: https://issues.apache.org/jira/browse/IGNITE-7362
>             Project: Ignite
>          Issue Type: Bug
>          Components: odbc
>    Affects Versions: 2.3
>            Reporter: Igor Sapego
>            Assignee: Igor Sapego
>            Priority: Major
>             Fix For: 2.5
>
>
> Third-party frameworks and ODBC bindings for different languages use metadata 
> requests results for columns (such as {{SQL_COLUMN_PRECISION}}) to truncate 
> varlen data, inserted by the user, which is only 64 by default.
> {code:java}
> <?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 = 'DROP TABLE IF EXISTS test';
>     $ignite->exec($sql);
>     $sql = 'CREATE TABLE IF NOT EXISTS test (id int PRIMARY KEY, userkey 
> VARCHAR(1000))';
>     $ignite->exec($sql);
>     $id = 1;
>     $varval = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed 
> do elit, sed';
>     $dbs = $ignite->prepare("INSERT INTO test (id, userkey) VALUES ($id, 
> '$varval')");
>     $dbs->execute();
>     $dbs = $ignite->prepare("SELECT userkey from test where id=$id");
>     $dbs->execute();
>     $res = $dbs->fetchColumn();
>     assert($varval == $res);
> } catch (PDOException $e) {
>     print "Error!: " . $e->getMessage() . "\n";
>     die();
> }
> ?>
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to