-
Bug
-
Resolution: Done
-
Major
-
11.0, 11.2
-
None
-
All infrastructure is Dockerized on Windows 64bit (see below)
WildFly Full 11.0.0.Final (WildFly Core 3.0.8.Final)
Teiid Engine 11.2.0
DatabaseProductVersion=11.1 (Debian 11.1-1.pgdg90+1)
PostgreSQL JDBC Driver=42.2.5PDO Driver for PostgreSQL (from phpinfo())
PostgreSQL(libpq) Version: 9.6.10
Module version: 7.1.26All infrastructure is Dockerized on Windows 64bit (see below) WildFly Full 11.0.0.Final (WildFly Core 3.0.8.Final) Teiid Engine 11.2.0 DatabaseProductVersion=11.1 (Debian 11.1-1.pgdg90+1) PostgreSQL JDBC Driver=42.2.5 PDO Driver for PostgreSQL (from phpinfo()) PostgreSQL(libpq) Version: 9.6.10 Module version: 7.1.26
On Teiid 11.0 (and probably later versions, as well) running in a WildFly there is a problem when binding to a NULLABLE parameter in a prepared statement with NULL value when running against a PostgreSQL source from a PDO (PHP) ODBC client.
PDO calls causing the error are related to PDOStatement::bindValue
and PDOStatement::bindParam.
It occurs exclusively when the client is trying to bind a NULL value (corresponding to a NULLABLE column in a table) to the prepared statement using PDO::PARAM_NULL type.
Example PHP code
$dbh = new PDO('pgsql:host=<teiid_host>;port=35432;dbname=<vdb_name>;user=<teiid_user>;password=<teiid_password>'); $stmt = $dbh->prepare("INSERT INTO foobar (id, optional) VALUES(?, ?)"); $stmt->bindValue(1, 1); $stmt->bindValue(2, null, PDO::PARAM_NULL); $stmt->execute();
Exception thrown is
Caused by: java.lang.NegativeArraySizeException
at org.teiid.transport.PgFrontendProtocol.createByteArray(PgFrontendProtocol.java:328)
at org.teiid.transport.PgFrontendProtocol.buildBind(PgFrontendProtocol.java:266)
at org.teiid.transport.PgFrontendProtocol.createRequestMessage(PgFrontendProtocol.java:153)
at org.teiid.transport.PgFrontendProtocol.decode(PgFrontendProtocol.java:133)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:411)
... 15 more
- is related to
-
TEIID-5617 Insert command complete for pg/odbc is incorrect
-
- Resolved
-