Skip to content

Commit

Permalink
Test pdo_oci NCLOB read fix in image-php in CI (#978)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Mar 24, 2022
1 parent 2eec89e commit 8a19968
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ jobs:
name: Unit
runs-on: ubuntu-latest
container:
# Alpine support for newer pdo_oci is broken, see https://github.com/mlocati/docker-php-extension-installer/issues/523
# remove once config.m4 checks are working on Alpine
image: ghcr.io/mvorisek/image-php:${{ matrix.php }}-debian
image: ghcr.io/mvorisek/image-php:${{ matrix.php }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -227,8 +225,7 @@ jobs:
php -d opcache.enable_cli=1 vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) -v
if [ -n "$LOG_COVERAGE" ]; then mv coverage/phpunit.cov coverage/phpunit-oracle-pdo.cov; fi
- name: "Run tests: Oracle - OCI8 (only for coverage or cron)"
if: env.LOG_COVERAGE || github.event_name == 'schedule'
- name: "Run tests: Oracle - OCI8"
env:
DB_DSN: "oci8:dbname=oracle/xe"
DB_USER: system
Expand Down
11 changes: 4 additions & 7 deletions tests/Schema/ModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,6 @@ private function makePseudoRandomString(bool $isBinary, int $lengthBytes): strin
*/
public function testCharacterTypeFieldLong(string $type, bool $isBinary, int $lengthBytes): void
{
// remove once long multibyte Oracle CLOB stream read support is fixed in pdo_oci ext (oci8 is NOT affected)
// https://github.com/php/php-src/pull/8018
if ($this->getDatabasePlatform() instanceof OraclePlatform
&& $this->db->connection->connection()->getNativeConnection() instanceof \PDO && $type === 'text') {
$lengthBytes = min($lengthBytes, 8190);
}

if ($lengthBytes === 0) {
$str = '';

Expand Down Expand Up @@ -247,6 +240,10 @@ public function providerCharacterTypeFieldLongData(): array
['binary', true, 255],
['text', false, 255],
['blob', true, 255],
// expected to fail with pdo_oci driver, multibyte Oracle CLOB stream read support
// is broken with long strings, oci8 driver is NOT affected,
// CI images ghcr.io/mvorisek/image-php are patched
// remove comment once https://github.com/php/php-src/pull/8018 is merged & released
['text', false, 256 * 1024],
['blob', true, 256 * 1024],
];
Expand Down

0 comments on commit 8a19968

Please sign in to comment.