A police officer is stabbed in the arm as he tries to help a shopkeeper trapped inside a convenience store with a knifeman.