Fixing the logic for table versioning.
Fixing the logic for table versioning.

LGTM Mike.

nso95/vitess,fanngyuan/vitess,fanngyuan/vitess,fanngyuan/vitess,nso95/vitess,nso95/vitess,fanngyuan/vitess,fanngyuan/vitess,nso95/vitess,nso95/vitess