Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
r2403: Duplicate entry '0-lastmod'
Fresh install a couple of revisions back: going to prefs, as far as I can see any save with a setting edited give multiple times this error:
Warning: Duplicate entry '0-lastmod' for key 1 insert into txp_txp_prefs set name = 'lastmod', val = now() in /home.10.5/dorem/sous/bbe/textpattern/lib/txplib_db.php on line 84
I updated to 2403, same thing.
Diag:
Version de Textpattern: 4.0.4 (r2403)
Dernière mise à jour: 2007-06-04 18:56:48/2007-06-04 18:37:48
Document racine: /home.10.5/dorem/sous/bbe
$path_to_site: /home.10.5/dorem/sous/bbe
Chemin d’accès à Textpattern: /home.10.5/dorem/sous/bbe/textpattern
Format des URL: section_title
Répertoire temporaire: /home/dorem/sous/bbe/textpattern/tmp
URL du site: bbe.dorem.info
Version de PHP: 5.2.1
Register globals PHP: 1
Bibliothèque GD: bundled (2.0.28 compatible) formats supportés : GIF, JPG, PNG.
Date & heure du serveur: 2007-06-04 21:01:42
MySQL: 5.0.26-log
Locale: fr_FR.UTF-8
Serveur: Apache
API PHP du serveur: cgi
Entêtes RFC 2616: 0
Système d’exploitation serveur: Linux 2.6.18.1-grsec-mutu-grs-ipv4-32Vérifications:
————————————
/home.10.5/dorem/sous/bbe/textpattern/setup/ existe encore
————————————contenu du fichier .htaccess:
————————————
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#RewriteBase /relative/web/path/<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+) – [PT,L]
RewriteRule ^(.*) index.php
</IfModule>#php_value register_globals 0
————————————
Offline
Re: r2403: Duplicate entry '0-lastmod'
Can you set TXP_DEBUG to “1” in /textpattern/lib/constants.php and post the queries it shows when saving something?
It shouldn’t be related to SVN revision 2394, but perhaps you can check to make sure. I can’t reproduce it in rev 2403.
Last edited by ruud (2007-06-04 19:23:55)
Offline
Re: r2403: Duplicate entry '0-lastmod'
Yup (in 2403):
describe `txp_textpattern`
select val from txp_txp_prefs as txp_prefs where name = 'version'
select name, val from txp_txp_prefs as txp_prefs where prefs_id=1
select name from txp_txp_lang as txp_lang where lang='fr-fr' limit 1
select name, data from txp_txp_lang as txp_lang where lang='fr-fr'
select nonce from txp_txp_users as txp_users where name='Jérémie'
select name, code, version from txp_txp_plugin as txp_plugin where status = 1 and type='1'
select privs from txp_txp_users as txp_users where name='Jérémie'
select name from txp_txp_prefs as txp_prefs where prefs_id = 1
update txp_txp_prefs set val = '%Oe %B %Y, %H:%M' where name = 'archive_dateformat' and prefs_id = 1
update txp_txp_prefs set val = now() where name = 'lastmod'
update txp_txp_prefs set val = '1' where name = 'comments_are_ol' and prefs_id = 1
update txp_txp_prefs set val = now() where name = 'lastmod'
insert into txp_txp_prefs set name = 'lastmod', val = now()
Warning: Duplicate entry '0-lastmod' for key 1 insert into txp_txp_prefs set name = 'lastmod', val = now() in /home.10.5/dorem/sous/bbe/textpattern/lib/txplib_db.php on line 84
update txp_txp_prefs set val = '1' where name = 'comments_auto_append' and prefs_id = 1
Duplicate entry '0-lastmod' for key 1
update txp_txp_prefs set val = now() where name = 'lastmod'
insert into txp_txp_prefs set name = 'lastmod', val = now()
Warning: Duplicate entry '0-lastmod' for key 1 insert into txp_txp_prefs set name = 'lastmod', val = now() in /home.10.5/dorem/sous/bbe/textpattern/lib/txplib_db.php on line 84
update txp_txp_prefs set val = '%x %H:%M' where name = 'comments_dateformat' and prefs_id = 1
Duplicate entry '0-lastmod' for key 1
update txp_txp_prefs set val = now() where name = 'lastmod'
insert into txp_txp_prefs set name = 'lastmod', val = now()
Warning: Duplicate entry '0-lastmod' for key 1 insert into txp_txp_prefs set name = 'lastmod', val = now() in /home.10.5/dorem/sous/bbe/textpattern/lib/txplib_db.php on line 84
update txp_txp_prefs set val = 'Commentaire' where name = 'comments_default_invite' and prefs_id = 1
Duplicate entry '0-lastmod' for key 1
update txp_txp_prefs set val = now() where name = 'lastmod'
insert into txp_txp_prefs set name = 'lastmod', val = now()
Warning: Duplicate entry '0-lastmod' for key 1 insert into txp_txp_prefs set name = 'lastmod', val = now() in /home.10.5/dorem/sous/bbe/textpattern/lib/txplib_db.php on line 84
update txp_txp_prefs set val = '42' where name = 'comments_disabled_after' and prefs_id = 1
Duplicate entry '0-lastmod' for key 1
update txp_txp_prefs set val = now() where name = 'lastmod'
insert into txp_txp_prefs set name = 'lastmod', val = now()
Warning: Duplicate entry '0-lastmod' for key 1 insert into txp_txp_prefs set name = 'lastmod', val = now() in /home.10.5/dorem/sous/bbe/textpattern/lib/txplib_db.php on line 84
update txp_txp_prefs set val = '0' where name = 'comments_mode' and prefs_id = 1
Duplicate entry '0-lastmod' for key 1
update txp_txp_prefs set val = now() where name = 'lastmod'
insert into txp_txp_prefs set name = 'lastmod', val = now()
Warning: Duplicate entry '0-lastmod' for key 1 insert into txp_txp_prefs set name = 'lastmod', val = now() in /home.10.5/dorem/sous/bbe/textpattern/lib/txplib_db.php on line 84
update txp_txp_prefs set val = '1' where name = 'comments_moderate' and prefs_id = 1
Duplicate entry '0-lastmod' for key 1
update txp_txp_prefs set val = now() where name = 'lastmod'
insert into txp_txp_prefs set name = 'lastmod', val = now()
Warning: Duplicate entry '0-lastmod' for key 1 insert into txp_txp_prefs set name = 'lastmod', val = now() in /home.10.5/dorem/sous/bbe/textpattern/lib/txplib_db.php on line 84
update txp_txp_prefs set val = '0' where name = 'comments_on_default' and prefs_id = 1
Duplicate entry '0-lastmod' for key 1
update txp_txp_prefs set val = now() where name = 'lastmod'
insert into txp_txp_prefs set name = 'lastmod', val = now()
Warning: Duplicate entry '0-lastmod' for key 1 insert into txp_txp_prefs set name = 'lastmod', val = now() in /home.10.5/dorem/sous/bbe/textpattern/lib/txplib_db.php on line 84
update txp_txp_prefs set val = '1' where name = 'comments_sendmail' and prefs_id = 1
Duplicate entry '0-lastmod' for key 1
update txp_txp_prefs set val = now() where name = 'lastmod'
insert into txp_txp_prefs set name = 'lastmod', val = now()
Warning: Duplicate entry '0-lastmod' for key 1 insert into txp_txp_prefs set name = 'lastmod', val = now() in /home.10.5/dorem/sous/bbe/textpattern/lib/txplib_db.php on line 84
update txp_txp_prefs set val = '%Oe %B %Y, %H:%M' where name = 'dateformat' and prefs_id = 1
Duplicate entry '0-lastmod' for key 1
update txp_txp_prefs set val = now() where name = 'lastmod'
insert into txp_txp_prefs set name = 'lastmod', val = now()
Warning: Duplicate entry '0-lastmod' for key 1 insert into txp_txp_prefs set name = 'lastmod', val = now() in /home.10.5/dorem/sous/bbe/textpattern/lib/txplib_db.php on line 84
update txp_txp_prefs set val = '+3600' where name = 'gmtoffset' and prefs_id = 1
Duplicate entry '0-lastmod' for key 1
update txp_txp_prefs set val = now() where name = 'lastmod'
insert into txp_txp_prefs set name = 'lastmod', val = now()
Warning: Duplicate entry '0-lastmod' for key 1 insert into txp_txp_prefs set name = 'lastmod', val = now() in /home.10.5/dorem/sous/bbe/textpattern/lib/txplib_db.php on line 84
update txp_txp_prefs set val = '0' where name = 'is_dst' and prefs_id = 1
Duplicate entry '0-lastmod' for key 1
update txp_txp_prefs set val = now() where name = 'lastmod'
insert into txp_txp_prefs set name = 'lastmod', val = now()
Warning: Duplicate entry '0-lastmod' for key 1 insert into txp_txp_prefs set name = 'lastmod', val = now() in /home.10.5/dorem/sous/bbe/textpattern/lib/txplib_db.php on line 84
update txp_txp_prefs set val=now() where name='lastmod'
Duplicate entry '0-lastmod' for key 1
update txp_txp_prefs set val = now() where name = 'lastmod'
insert into txp_txp_prefs set name = 'lastmod', val = now()
Warning: Duplicate entry '0-lastmod' for key 1 insert into txp_txp_prefs set name = 'lastmod', val = now() in /home.10.5/dorem/sous/bbe/textpattern/lib/txplib_db.php on line 84
update txp_txp_prefs set val = 'all' where name = 'logging' and prefs_id = 1
Duplicate entry '0-lastmod' for key 1
update txp_txp_prefs set val = now() where name = 'lastmod'
insert into txp_txp_prefs set name = 'lastmod', val = now()
Warning: Duplicate entry '0-lastmod' for key 1 insert into txp_txp_prefs set name = 'lastmod', val = now() in /home.10.5/dorem/sous/bbe/textpattern/lib/txplib_db.php on line 84
update txp_txp_prefs set val = 'section_title' where name = 'permlink_mode' and prefs_id = 1
Duplicate entry '0-lastmod' for key 1
update txp_txp_prefs set val = now() where name = 'lastmod'
insert into txp_txp_prefs set name = 'lastmod', val = now()
Warning: Duplicate entry '0-lastmod' for key 1 insert into txp_txp_prefs set name = 'lastmod', val = now() in /home.10.5/dorem/sous/bbe/textpattern/lib/txplib_db.php on line 84
update txp_txp_prefs set val = '1' where name = 'prefs_id' and prefs_id = 1
Duplicate entry '0-lastmod' for key 1
update txp_txp_prefs set val = now() where name = 'lastmod'
insert into txp_txp_prefs set name = 'lastmod', val = now()
Warning: Duplicate entry '0-lastmod' for key 1 insert into txp_txp_prefs set name = 'lastmod', val = now() in /home.10.5/dorem/sous/bbe/textpattern/lib/txplib_db.php on line 84
update txp_txp_prefs set val = 'testing' where name = 'production_status' and prefs_id = 1
Duplicate entry '0-lastmod' for key 1
update txp_txp_prefs set val = now() where name = 'lastmod'
insert into txp_txp_prefs set name = 'lastmod', val = now()
Warning: Duplicate entry '0-lastmod' for key 1 insert into txp_txp_prefs set name = 'lastmod', val = now() in /home.10.5/dorem/sous/bbe/textpattern/lib/txplib_db.php on line 84
update txp_txp_prefs set val = 'BlackBox' where name = 'sitename' and prefs_id = 1
Duplicate entry '0-lastmod' for key 1
update txp_txp_prefs set val = now() where name = 'lastmod'
insert into txp_txp_prefs set name = 'lastmod', val = now()
Warning: Duplicate entry '0-lastmod' for key 1 insert into txp_txp_prefs set name = 'lastmod', val = now() in /home.10.5/dorem/sous/bbe/textpattern/lib/txplib_db.php on line 84
update txp_txp_prefs set val = 'bbe.dorem.info' where name = 'siteurl' and prefs_id = 1
Duplicate entry '0-lastmod' for key 1
update txp_txp_prefs set val = now() where name = 'lastmod'
insert into txp_txp_prefs set name = 'lastmod', val = now()
Warning: Duplicate entry '0-lastmod' for key 1 insert into txp_txp_prefs set name = 'lastmod', val = now() in /home.10.5/dorem/sous/bbe/textpattern/lib/txplib_db.php on line 84
update txp_txp_prefs set val = 'L\'univers des jeux de rôles – en magazine' where name = 'site_slogan' and prefs_id = 1
Duplicate entry '0-lastmod' for key 1
update txp_txp_prefs set val = now() where name = 'lastmod'
insert into txp_txp_prefs set name = 'lastmod', val = now()
Warning: Duplicate entry '0-lastmod' for key 1 insert into txp_txp_prefs set name = 'lastmod', val = now() in /home.10.5/dorem/sous/bbe/textpattern/lib/txplib_db.php on line 84
update txp_txp_prefs set val = '1' where name = 'use_comments' and prefs_id = 1
Duplicate entry '0-lastmod' for key 1
update txp_txp_prefs set val = now() where name = 'lastmod'
insert into txp_txp_prefs set name = 'lastmod', val = now()
Warning: Duplicate entry '0-lastmod' for key 1 insert into txp_txp_prefs set name = 'lastmod', val = now() in /home.10.5/dorem/sous/bbe/textpattern/lib/txplib_db.php on line 84
update txp_txp_prefs set val = '1' where name = 'use_textile' and prefs_id = 1
Duplicate entry '0-lastmod' for key 1
update txp_txp_prefs set val = now() where name = 'lastmod'
insert into txp_txp_prefs set name = 'lastmod', val = now()
Warning: Duplicate entry '0-lastmod' for key 1 insert into txp_txp_prefs set name = 'lastmod', val = now() in /home.10.5/dorem/sous/bbe/textpattern/lib/txplib_db.php on line 84
select privs from txp_txp_users as txp_users where name = 'Jérémie'
Duplicate entry '0-lastmod' for key 1
Last edited by Jeremie (2007-06-04 19:25:27)
Offline
Re: r2403: Duplicate entry '0-lastmod'
ruud wrote:
It shouldn’t be related to SVN revision 2394, but perhaps you can check to make sure. I can’t reproduce it in rev 2403.
I can try going back to 2393, but the DB won’t go back with the files.
Offline
Re: r2403: Duplicate entry '0-lastmod'
Ok, yes it’s the switch from safe_update to safe_upsert that create the error. I can’t trigger it before 2394, and 2394 triggers it every time.
Last edited by Jeremie (2007-06-04 19:33:54)
Offline
Re: r2403: Duplicate entry '0-lastmod'
Looks like safe_upsert is buggy, due to the user of mysql_affected_rows():
When using UPDATE, MySQL will not update columns where the new value is the same as the old value. This creates the possibility that mysql_affected_rows() may not actually equal the number of rows matched, only the number of rows that were literally affected by the query.
So when safe_upsert first attempts an update and doesn’t really change anything, it thinks the update failed and tries an insert. You can see this happening in your queries. The first update for lastmod succeeds (changes it to a new value), but the following updates happen so fast that time hasn’t changed, so the last modified date is still the same, so the update appears to fail (it doesn’t, really) and safe_upsert tries an insert, which fails because the lastmod key is already there.
Offline
Re: r2403: Duplicate entry '0-lastmod'
Try SVN revision 2405 please. It doesn’t really fix the upsert problem, but does remove a lot of unneeded updates to the lastmod preference, which should reduces the chance of seeing that ‘duplicate entry’ error quite a bit.
Offline
Re: r2403: Duplicate entry '0-lastmod'
Thanks for the time being :)
Offline
Re: r2403: Duplicate entry '0-lastmod'
Revision 2406 should fix the safe_upsert problem.
Last edited by ruud (2007-06-04 21:26:33)
Offline
Pages: 1