View Issue Details

IDProjectCategoryView StatusLast Update
0000331XMB1Bugspublic2010-04-09 17:46
Reporterpostcrossing Assigned Tokuba1  
PrioritynormalSeveritycrashReproducibilitysometimes
Status closedResolutionfixed 
Product Version1.9.11 
Target Version1.9.11.07Fixed in Version1.9.11.07 
Summary0000331: Pruning functionality contains incorrect SQL code that causes data corruption
DescriptionWhen running the pruning operation under certain circumstances it will try to run _broken_ SQL code that will abort the operation and potentially cause data corruption. The problematic code is present in cp2.php:

$db->query("DELETE FROM ".X_PREFIX."favorites WHERE IN ($tids)");

This SQL code is _broken_.

It should read:

$db->query("DELETE FROM ".X_PREFIX."favorites WHERE tid IN ($tids)");
Additional Informationhttp://forums.xmbforum.com/viewthread.php?tid=774909

This is in a 1.9.11 installation but seems to be in trunk as well. This together with running afterwards the tools in the administration panel have caused posts to be lost on threads that were displaying as containing a thread count of -1.
TagsNo tags attached.
MySQL Version
PHP Version
Web Server
Browser
FlagsCritical Patch
Original Reporter
SVN Revision2108

Activities

kuba1

2009-09-07 14:15

reporter   ~0000199

Verified broken sql query. Updated to SVN rev 2108.

This will require manual update to the .07 download package.

kuba1

2009-09-07 14:25

reporter   ~0000200

Download package updated and patch announcement written. Issue closed -> resolved

kuba1

2009-09-07 14:26

reporter   ~0000201

Download package manually repaired. Patch announcement written

miqrogroove

2010-01-23 21:28

administrator   ~0000203

Ticket had not been added to any milestone. Reopen for:

* Add version and target info.
* Revert noisy patch per 0000338 cleanup.
* Add a clean patch to the patches forum and /trunk/patches/.
* Update revision number after clean patch.

miqrogroove

2010-01-23 21:32

administrator   ~0000204

See also revision 1387.

2010-01-23 23:04

 

Test..svn004.tmp.diff (685 bytes)   
Index: cp2.php
===================================================================
--- cp2.php	(revision 2107)
+++ cp2.php	(revision 2108)
@@ -1744,7 +1744,7 @@
                 $tids = implode(',', $tids);
                 deleteMultiThreadAttachments($tids); // Must delete attachments before posts!
                 $db->query("DELETE FROM ".X_PREFIX."posts WHERE tid IN ($tids)");
-                $db->query("DELETE FROM ".X_PREFIX."favorites WHERE IN ($tids)");
+                $db->query("DELETE FROM ".X_PREFIX."favorites WHERE tid IN ($tids)");
 
                 $db->query("DELETE FROM d, r, v "
                          . "USING ".X_PREFIX."vote_desc AS d "
Test..svn004.tmp.diff (685 bytes)   

miqrogroove

2010-01-23 23:14

administrator   ~0000207

Patch file now posted at http://forums.xmbforum.com/viewthread.php?tid=775352

Not going to worry about making a clean revision, as the cleanup plan changed slightly.

Issue History

Date Modified Username Field Change
2009-09-07 13:53 postcrossing New Issue
2009-09-07 14:11 kuba1 Assigned To => kuba1
2009-09-07 14:11 kuba1 Status new => assigned
2009-09-07 14:11 kuba1 Project XMB Hacks 1.9.x => XMB1
2009-09-07 14:15 kuba1 Note Added: 0000199
2009-09-07 14:25 kuba1 Note Added: 0000200
2009-09-07 14:26 kuba1 SVN Revision => 2108
2009-09-07 14:26 kuba1 Note Added: 0000201
2009-09-07 14:26 kuba1 Status assigned => resolved
2009-09-07 14:26 kuba1 Resolution open => fixed
2010-01-23 18:31 miqrogroove Category => Bugs
2010-01-23 21:28 miqrogroove Note Added: 0000203
2010-01-23 21:28 miqrogroove Status resolved => feedback
2010-01-23 21:28 miqrogroove Resolution fixed => reopened
2010-01-23 21:32 miqrogroove Note Added: 0000204
2010-01-23 21:32 miqrogroove Product Version => 1.9.11
2010-01-23 21:32 miqrogroove Fixed in Version => 1.9.11.07
2010-01-23 21:32 miqrogroove Target Version => 1.9.11.07
2010-01-23 21:33 miqrogroove Flags => Critical Patch
2010-01-23 23:04 miqrogroove File Added: Test..svn004.tmp.diff
2010-01-23 23:14 miqrogroove Note Added: 0000207
2010-01-23 23:14 miqrogroove Status feedback => resolved
2010-01-23 23:14 miqrogroove Resolution reopened => fixed
2010-02-24 17:58 miqrogroove Status resolved => closed
2010-04-09 17:46 miqrogroove Additional Information Updated