This is probably the biggest problem I have in working with lots of different musicians and gig situations.
There's nothing you can do about one-nighters on a sub basis...you just have to roll with it. But any time I'm asked to work with someone on an ongoing basis I look for the signs, because drunks and addicts ARE going to flake on you, it's just a matter of when.
The problem is that people who are "functioning alcoholics" have usually been that way for a long time and are pretty adept at hiding it. I play with one guy that I've known for years, we've been in a couple of different bands together for brief periods of time, and I only recently figured out that he's pretty much drunk all the time...I have never actually seen him sober so I couldn't tell the difference.
Unfortunately, I usually find out someone has a problem on stage, when they forget intros and endings, what key the song is in, when they begin babbling into the mic between tunes, that sort of thing.
I generally start working on an exit strategy at that point because I simply don't want to deal with that BS.
In bands where I am the leader I make it very clear there's no drinking at all on stage. If that doesn't work for you, this is the wrong gig for you. I don't want to worry about whether you can stop at 2 beers or wherever you think your "line" is. I have NEVER seen drugs or alcohol "enhance" someone's performance. They think it does, but record it and listen back...your timing, your tuning, your dynamics...they all suffer when you're f----d up.
AFTER the gig, go out back, tie off, and mainline if you want, I don't care. that's your business.
I wish had the radar to find out this stuff before I start working with people, but I really don't know how you do that.