The way I do a constraint check is with TRIGGER (see :
http://dev.mysql.com/doc/refman/5.0/en/create-trigger.html ).
Basically, for your table, you would say:
DELIMITER $$
CREATE TRIGGER trig_gvars_gfirst BEFORE UPDATE ON gvars
FOR EACH ROW BEGIN
IF NEW.name NOT LIKE 'g%' THEN
SET NEW.name = 1 / 0;
END IF;
END $$
DELIMITER ;
Basically, the line "SET NEW.name = 1 / 0;" will occur and force an error any time the constraint is not satisfied. That seems to be the best way to cause the insertions not to happen. Quite dirty -- but it beats just getting ignored by the database engine. This also doesn't work if you're updating through FOREIGN KEY actions, such as CASCADE or UPDATE, as TRIGGERs are not called for these actions. So watch out for that.
Another solution would be to restrict insertion of data into tables you would like to constrain through user-defined functions and procedures. This requires enumerating every possible action scheme you might want to take, so it is generally not the best option.
Cheers!