Note on the side, I don't think your select will ever cause such an condition to arise. In mysql, a select like this will cause a resultset to be returned to the calling client.
Had it been a SELECT..INTO the condition would be raised in case of no data. Same goes for a cursor. But this will never reach the exception action.
Anyway, in mysql, you define HANDLERs for CONDITIONs like this:
begin
declare v_dummy char(1);
declare
continue handler -- type of handler, continue or exit
for not found -- use the builtin not found condition
insert into tabl1(col1) values ('A')
;
select col1
into v_dummy
from table1
where col1 = 'A'
;
end;
in this case, we used a builtin condition, not found, but you can define your own.
start reading from here for more info:
http://dev.mysql.com/doc/mysql/en/conditions-and-handlers.html
Another note on the side, why don't you just write it like this:
begin
if (
select count(col1)
from table1
where col1 = 'A'
) = 0 then
insert into table1(col1) values ('A');
end if;
end;
$$