-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix IBM DB2 implementation / ibm_db2 driver #447
Conversation
Hello, thank you for creating this pull request. I have automatically opened an issue http://www.doctrine-project.org/jira/browse/DBAL-707 We use Jira to track the state of pull requests and the versions they got |
@deeky666 I would go and remove |
@beberlei Yeah that makes sense, I was thinking about this, too. Shall I remove it in this PR or shall I do it in another PR? Otherwise are you willing to add support for DB2 in general if I do maintenance? |
@deeky666 Remove in this PR and yes about support. |
@beberlei done. |
Fix IBM DB2 implementation / ibm_db2 driver
} | ||
|
||
$sourceReflection = new \ReflectionObject($sourceObject); | ||
$destinationClassReflection = new \ReflectionObject($destinationClass); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks wrong when $destinationClass
was passed as string, as it was then replaced by a ReflectionClass, and you are creating a ReflectionObject for a ReflectionClass instance here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arf no, sorry. It is replaced a second time. The naming of variables is really confusing on this method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stof Yeah this is far from perfect. I have copied and modified this from my SQL Anywhere driver implementation which I coded long time ago and my knowlegde of reflection was not as good back then ;)
This PR is a first approach towards officially supporting IBM DB2 platform in DBAL. The current implementation of the platform and schema manager are very outdated, buggy and incomplete. There is no platform test case yet and running the general DBAL test suite shows a lot of errors.
The focus of this PR is to bring back the DB2 platform and schema manager into sync mit the abstract classes so that at least the test suite runs. Furthermore this PR adds a platform test case. Along with achieving this, a lot of bugs needed to be fixed. The following changes have been made:
\PDO::FETCH_CLASS
and\PDO::FETCH_OBJ
fetch modes inibm_db2
driverTRUNCATE TABLE
statement generationDROP DATABASE
statement generationThe complete test suite now runs fine on
ibm_db2
driver except forTypeConversionTest::testIdempotentDataConversion
:I have tried to find a solution for this issue but apparently this is a driver issue as the decimal separator seems to depend on the system's locale settings. Unfortunately there is no driver option where we could set the desired decimal separator. For now it seems we have to live with it and I guess it works on english locale systems.
The
pdo_ibm
driver reveals more problems as it is still buggy (for years now). The driver still segfaults on decoding CLOB/BLOB resources. So every test that uses BLOBs in any way does not run. The second issue I encountered was a test where a table is referenced quoted in aSELECT
statement:This is weird and I couldn't find out why this does not work on
pdo_ibm
but works onibm_db2
.Besides those issues
pdo_ibm
runs fine.This PR does not make the IBM DB2 implementation perfect yet but it is a good start which is already usable. If we decide on officially supporting this vendor, I would do further work on this.