Reaction of primary nitroalkane with nitrous acid

I was reading the reaction of primary nitroalkane with nitrous acid. I read this reaction

Another mechanism which I saw:

I am now confused whether the first mechanism occur or the second one.I tried to search it on google but didn't get anything which could clear this doubt .Please help me regarding this.This I need to know because the reaction written in my book after 2nd reaction is-

If 1st reaction is right then what will occur after adding $\ce{NaOH}$ in the product. Also when I read Victor Mayer test the 1st reaction was written there. Due to this I am in a dilemma. Please explain.

• It could be both. The two products can tautomerize like a ketone and an enol. – Oscar Lanzi May 10 '18 at 13:20
• Yes, the two products are tautomers, so the answer is both. And that is not a "mechanism"... – orthocresol May 10 '18 at 14:43