optimize table in stored produce using phpMyAdmin causes out of sync error I get the following error when running the code in phpMyAdmin. NOTE: I can run any other sql code (update, insert, replace) via phpMyAdmin in a stored procedure; but an optimize causes issues.

NOTE: This code works fine when running from CLI.

ERROR: #2014 - Commands out of sync; you can't run this command now

SQL Code:

delimiter //

create procedure update_phppos() 

begin
OPTIMIZE table phppos_items;
end;

//

delimiter ;

-- Execute the procedure
call update_phppos();

-- Drop the procedure
drop procedure update_phppos;
For INNODB I was able to do the same thing and it didn't cause an error in php.

Here is what I did:

 ALTER TABLE phppos_items FORCE;