Bug #15314

can't add pages or content because adodb sequences are setup incorrectly

Added by Joerg Schoppet over 16 years ago. Updated almost 16 years ago.

Should have
Database API (Doctrine DBAL)
Target version:
Start date:
Due date:
% Done:


Estimated time:
TYPO3 Version:
PHP Version:
Is Regression:
Sprint Focus:


Always if I try to add a page or content, nothing happens.
In the DBAL-DEBUG-LOG I found the following errors:

Number 1:

sqlError Column 'l18n_diffsource' cannot be null
INSERT INTO tt_content ( CType, starttime, endtime, layout, colPos, date, header_position, header_layout, text_align, text_face, text_size, text_color, imagewidth, imageheight, imageorient, imagecols, imagecaption_position, cols, recursive, menu_type, list_type, table_bgColor, table_border, table_cellspacing, table_cellpadding, spaceBefore, spaceAfter, section_frame, splash_layout, sectionIndex, sorting, pid, sys_language_uid, linkToTop, header, header_link, bodytext, rte_enabled, text_properties, hidden, fe_group, l18n_diffsource, tstamp ) VALUES ( 'text', '0', '0', '0', '0', '0', '', '0', '', '0', '0', '0', '0', '0', '8', '0', '', '0', '0', '0', '', '0', '0', '0', '0', '0', '0', '0', '0', '1', '256', '1', '0', '0', 'Test', '', '', '0', '0', '0', '', null, '1135769362' )

Number 2:

sqlError Column 'log_data' cannot be null
INSERT INTO sys_log ( userid, type, action, error, details_nr, details, log_data, tablename, recuid, IP, tstamp, event_pid, NEWid, workspace ) VALUES ( '1', '1', '1', '0', '10', 'Record \'%s\' (%s) was inserted on page \'%s\' (%s)', null, 'tt_content', '1570', '', '1135769362', '0', 'NEW43b27708e0e9b', '0' )

In localconf.php I added the following dbal-lines:
$TYPO3_CONF_VARS['EXTCONF']['dbal']['handlerCfg'] = array(
'_DEFAULT' => array(
'type' => 'native',
$TYPO3_CONF_VARS['EXTCONF']['dbal']['debugOptions'] = array(
'enabled' => TRUE,
'printErrors' => TRUE,
'EXPLAIN' => 1,
'parseQuery' => 1,
'joinTables' => 1,

(issue imported from #M2106)

Related issues

Related to TYPO3 Core - Bug #15317: MySQL Error when installing sys_action with the extension manager in 4.0beta1ClosedKarsten Dambekalns2005-12-28

Related to TYPO3 Core - Bug #15364: SQL error creating a begroupClosedKarsten Dambekalns2006-01-05

Related to TYPO3 Core - Bug #15347: cannot add user or usergroups to fe or be (form is not saved)ClosedKarsten Dambekalns2006-01-03

Has duplicate TYPO3 Core - Bug #15507: Can't create new pagesClosed2006-01-26


Updated by Karsten Dambekalns over 16 years ago

What MySQL version are you using? Any relevant options set (e.g. SQL_MODE)?


Updated by Joerg Schoppet over 16 years ago

it's 4.1.14.

I don't know if there are any relevant options. How do I find them?

If I change the column information from "not nul" to "null" then it works.


Updated by Karsten Dambekalns over 16 years ago

I know what causes this, just have to find the best way to fix it. In DBAL updates/inserts affecting BLOB fields are split. First all non-BLOB fields are handled, then the BLOB fields one after the other - this is needed for databases where for BLOB handling special methods t have to be used.
Now we try to insert null in place of the BLOB in the first pass, this is what goes wrong, because for MySQL we do not drop (NOT) NULL defintions on it (which we do on other systems because of other reasons unrelated to this). Sadly there is no empty_blob() in ANSI SQL...


Updated by Joerg Schoppet over 16 years ago

May I help in any way? Testing or something like that?


Updated by Joerg Schoppet over 16 years ago

the overall behavior now works, BUT
- sometimes (not savely reproducable), when I add new page-content and save I get the error-message "You don't have the proper permissions." The record is saved.
- always when I add content or pages I found the following incomplete message in the log:
Record '%s' (%s) was inserted on page '%s' (%s) (msg#1.1.10)


Updated by Karsten Dambekalns over 16 years ago

THis is now the "master record" for the related bugs...


Updated by Karsten Dambekalns over 16 years ago

1) Do a fresh setup with DBAL enabled from the start -> everything works, I just checked this. PHP 5.1.2, MySQL 4.1.15.
2) Do a fresh setup without DBAL, then install/activate it -> creating records doesn't work.

This is caused by the way auto_increment is handled through ADOdb. It doesn't use MySQL's auto_increment, but rather emulates sequences, when they are not available. If there are already records in a table, and you switch to DBAL, the new (emulated) sequence starts with 1, not with the current highest value (uid). On the next save, this most likely leads to a "duplicate key" error.

The fact that this error isn't visible in the DBAL log is another bug-in-the-bug...


Updated by Joerg Schoppet about 16 years ago

Can I help in any way?


Updated by Nikolas Hagelstein about 16 years ago

Hmm quick and dirty workaround: adjust sequenz start id in adodb (adobe-mysql.inc.php) to something like 10000 ;)


Updated by Joerg Schoppet about 16 years ago

I've just tried Typo3-4.0rc1.
1. When I have just installed adoDB and DBAL without any further configuration the creation of new pages works fine. But if I want to create page-content I get the following error-message:
"102: These fields are not properly updated in database: (l18n_diffsource) Probably value mismatch with fieldtype."
But the content is added.

2. In the Log every message is not right formatted:
Record '%s' (%s) was inserted on page '%s' (%s) (msg#1.1.10)
Record '%s' (%s) was updated. Changes in fields: . (msg#1.2.10)


Updated by Karsten Dambekalns about 16 years ago

Regarding comment 6387: the l18n_diffsource-issue was another bug and has been fixed meanwhile.

I just set up on PostgreSQL with TYPO3, ADOdb, DBAL from today's CVS and installing, creating pages and creating content work fine so far.


Updated by Karsten Dambekalns almost 16 years ago

The upcoming version will solve this by providing a new per-handler configuration option for specifying the initial value of the generated sequences/serials/...

Also available in: Atom PDF