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

Igor Sapego commented on IGNITE-4113:
-------------------------------------

It seems to be a PDO issue. Our driver works as intended. When I run PHP in GDB 
I can see that it crashes on its own after calling to even through we return 
valid data.

That's what GDB showed:
{noformat}
#0  0x00007ffff494e131 in extract_sql_error_rec (head=0x1126648, sqlstate=0x18 
<error: Cannot access memory at address 0x18>, rec_number=1, 
native_error=0x220, 
    message_text=0x1e <error: Cannot access memory at address 0x1e>, 
buffer_length=511, text_length=0x7fffffff9d6a) at SQLGetDiagRec.c:302
#1  0x00007ffff494ebb8 in SQLGetDiagRec (handle_type=2, handle=0x1126070, 
rec_number=1, sqlstate=0x18 <error: Cannot access memory at address 0x18>, 
native=0x220, 
    message_text=0x1e <error: Cannot access memory at address 0x1e>, 
buffer_length=511, text_length_ptr=0x7fffffff9d6a) at SQLGetDiagRec.c:667
#2  0x00007ffff472180b in pdo_odbc_error () from 
/usr/lib/php5/20121212/pdo_odbc.so
#3  0x00007ffff472231c in ?? () from /usr/lib/php5/20121212/pdo_odbc.so
#4  0x00007ffff4fe96b9 in ?? () from /usr/lib/php5/20121212/pdo.so
#5  0x00000000006ddbcb in dtrace_execute_internal ()
#6  0x000000000079cf60 in ?? ()
#7  0x0000000000717898 in execute_ex ()
#8  0x00000000006ddac9 in dtrace_execute_ex ()
#9  0x000000000079d5b0 in ?? ()
#10 0x0000000000717898 in execute_ex ()
#11 0x00000000006ddac9 in dtrace_execute_ex ()
#12 0x00000000006ef150 in zend_execute_scripts ()
#13 0x000000000068f9b5 in php_execute_script ()
#14 0x000000000079ef3e in ?? ()
#15 0x0000000000461dc0 in main ()
{noformat}

It seems that PDO passes invalid pointer to ODBC manager (value is 0x18, DM 
would not crash if it was NULL).

So it seems like PDO bug to me.

> ODBC with php PDO: CLI crash when execute query using scrollable cursor and 
> FETCH_ORI_LAST, FETCH_ORI_PRIOR
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: IGNITE-4113
>                 URL: https://issues.apache.org/jira/browse/IGNITE-4113
>             Project: Ignite
>          Issue Type: Bug
>          Components: odbc
>    Affects Versions: 1.6
>            Reporter: Ksenia Rybakova
>            Assignee: Igor Sapego
>             Fix For: 1.8
>
>
> Setup:
> Windows 10
> php7.0 + php PDO
> Ignite ODBC driver is installed
> DSN is set up
> CLI crash (when running from command line) and "Process finished with exit 
> code -1073741819 (0xC0000005)" (when running from IDE) when execute the 
> following php function:
> {noformat}
> function check_query_with_scrollable_cursor($dbh) {
>     try {
>         $dbs = $dbh->prepare('SELECT firstName, lastName, salary FROM 
> "Persons".Person', array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL)); 
>         $dbs->execute();
>         $row = $dbs->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_LAST);
>         do {
>             print $row[0] . "\t" . $row[1] . "\t" . $row[2] . "\n";
>         } while ($row = $dbs->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_PRIOR));
>     } catch (PDOException $e) {
>         print "Error: " . $e->getMessage() . "\n";
>     } finally {
>         $dbs = null;
>     }
> }
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to