create table entContact( id int unsigned NOT NULL auto_increment, person varchar(32) NOT NULL, primary key(id) ); insert into entContact(person) values('Joe'), ('Jessica'), ('Alan'); create procedure lstContacts(pPersonMatch varchar(64)) begin select * from entContact where pPersonMatch is null or person rlike pPersonMatch; end; -- Either of these successfully return Joe. call lstContacts('Joe(seph)?'); select * from entContact where person rlike 'Joe(seph)?'; -- Any of these successfully return an empty set. call lstContacts('Sarah?'); select * from entContact where person rlike 'Sarah?'; select * from entContact where person rlike null; -- Successfully returns all Joe, Jessica, and Alan. select * from entContact where null is null or person rlike null; -- This one hangs, but should return the same thing as the previous statement. call lstContacts(null);