• 0
ProGEEK

exile.ini cleanup/delete queries arnt quite right

Question

I think I may have found an issue with the following exile.ini cleanup commands:

  • deleteOldContainers
  • deleteOldConstructions
  • deleteOldVehicles
  • deleteUnpaidTerritories

I have tested this on the territory table using the deleteUnpaidTerritories command.
(I have a territory last_paid_at set to 2015-01-01 for testing purposes)
Adapted to be a select instead of a delete (I removed the DELETE keyword and added SELECT * so i could see what was being returned/wht would have been deleted):

SELECT * FROM territory WHERE last_paid_at < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 14 DAY))

Produces the following warning and returns no results:
"Incorrect datetime value: '1448678464' for column 'last_paid_at' at row 1"

Modifying the query to remove the UNIX_TIMESTAMP() block fixes this and I get the 1 result I was expecting:

SELECT * FROM territory WHERE last_paid_at < DATE_SUB(NOW(), INTERVAL 14 DAY)

With the original query, territories are not being deleted.
Original:
 

DELETE FROM territory WHERE last_paid_at < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL ? DAY))

Modified to work:

DELETE FROM territory WHERE last_paid_at < DATE_SUB(NOW(), INTERVAL ? DAY)

This testing was performed on a MySQL server with version 5.6.17

Share this post


Link to post
Share on other sites

0 answers to this question

There have been no answers to this question yet

Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.