[TYPO3-dev] More than 4000 characters in a CLOB [HAPPY :-)]

Xavier Perseguers typo3 at perseguers.ch
Thu May 7 16:25:52 CEST 2009


Hi Masi,

>>>> Was someone successful in storing more than 4000 characters in an Oracle
>>>> CLOB? Because having an UPDATE or INSERT statement in TYPO3 is not
>>>> carefully handled by AdoDB when having a CLOB field.
>>> Maybe TEXT is mapped to VARCHAR(4000) instead of CLOB. Did you check the
>>> TABLE definitions?
>> Yes, it is mapped to CLOB, that's OK but as I said, more than 4000
>> characters *cannot* be sent directly with an UPDATE/INSERT statement.
> 
> I know, but ADOdb knows that too.  For PostgreSQL this works alright and
> PostgreSQL also requires you to store/retrieve LOBs with special means.

I finally found the reason why it does not work in my case!!!

I found that DBAL is not fair enough when dealing with mapped table 
names. It cannot find the type of the column and use the correct 
handling for blobs/clobs when having this in localconf.php for instance:

$TYPO3_CONF_VARS['EXTCONF']['dbal']['mapping'] = array(
     'tx_templavoila_datastructure' => array(
         'mapTableName' => 'tx_templavoila_ds',
     ),
);

As the method sql_field_metatype is called with the mapped table name 
(tx_templavoila_ds) and not the original name 
(tx_templavoila_datastructure) meaning an empty string is returned and 
DBAL thinks it is a normal string and does not use the special handling.

I now have to patch this ;-)

-- 
Xavier Perseguers
DBAL-Member

http://xavier.perseguers.ch/en/tutorials/typo3.html




More information about the TYPO3-dev mailing list