wrong premise
You use the wrong premise. Bacteria don't usually give off oxygen. In fact Earth itslef was devoid of oxygen for 2 billion years. Only the cyanobacteria use photosyntesis to give off oxygen. All other bacteria either use oxygen or the oxigen is downright poisonous for them.
