Skip to content
Snippets Groups Projects
  • JediKev's avatar
    2c8729d1
    cron: Optimize Lock Table · 2c8729d1
    JediKev authored
    This addresses the MySQL syntax error regarding the lock table. On older
    osTicket databases we didn’t enforce having a prefix on the db tables.
    This means the lock table name would be 'lock' instead of 'ost_lock'. Cron
    runs an `OPTIMIZE TABLE` query on the lock table and if it has no prefix
    the query reads `OPTIMIZE TABLE lock;`. This is an issue because 'lock' is
    a MySQL Reserved Word and will throw an error. All you have to do is
    escape the table name with back ticks and MySQL won’t throw an error.
    2c8729d1
    History
    cron: Optimize Lock Table
    JediKev authored
    This addresses the MySQL syntax error regarding the lock table. On older
    osTicket databases we didn’t enforce having a prefix on the db tables.
    This means the lock table name would be 'lock' instead of 'ost_lock'. Cron
    runs an `OPTIMIZE TABLE` query on the lock table and if it has no prefix
    the query reads `OPTIMIZE TABLE lock;`. This is an issue because 'lock' is
    a MySQL Reserved Word and will throw an error. All you have to do is
    escape the table name with back ticks and MySQL won’t throw an error.