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
There was a problem hiding this comment.
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.
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.
@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_CLASSand\PDO::FETCH_OBJfetch modes inibm_db2driverTRUNCATE TABLEstatement generationDROP DATABASEstatement generationThe complete test suite now runs fine on
ibm_db2driver 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_ibmdriver 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 aSELECTstatement:This is weird and I couldn't find out why this does not work on
pdo_ibmbut works onibm_db2.Besides those issues
pdo_ibmruns 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.