MyBB Community Forums

Full Version: Thread Id's
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I see no reason why that wouldn't work. Can you screenshot your mybb_threads table in phpmyadmin?
Here it is:
If that's the only thread then you can delete it and then optimize the tables.
Optimizing a table doesn't change its increment value.
(2013-02-10, 10:01 AM)StefanT Wrote: [ -> ]Optimizing a table doesn't change its increment value.

If you have 5 threads, delete the fifth, then create a new thread, the next tid will be 6. There will be five threads remaining but the tid still increments.

If you have 5 threads, delete the fifth, optimize the table, then create a new thread, the next tid will be 5. This is because optimizing the table removes the 'marker' which tells MySQL where to continue from. This works when the last rows in a table have been deleted.
I've just tried it and it doesn't reset the marker.
(2013-02-10, 11:02 AM)StefanT Wrote: [ -> ]I've just tried it and it doesn't reset the marker.

That's really peculiar. Unless I'm forgetting something that's the correct logic...

OP, try running this query:

ALTER TABLE mybb_threads AUTO_INCREMENT = 3;

Make sure you delete all threads which have an tid greater than 2 before hand.
(2013-02-10, 09:59 AM)Nathan Malcolm Wrote: [ -> ]If that's the only thread then you can delete it and then optimize the tables.

Actually this is correct if there are no rows. It's a MySQL "bug".

http://bugs.mysql.com/bug.php?id=18274
Pages: 1 2