[
https://issues.apache.org/jira/browse/IGNITE-7362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16371475#comment-16371475
]
Igor Sapego commented on IGNITE-7362:
-------------------------------------
It seems that root cause is the PDO sets the {{SQL_ATTR_ODBC_CURSORS}}
connection attribute to {{SQL_CUR_USE_IF_NEEDED}}, which enables cursor
library, if driver does not support fetching in {{PRIOR}} direction (which is
our case). Standard cursor library in its place works incorrectly with the
driver, which causes a lot of issues.
So, the current fix is to add {{SQL_FD_FETCH_PRIOR}} flag for
{{SQL_FETCH_DIRECTION}} driver info.
> 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}
> <?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();
> }
> ?>
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)