create table tbl (a binary); select cast (a as smallint) from tbl limit 1;