t is a non-empty InnoDB table.
Examine these statements, which are executed in one session:
BEGIN;
SELECT * FROM t FOR UPDATE;
Which is true?
If OPTIMIZE TABLE; is invoked, it will create a table lock on t and force a transaction rollback.
If OPTIMIZE LOCAL TABLE t; is invoked from another session, it executes normally and returns the status.
mysqlcheck --analyze --all-databases will execute normally on all tables and return a report.
If ANALYZE TABLE; is invoked from the same session, it hangs until the transaction is committed or rolled back.
Submit