"Both the melody and words of the first part of this song were clearly indicated in 1847 in Farewell Ladies, written, composed and sung by E.P. Christy, and copyrighted Nov. 19, 1847, by Jaque Brothers.... [...] The first known printing of the complete song as we now know it was on May 16, 1867, in Carmina Yalensia, compiled and arranged by Ferd. V.D. Garretson, and published by Taintor Brothers & Co., ... The song appears on p. 47 under the title, Good Night.... The second part of the song... has the same melody as Mary Had a Little Lamb,.... The melody of the first part of the song... is the melody of Someone's in the Kitchen with Dinah, ...." (James J. Fuld, The Book of World-Famous Music, 4th ed., Dover, 1995, pp. 255-256)
~Masato
From Carmina Yalensia compiled and arranged by Ferd. V. D. Garretson (New York: Taintor Brothers, 1867), page 47.