Bug #15917
closed
Cant create Pages - SQL Error
Added by Martin Holzhauer over 18 years ago.
Updated over 18 years ago.
Category:
Database API (Doctrine DBAL)
Description
Everytime when i wnat to create a Page i got an SQL error that the Column TSConfig cannot be null.
i tryed to add a simple tsconfig that does nothing when creating the page but i got the same error.
2: SQL error: 'Column 'TSconfig' cannot be null' (pages:NEW4428eea01065b)
i have Typo3 4rc2, PHP5.1.2 with APC Cache
Following Extensions are installed
Database Abstraction Layer dbal 0.9.0
htmlArea RTE rtehtmlarea 1.3.6
Versioning Management version 1.0.0
User>Task Center, Actions sys_action 1.1.2
CSS styled content css_styled_content 0.3.1
Indexed Search Engine indexed_search 2.9.0
ADOdb adodb 4.80.0
TYPO3 skin t3skin 0.0.1
(issue imported from #M3017)
Without the DBAL the error is gone
so it seems to be an error with the DBAL
Are you using MySQL5?
Maybe the SQL Query fails because of the sql-mode selected for the server. MySQL5 sets very high standars especially for insert querys. You can try to add the line sql-mode=MYSQL4 in your my.ini and try again.
This happens because media TSconfig have NULL string values in /var/www/html/TYPO3core/typo3/sysext/dbal/class.ux_t3lib_db.php on line 742
The error comes from
function INSERTquery.
Here a null is written for 'B' blob fields which have the database constraint NOT NULL.
....
if($this->sql_field_metatype($table,$k) == 'B') {
$nArr[$this->quoteFieldNames($k)] = 'null';
$blobfields[$this->quoteFieldNames($k)] = $v;
}
---------
Array (3) media
String (4) type blob
String (1) metaType B
Integer notnull 0
Array (3) TSconfig
String (4) type blob
String (1) metaType B
Integer notnull 0
The blob handling was flawed in the sense that it should be skipped for the "native" handler, bit did that only halfway.
In fact it seems as if for "native" the real data never was written for any blob field, which is of course bad. :)
I fixed that and will committ to CVS as soon as it is up again and the RC3 changes have been merged back by Mr. Stucki.
Should be fixed according to Karsten / didn't check.
Also available in: Atom
PDF