Global existence and blow-up for a shallow water equation