Open ZVanoZ opened 2 years ago
Can this somehow be unit-tested in the Oracle
platform tests?
No, in current test system. Pull requst #227 can help do the test. But this request is raw and fix some other bugs.
I asked to give correct test system for laminas-db in https://github.com/laminas/technical-steering-committee/pull/99
Yeah, setting up OracleDB testing on GHA is potentially gonna be painful, but we can add it under services:
See for example: https://github.com/doctrine/dbal/blob/005871fd4f5f938981360b91be6fa11eee64dbb2/.github/workflows/continuous-integration.yml#L131-L158
I am still doing tests and fix. For example, this test give an error.
trait TraitSetup
{
protected function getDriverConfig()
{
$result = [
'driver' => 'Oci8',
'hostname' => $this->variables['hostname'],
'username' => $this->variables['username'],
'password' => $this->variables['password'],
'charset' => 'AL32UTF8',
// 'platform_options' => [
// 'quote_identifiers' => true
// ],
];
return $result;
}
class CharsetTest extends TestCase
{
public function testSelectAdapterAndDbSelect()
{
$adapter = $this->createAdapterWithQuoteIdentifiers();
$select = new \Laminas\Db\Sql\Select();
$select->from([
't' => 'test_charset'
]);
$select->columns([
'field$',
'field_',
'field#',
]);
$plarform = $adapter->getPlatform();
$sqlString = $select->getSqlString($plarform);// Invalid SQL here
$statement = $adapter->createStatement($sqlString);
$result = $statement->execute(); // Exception here
$this->assertInstanceOf(ResultInterface::class, $result);
}
I did test and fix in #238 But github test system is broken!
https://github.com/laminas/laminas-db/runs/5199365331?check_suite_focus=true
1) LaminasIntegrationTest\Db\Adapter\Driver\Pdo\Mysql\AdapterTest::testDriverDisconnectAfterQuoteWithPlatform Failed asserting that true is false.
Error: /github/workspace/test/integration/Adapter/Driver/Pdo/AbstractAdapterTest.php:41 phpvfscomposer:///github/workspace/vendor/phpunit/phpunit/phpunit:97
2. Environment for PHP 8.1 is broken
https://github.com/laminas/laminas-db/runs/5199365672?check_suite_focus=true
E: Unable to locate package php8.1-sqlsrv E: Couldn't find any package by glob 'php8.1-sqlsrv'
3. Environment for PHP 8.1 with latest dependencies is broken
https://github.com/laminas/laminas-db/runs/5199365731?check_suite_focus=true
E: Unable to locate package php8.1-sqlsrv E: Couldn't find any package by glob 'php8.1-sqlsrv'
Bug Report
Summary
For fix the error, just add symbol "#" in platform pattern
Current behavior
Generated SQL is invalid.
How to reproduce
Re-generate the request above
Expected behavior
Symbol "#" does not quote.