after 4 days (!?) development, DB2 driver for D6 is now ready for testing. it take IBM's D5 DB2 implementation as base reference, and reuse almost all D6 oracle driver (http://drupal.org/node/39260) special handling for overcoming DB2-specific limitations.
DB2-specific limitations includes:
- map "text:big" to "VARCHAR(4000)", as like as oracle driver's handling. this is all due to DB2 max table space limitation, even it can support for max. 32672 characters for VARCHAR.
- BLOB/CLOB also require special handling for INSERT/UPDATE query (so reuse LOBs patch's hook). even DB2 allow direct insert of BLOB/CLOB within query body, it will easy to be oversize when inserting a huge block of contect (e.g. menu cache contant 140K of characters, which will cause error when INSERT/UPDATE). again, similar handling as oracle driver
- once again, we don't have perfect db_num_rows() implementation within DB2, so just simply forget about it. it will reuse the progress of "remove db_num_rows()" patch: nothing special other than this.
- name of constraint can only be max. 18 characters, where column only support for max. 30 characters (yup, even worse than oracle: both max. 30). here i will need to split the trimming action into 2 parts: first handle constraint limitation, and than column. for all others (e.g. table or index name, can support for max. 128 characters), will be handled as like as column (max. 30) for standardize
- a huge size of reserved word list, when compare with ANSI. it comes with 168 (!?) extra reserved words, when compare with all version of ANSI standard. BTW, just feel free about this, we did similar rewrite action for oracle driver, and so it is just a simple clone
how come it can be complete within such short period (only 4 days)? the reason is very simple: we have already discover almost all special handle for overcoming database-specific limitation, when implementing oracle driver. we only need to clone, and rewrite those handle for DB2, and that's all :)
again, it is depending on 2 important patches due to cross DB compatibility concern: LOBs patch (http://drupal.org/node/147947) and "remove db_num_rows()" patch (http://drupal.org/node/163191). surly we also face some other small bugs among core modules, based on "query friendly" concern, but this is not a great problem. they can be handled one by one :)
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | drupal-6.x-dev-db2-0.5.patch | 49.66 KB | hswong3i |
| drupal-6.x-dev-db2-0.4.diff | 47.1 KB | hswong3i |
Comments
Comment #1
hswong3i commentedbug fix, code clean up, and function backport from Oracle and MSSQL driver. includes:
patch required:
http://drupal.org/node/165957
http://drupal.org/node/147947
Comment #2
gnumatrix commentedHi there...
I gave this a try but couldn't make it through the installation script. It created tables in DB2 but the install fell apart shortly thereafter. As this was my very first attempt/experience with Drupal of any kind, I was trying pretty hard to get it to work, but didn't know much about why. I've since installed 5.2 with MySQL and got that to work without any issues at all.
Curiously, this post of yours doesn't show up when I search Drupal for DB2? But it does in google. To me, this is a huge deal as DB2-C (free) would make an impressive addition to Drupal's already quite capable features.
Do you have a set of procedures to follow to get this to work? I was trying it on an Ubuntu system, and had to jump through a lot of hoops to get the PDO stuff to work, and IBM_DB2 PHP support, etc. I did get all that done, but there should be a guide. I'd make one, but I obviously didn't do it right if it didn't work...
Comment #3
hswong3i commentedsorry that since i am now focusing on another 3 related patches: http://drupal.org/node/165957, http://drupal.org/node/147947 and http://drupal.org/node/168403, the update of the patch will be a bit late...
this patch is written for PHP IBM_DB2 (which should be the one that you mentioned). procedure shouldn't be too difficult:
i will try my best to document the detail procedures as reference, as soon as i can (which similar as that for Oracle driver).
BTW, unless those patches listed above are all committed, both Oracle/DB2/MSSQL/etc will NEVER success. please find out the above patches, get, test and comment about it, in order to speed up multiple database supporting within D6 ;)
Comment #4
hswong3i commentedas mentioned in http://drupal.org/node/147947, this issue can seems as failed within D6 official development (yup, we fail for this once again... how pity...). BTW, this patch will not died: i will merge it together with Oracle driver (and also their related patches) into a single patch file, and keep on updating it within D6 life cycle. so people who are interested in this topic can get such supporting ON TIME, but not sit and waiting for D7 comes. i guess most of the projects needed for such unofficial patch are enterprise-related project, such little tailor-made handling may be acceptable for their professional and skillful developer :)
Comment #5
hswong3i commentedI am still working with this topic. As PDO and Oracle supporting by Siren is quite stable, the single and shared core code base should also suitable for DB2 development. On the other hand, as DB2 v9.5 is now released, the driver implementation should be much simpler. Please feel free to contact me if you are interesting in this topic ;-)
(This is part of my personal research project Siren's issue.)
Comment #6
derwiki commentedHi hswong3i,
I'm a little new to trying things outside of MySQL for Drupal, but I am very interested in getting Drupal to work with DB2 Express-C. I'm a little confused though: where can I find the database.db2.inc file that you're working on? How is development going, are you still working on it at all?
thanks,
Adam
Comment #7
mav_ren commentedHi hswong3i,
Im trying to install Drupal on a Z series IBM Server using DB2 and was wondering how you were going with the DB2 support? Is development still active?
Thanks,
Matthew Tapper
Comment #8
hswong3i commentedCurrently I host the project in here: http://sourceforge.net/projects/siren/
Comment #9
Crell commentedNot in core. It can be done in contrib if anyone is interested.
Comment #10
thamizhg commentedhai,
i am trying to use drupal with DB2. i created database.db2.inc and install.db2.inc file with the help of some patches.
Drupal get installed and it goes to initial site configuration page. after submitting that page, cache table update query is getting failed. It says too large size value to the data filed in cache table. But i am using data field with clob(2G).
pls anyone help me to resolve this.
Comment #11
Crell commentedDB2 is not supported for Drupal 6 or Drupal 7 in core, and won't be supported in Drupal 8 core either. If you want to work on a DB2 driver, please start a contrib project and do not re-open dead core issues.
Note that the Drupal 7 DB layer is completely rewritten, so you're much better off starting with that as work done on a Drupal 6 driver would not really be helpful at all going forward.
Comment #12
mawool commentedHello, i'm a newbie on drupal.
Now, i'm working with Drupal and DB2. but i still can't connect them.
there are 2 patches required that i can't have it because i don't understand how to use CVS.
May i have files on http://drupal.org/node/165957 and http://drupal.org/node/147947 like system.schema and the other on that issues.
thank before...
regards,