Previous Thread
Next Thread
Print Thread
Hop To
#240498 12/06/2010 8:28 AM
Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3
Restoring a database, (using big dump) I get this error...

Quote
Error at the line 25131: INSERT INTO `ubbt_FORUM_LAST_VISIT` (`FORUM_ID`, `USER_ID`, `LAST_VISIT_TIME`) VALUES(2, 2, 1291404700);

Query: INSERT INTO `ubbt_FORUM_LAST_VISIT` (`FORUM_ID`, `USER_ID`, `LAST_VISIT_TIME`) VALUES(2, 2, 1291404700);

MySQL: Duplicate entry '2-2' for key 1

Can anyone shed a little light on this please?

driv #240499 12/06/2010 8:57 AM
Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3
Tried three times now - also dropped the tables and started from fresh - same problem.

driv #240500 12/06/2010 10:44 AM
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Hmm, it looks like somehow there is a duplicate entry for USER_ID 2 on FORUM 2. Not sure how that would happen.

The only way around that would probably be to edit the dump file and remove the entry (or just remove all of the data for the FORUM_LAST_VIST table).

driv #240501 12/06/2010 10:49 AM
Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3
Ugh - I was dreading that answer, but thought it may be the case.

ok - thanks for that smile

BTW - what would be the effect of the second option?

Last edited by driv; 12/06/2010 10:51 AM. Reason: second option?
driv #240507 12/06/2010 1:15 PM
Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3
Well, I deleted that line - even though it turned out to be unique.

Re-uploaded (takes forever via ftp) then I get this...

Quote
Error at the line 25131: INSERT INTO `ubbt_FORUM_LAST_VISIT` (`FORUM_ID`, `USER_ID`, `LAST_VISIT_TIME`) VALUES(16, 2, 1291498230);

Query: INSERT INTO `ubbt_FORUM_LAST_VISIT` (`FORUM_ID`, `USER_ID`, `LAST_VISIT_TIME`) VALUES(16, 2, 1291498230);

MySQL: Duplicate entry '2-16' for key 1


So I guess it's this part...
Quote
INSERT INTO `ubbt_FORUM_LAST_VISIT` (`FORUM_ID`, `USER_ID`, `LAST_VISIT_TIME`) VALUES(16, 2,

Clearly I can't search for all possible duplicates, so I have to go for option 2.

Can you please explain what would be affected by the removal of this data?

Thanks smile

driv #240508 12/06/2010 1:28 PM
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Hmm, that's a bit odd on the dups. Hopefully it turns out to be only that table.

If you remove all of the data, then basically it would just mean that all posts would be marked as unread. So, you'd probably just want to make a post for everyone to use the mark all read button when they login again.

driv #240509 12/06/2010 2:03 PM
Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3
ok Thanks.

By any chance, is there a query that would do that automatically?

driv #240510 12/06/2010 2:26 PM
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
If you're dumping it out first, then you can get rid of all the entries with:

truncate table ubbt_FORUM_LAST_VISIT

driv #240511 12/06/2010 2:27 PM
Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3
Sorry, I wasn't clear.
Is there a query I could use to mark all users posts as read?

driv #240512 12/06/2010 3:12 PM
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Ah, unfortunately not since it has to do an entry for every user in every forum.

driv #240513 12/06/2010 3:58 PM
Joined: Jan 2004
Posts: 2,474
Likes: 3
D
Pooh-Bah
Pooh-Bah
D Offline
Joined: Jan 2004
Posts: 2,474
Likes: 3
ok, thanks for the help smile


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
Is UBB.threads still going?
by Aaron101 - 04/01/2022 8:18 AM
Who's Online Now
1 members (Nightcrawler), 552 guests, and 173 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)