Advertisement:

Author Topic: Bug in smf_log_notify when upgrading from 1.1.13 to 2.0RC5  (Read 1898 times)

Offline bultza

  • Newbie
  • *
  • Posts: 3
Hello all, we upgraded from 1.1.13 to 2.0.RC5 and we had lots of problems with the log_notify table.

The user that was replying to a thread that was already following with notification was being subscribed to be notified once more. So If I was replying 10 times in a thread, I was being notified with 10 emails. I could not find that anyone else experienced with this problem.

My solution was to drop the table smf_log_notify and put a new one from the 2.0 empty structure. You can see the differences in the code and the source of the error:

Old table with the bug:
Code: [Select]
CREATE TABLE IF NOT EXISTS `smf_log_notify` (
  `id_member` mediumint(8) unsigned NOT NULL default '0',
  `id_topic` mediumint(8) unsigned NOT NULL default '0',
  `id_board` smallint(5) unsigned NOT NULL default '0',
  `sent` tinyint(1) unsigned NOT NULL default '0',
  KEY `id_topic` (`id_topic`,`id_member`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

New fixed code
Code: [Select]
Regards
CREATE TABLE IF NOT EXISTS `smf_log_notify` (
  `id_member` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `id_topic` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `id_board` smallint(5) unsigned NOT NULL DEFAULT '0',
  `sent` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id_member`,`id_topic`,`id_board`),
  KEY `id_topic` (`id_topic`,`id_member`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Somehow during the upgrade, this was not included in the table: 
PRIMARY KEY (`id_member`,`id_topic`,`id_board`),

I saw that when directly upgraded, this table had thousands of duplications, so maybe that is the reason that the new feature "Primar key" did not work out during the upgrade.

I hope this is usefull for other people.
« Last Edit: May 11, 2011, 08:38:36 AM by Norv »

Offline bultza

  • Newbie
  • *
  • Posts: 3
Re: Bug in smf_log_notify when upgrading from 1.1.13 to 2.0RC5
« Reply #1 on: May 10, 2011, 11:53:11 AM »
The error might be in the "large upgrade" file.
File: upgrade_2-0_mysql.sql
After line 832 Add:

Code: [Select]
ALTER TABLE {$db_prefix}log_notify
ADD PRIMARY KEY (id_member, id_topic, id_board);

But I might be wrong as I did not test it, be carefull in testing that as you might corrupt the installation.

Anyway, not sure if anyone is really interested

Offline Storman™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,027
Re: Bug in smf_log_notify when upgrading from 1.1.13 to 2.0RC5
« Reply #2 on: May 10, 2011, 12:45:04 PM »
It's an interesting point.

However, if it's a bug then shouldn't the post be in the Bug Reports section for investigation :

http://www.simplemachines.org/community/index.php?board=137.0

 ;)
Any Backup method is bettter than no Backup method....

Offline bultza

  • Newbie
  • *
  • Posts: 3
Re: Bug in smf_log_notify when upgrading from 1.1.13 to 2.0RC5
« Reply #3 on: May 11, 2011, 07:53:12 AM »
Thanks Storman, I reposted it in the forum you indicated so if a moderator can delete this topic here would be nice and tidy ;)

Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 17,934
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • LexArma on GitHub
    • aleksi-kilpinen on LinkedIn
    • There's No Place Like 127.0.0.1
Re: Bug in smf_log_notify when upgrading from 1.1.13 to 2.0RC5
« Reply #4 on: May 11, 2011, 08:19:52 AM »
Let's do the other way around. I'll move this and delete the other.
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.

How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum.
 Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 50,336
Re: Bug in smf_log_notify when upgrading from 1.1.13 to 2.0RC5
« Reply #5 on: November 18, 2011, 09:02:44 AM »
is this still an issue?