Closed morozov closed 2 years ago
Reproduction scenario:
use Doctrine\DBAL\ParameterType;
$conn->query(
<<<SQL
CREATE TABLE test (
id NUMBER NOT NULL,
value CLOB,
PRIMARY KEY (id)
)
SQL
);
$stmt = $conn->prepare('INSERT INTO test VALUES(1, ?)');
$stmt->bindValue(1, 'foo', ParameterType::LARGE_OBJECT);
$stmt->execute();
// ORA-00932: inconsistent datatypes: expected CLOB got BLOB.
It's not critical right now since we don't support stream values of BLOBs either. But once we do, we won't be able to use stream for CLOBs.
I don't think it's fixable. OCI requires manual reading from and writing to the BLOB handle (i.e. start a transaction, query, read/write, commit). While the DBAL API is designed with the expectation that the drivers will do that automatically (all within a single API call).
It could be only accomplished if the DBAL owned the transaction boundaries (e.g. like the ORM does).
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Bug Report
Summary
See the build failure on ContinuousPHP. The Oracle driver handles
ParameterType::LARGE_OBJECT
(which represents both BLOB and CLOB parameters) by creating aOCI_TEMP_BLOB
resource which doesn't work for CLOB columns:https://github.com/doctrine/dbal/blob/3979efeedfda1eda12d30781344583b0ece0a644/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php#L304
Which results in the follwing error:
Apparently, the same issue (#57095) exits in
pdo_oci
since 2006.