The first form of this story is very common in Jamaica. It is told by Pamela Smith, Candoo, 28-30; Wona, Do-mek-I-see, 9-18. The introductory trick is generally told as an independent witticism.
Compare: Basset 11, 93-95; 102; Barker, 39-44; Dayrell, 20-28; Parsons, Andros Island, 141 and note for further references. See Grimm 36, The Wishing Table, the Gold-ass, and the Cudgell in the Sack, discussed in Bolte u. Polívka, 2:336-361.