header

Collapse

Curious logic in upgrade step 143 for 500a1

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Go to Thank You vB-Info
    Senior Member

    ❤️
    • 12.2020
    • 211
    • 10
    • 1

    Font Size
    #1

    Curious logic in upgrade step 143 for 500a1

    Go to Thank You
    Hello, we noticed after a forum upgrade from version 3, we were missing almost 70K threads. We tracked it down to this particular upgrade step in 500a1.





    PHP Code:



    function step_143()
    {
    /*
    This step removes duff thread records that have no first postid.
    These threads have no posts, so adding them would be pointless and cause issues down the line.
    Exclude the threads with open == 10 which are thread redirects
    */
    $query = "
    DELETE FROM "
    . TABLE_PREFIX . "thread
    WHERE firstpostid = 0 AND open 10
    "
    ;
    $this->run_query(
    sprintf($this->phrase['vbphrase']['update_table'], 'thread'), $query
    );
    }






    The code comment says "open == 10", but the actual query uses the '' or 'NOT equal to' operator.

    The result is that almost 70k threads were deleted. These threads did not have any posts other than the starter, but they should not just be deleted from the upgraded forum.



    We would like to confirm that the correct query should be "AND open = 10".

    Devami...Go to Top of Post
    Similar Threads
X

Thread Information

Collapse

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

    Those who read this thread

    Collapse

    Members who have read this thread: 0

      Related Topics

      Collapse

      Topics Statistics Last Post
      Started by vB-Info, 1 week ago
      0 responses
      1 view
      0 reactions
      Last Post vB-Info
      by vB-Info
      Started by vB-Info, 1 week ago
      0 responses
      2 views
      0 reactions
      Last Post vB-Info
      by vB-Info
      Started by vB-Info, 13.03.24, 20:42
      0 responses
      21 views
      0 reactions
      Last Post vB-Info
      by vB-Info
      Working...
      😀
      😂
      🥰
      😘
      🤢
      😎
      😞
      😡
      👍
      👎

      AdBlock Detected

      Please Disable Adblock

      Please consider supporting us by disabling the ad blocker.

      I've Disabled AdBlock
      Home