Segmentation fault only query with parameter

141 Views Asked by At

I installed the adsdbc-11.10.0.24 connector on a container (docker). I use this connection with php + symfony. When I query the database with a query without parameters I get a result. On the other hand, if I use parameters, I get a Segmentation fault error.

I have testing with PDO sql connexion, request with parameters works. It's not a symfony problem.

Is there a special library needed?

My odbc.ini file:

[ODBC Data Sources]
CAFETERIA_ODBC = Advantage ODBC Driver

[CAFETERIA_ODBC]
Driver=/usr/local/ads/odbc/redistribute/x64/libadsodbc.so
Setup=/usr/local/ads/odbc/redistribute/x64/libadsodbc.so
DataDirectory=\\172.22.9.4:6262\CAFTECH\DBF
Description=Advantage ODBC driver
DefaultType=FoxPro
MaxTableCloseCache=0
LOCKING=FILE
CharSet=ANSI
Language=ANSI
Compression=INTERNET
ADVANTAGELOCKING=ON
ServerTypes=2
CommType=TCP_IP
TableExtension=
TrimTrailingSpaces=TRUE

A query that works :

$cafeteriaEm = $this->getContainer()->get('doctrine.orm.advantage_entity_manager');
$rawSql = "
    SELECT *
    FROM assure
    WHERE assure='10679257'
    ";
$stmt  = $cafeteriaEm->getConnection()->prepare($rawSql);
$stmt->execute();
$assures= $stmt->fetchAll();

A request that does not work (Segmentation fault )

$rawSql = "
    SELECT *
    FROM assure
    WHERE assure=:assure;
    ";
$stmt  = $cafeteriaEm->getConnection()->prepare($rawSql);
$stmt->bindValue(':assure', '10679257');
$stmt->execute();
$assures= $stmt->fetchAll();
dump($assures);
0

There are 0 best solutions below