Fixed an unbigous SQL pattern match bug in the database stub.