Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.5.0b5

Bug #14639 oci8 and text fields
Submitted: 2008-09-11 23:33 UTC
From: haggholm Assigned: quipo
Status: Closed Package: MDB2 (version 2.4.1)
PHP Version: 5.2.3 OS: Any
Roadmaps: (Not assigned)    
Comments Add Comment Add patch

Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem : 44 - 15 = ?

 [2008-09-11 23:33 UTC] haggholm (Petter Häggholm)
Description: ------------ We write an application that runs on three different DBMS backends. Certain fields (in a lot of tables) are typically declared as TEXT, but not in Oracle, which has no TEXT type. Instead, these fields are declared as CLOBs. When retrieving data using e.g. getRow(), if I specify no type array, things work just fine (it works out that it's a CLOB and copes). However, if I specify a type of "text", things go very wrong -- it retrieves a value of "object". I realise that this is not a straightforward bug in that the proper type may well be considered "clob". However, since Oracle offers no TEXT type, and TEXT is the logical type to use in any other DBMS, and "text" is the logical MDB2 type to associate with TEXT fields, I suggest that it would be a lot more sensical and clear to users if MDB2 could convert these CLOBs to proper strings. Test script: --------------- print_r($db->getOne('SELECT text_field FROM table', 'text')); Expected result: ---------------- "some sort of text" Actual result: -------------- "object"


 [2008-09-12 00:06 UTC] haggholm (Petter Häggholm)
Another obvious (not necessarily nice!) option is to add a new MDB2 datatype, e.g. "bigtext", that maps to either TEXT or CLOB, or is perhaps more flexible in querying the data. I haven't delved into the guts of this in the MDB2 files (too much else going on right now; it's crunch time here!), so I do not know how much work any one solution would require.
 [2008-10-07 10:59 UTC] quipo (Lorenzo Alberton)
I've committed a fix to automatically fetch a CLOB field when retrieved with 'text' data type. Please fetch the CVS version and give it a go. The 'bigtext' type is not an option at this time, I'm afraid.