MySQL 5.5.x does not appear to support CAST(x as INT), use UNSIGNED instead