Ah, is ubbdev the reason threads still insists on supporting MySQL <4.1
You would only need to redo the part that finds out about the lost posts and their topic id's since that one uses a query in a query. The rest would work fine.
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.