Putting too many emeralds in a trade window (64 emeralds) than what the villager can trade, then shift-clicking the purchased item (4 bottles o' enchanting for one emerald), appears to create all of the items requested (4 stacks).
Exiting the trade window causes you to drop the emeralds that the villager could not actually trade for. (57 emeralds or so)
The extra items disappear after a while, though.
Duplicate of MC-1580, please use the search function to see if your bug has already been submitted. Currently over 58% of tickets are being closed as duplicate.