In Openfire 3.9.3 with mysql database this fix isn't working. I get the following exception:
ERROR [PubSubPersistenceManager] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LEFT JOIN (SELECT id FROM ofPubsubItem WHERE serviceID='pubsub' AND nodeID='Test' at line 1
java.sql.BatchUpdateException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LEFT JOIN (SELECT id FROM ofPubsubItem WHERE serviceID='pubsub' AND nodeID='Test' at line 1
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:19 81)
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1393)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.logicalcobwebs.proxool.ProxyStatement.invoke(ProxyStatement.java:100)
at org.logicalcobwebs.proxool.ProxyStatement.intercept(ProxyStatement.java:57)
at com.mysql.jdbc.Statement$$EnhancerByProxool$$f22e4875.executeBatch(<generated>)
at org.jivesoftware.openfire.pubsub.PubSubPersistenceManager.purgeItems(PubSubPers istenceManager.java:1886)
at org.jivesoftware.openfire.pubsub.PubSubPersistenceManager.access$000(PubSubPers istenceManager.java:62)
at org.jivesoftware.openfire.pubsub.PubSubPersistenceManager$2.run(PubSubPersisten ceManager.java:279)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java: 886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
According to mysql syntax it's necessary to specify on which tables to apply the DELETE.
So it should work if PURGE_FOR_SIZE statement looks like
DELETE `ofPubsubItem` FROM `ofPubsubItem` LEFT JOIN (SELECT id.....