Bug in smf_log_notify when upgrading from 1.1.13 to 2.0RC5

Started by bultza, May 08, 2011, 03:40:30 PM

Previous topic - Next topic

bultza

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:

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

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.

bultza

The error might be in the "large upgrade" file.
File: upgrade_2-0_mysql.sql
After line 832 Add:

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

Storman™

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

;)

bultza

Thanks Storman, I reposted it in the forum you indicated so if a moderator can delete this topic here would be nice and tidy ;)

Aleksi "Lex" Kilpinen

Let's do the other way around. I'll move this and delete the other.
Slava
Ukraini!
"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

How you can help SMF

Illori


Advertisement: