Skip to content

Support oci8 in TableGenerator#136

Closed
dpb587 wants to merge 1 commit into
doctrine:masterfrom
dpb587:bugfix-TableGenerator
Closed

Support oci8 in TableGenerator#136
dpb587 wants to merge 1 commit into
doctrine:masterfrom
dpb587:bugfix-TableGenerator

Conversation

@dpb587

@dpb587 dpb587 commented Apr 28, 2012

Copy link
Copy Markdown
Contributor

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Build Status

This test was breaking when running under oci8 due to Oracle's deference to upper case column names. I realize Oracle has built-in sequences and TableGenerator is unnecessary, in theory, but it seemed like the class should work if possible. I see pgsql is in the same boat.

Tested with:

phpunit -c oci8.phpunit.xml.dist tests/Doctrine/Tests/DBAL/Functional/TableGeneratorTest.php

Before:

PHPUnit 3.5.13 by Sebastian Bergmann.

EE

Time: 0 seconds, Memory: 10.25Mb

There were 2 errors:

1) Doctrine\Tests\DBAL\Functional\TableGeneratorTest::testNextVal
Exception: [Doctrine\DBAL\DBALException] Error occured while generating ID with TableGenerator, aborted generation: Undefined index: sequence_value

2) Doctrine\Tests\DBAL\Functional\TableGeneratorTest::testNextValNotAffectedByOuterTransactions
Exception: [Doctrine\DBAL\DBALException] Error occured while generating ID with TableGenerator, aborted generation: Undefined index: sequence_value

After:

PHPUnit 3.5.13 by Sebastian Bergmann.

..

Time: 1 second, Memory: 10.25Mb

OK (2 tests, 5 assertions)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this, since its depends on the default fetch value which could be assoc. Can you just use array_change_key_case($row, CASE_LOWER) ?

@beberlei

beberlei commented May 5, 2012

Copy link
Copy Markdown
Member

Committed the array_change_key_case() way under your author.

@beberlei beberlei closed this May 5, 2012
@dpb587

dpb587 commented May 5, 2012

Copy link
Copy Markdown
Contributor Author

Thanks.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Sep 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants