Right off the top of my head comes the Toreador Song from Carmen, but that can't possibly be the earliest.
Creole Love Call. In the Mood. Pennsylvania 6-5000. 720 in the Books. Johnson Rag. One O-clock Jump, Two O-clock Jump, etc. Manteca. Sorry, the earlier repertoire back into the 20s is largely escaping me at the moment, but I think everything I've just listed above predates Watermelon Man or Mercy. I am sure there were popular riff-based tunes before the ones I've listed.
If oldest to you is "Mercy Mercy Mercy" and "Watermelon Man", then A Night in Tunisia So What Haitian Fight Song Bohemia After Dark I would not personally consider those "oldest", though. All relative, I guess.
Strictly speaking for tunes where the bass line is particularly identifying of the tune, how about Jumpin at the Woodside (1938); Big Noise from Winnetka (1938)? Almost certainly not the oldest, but it's what I can think of right now). You know, someone told me the other day that Paul McCartney was in a band before Wings! Who knew?