[pLog-svn] addcomment sql error

Jon Daley plogworld at jon.limedaley.com
Sun Jul 16 21:19:38 GMT 2006


 	That is alright for updating an article on an edit-post post, but 
when adding a comment, it doesn't seem like you should have to change the 
article_categories_link at all, but just leave it where it was.

On Mon, 17 Jul 2006, Oscar Renalias wrote:
> my logic is that when updating an article, since we don't know which 
> categories have been added and which have been removed, it's a lot faster to 
> remove all rows in the article_categories_link that belong to that particular 
> article and recreate all of them again with the new list of categories. 
> Otherwise we'd need to compare with the previous version of the article to 
> remove the ones that are not linked to anymore, and add the new ones.
>
> On 17 Jul 2006, at 00:06, Jon Daley wrote:
>
>> 	Why are they deleted? On Mon, 17 Jul 2006, Oscar Renalias wrote:
>> 
>>> I need to look into this, it could be a bug in the code that handles
>>> the updates of articles. Basically, article counters are updated every
>>> time a comment is received and in order to update the links "combo"
>>> table that links articles and categories, we first delete all pairs
>>> and then recreate them all again. It could be that data is not being
>>> deleted correctly and when inserting the new pairs again, it obviously
>>> fails...
>>> 
>>> 
>>> On 7/16/06, Jon Daley <plogworld at jon.limedaley.com> wrote:
>>>>        I should have said: the 266 and 9 are valid article and
>>>> category ids, and that particular article has gotten a lot of spam
>>>> recently (bayesian filter, yay), so it is likely that it was a spammer 
>>>> who
>>>> tried to make that comment, and maybe made multiple comments close
>>>> together chronologically, though I am not sure what the article_category
>>>> field would be updated when a comment is made.
>>>> On Sat, 15 Jul 2006, Jon Daley wrote:
>>>>> Anyone figure this out quicker than I can get to it?
>>>>> 
>>>>> /home/jondaley/www/plog/class/logger/logger/logger.class.php(157):
>>>>> patternlayout.format
>>>>> /home/jondaley/www/plog/class/logger/logger/logger.class.php(137): 
>>>>> logger.log
>>>>> /home/jondaley/www/plog/class/dao/model.class.php(149): logger.error
>>>>> /home/jondaley/www/plog/class/dao/articles.class.php(665): 
>>>>> articles.execute
>>>>> /home/jondaley/www/plog/class/dao/articles.class.php(725):
>>>>> articles.addpostcategorieslink
>>>>> /home/jondaley/www/plog/class/dao/articles.class.php(959):
>>>>> articles.updatepostcategorieslink
>>>>> /home/jondaley/www/plog/class/dao/commentscommon.class.php(84):
>>>>> articles.updatearticle
>>>>> /home/jondaley/www/plog/class/security/bayesianfilter.class.php(123):
>>>>> articlecomments.addcomment
>>>>> /home/jondaley/www/plog/class/security/pipeline.class.php(171):
>>>>> bayesianfilter.filter
>>>>> /home/jondaley/www/plog/class/action/blogaction.class.php(79):
>>>>> pipeline.process
>>>>> /home/jondaley/www/plog/class/action/addcommentaction.class.php(44):
>>>>> addcommentaction.blogaction
>>>>> /home/jondaley/www/plog/class/controller/controller.class.php(304):
>>>>> addcommentaction.addcommentacti
>>>>> on
>>>>> /home/jondaley/www/plog/index.php(50): blogcontroller.process
>>>>> 
>>>>> 09-07-2006 08:51:51 ERROR - The following query =
>>>>> INSERT INTO plog_article_categories_link (article_id,category_id) VALUES
>>>>> (266,9);generated the foll
>>>>> owing error message =
>>>>> Duplicate entry '266-9' for key 1
>>>>> ~
>>>>> ~
>>>>> ~
>>>>> 
>>>>> 
>>>>> --
>>>>> Jon Daley
>>>>> http://jon.limedaley.com/
>>>>> 
>>>>> The problem with the gene pool is that there is no lifeguard.
>>>>> _______________________________________________
>>>>> pLog-svn mailing list
>>>>> pLog-svn at devel.lifetype.net
>>>>> http://devel.lifetype.net/mailman/listinfo/plog-svn
>>>>> 
>>>> --
>>>> Jon Daley
>>>> http://jon.limedaley.com/
>>>> German is a great language, because no matter what word you say,
>>>> it always sounds like millions of people are going to die.
>>>> -- Vagel Keller
>>>> _______________________________________________
>>>> pLog-svn mailing list
>>>> pLog-svn at devel.lifetype.net
>>>> http://devel.lifetype.net/mailman/listinfo/plog-svn
>>> _______________________________________________
>>> pLog-svn mailing list
>>> pLog-svn at devel.lifetype.net
>>> http://devel.lifetype.net/mailman/listinfo/plog-svn
>>> 
>> 
>> -- 
>> Jon Daley
>> http://jon.limedaley.com/
>> 
>> The only real failure in life is one not learned from.
>> -- Anthony D'Angelo
>> _______________________________________________
>> pLog-svn mailing list
>> pLog-svn at devel.lifetype.net
>> http://devel.lifetype.net/mailman/listinfo/plog-svn
>> 
>
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://devel.lifetype.net/mailman/listinfo/plog-svn

-- 
Jon Daley
http://jon.limedaley.com/

Design documents are simply a communist plot attempting to
undermine the productivity of the American worker.


More information about the pLog-svn mailing list