In two-way contingency tables we sometimes find that frequencies along the diagonal cells are relatively larger (or smaller) compared to off-diagonal cells, particularly in square tables with the common categories for the rows and the columns. In this case the quasi-independence model with an additional parameter for each of the diagonal cells is usually fitted to the data. A simpler model than the quasi-independence model is to assume a common additional parameter for all the diagonal cells. We consider testing the goodness of fit of the common diagonal effect by the Markov chain Monte Carlo (MCMC) method. We derive an explicit form of a Markov basis for performing the conditional test of the common diagonal effect. Once a Markov basis is given, MCMC procedure can be easily implemented by techniques of algebraic statistics. We illustrate the procedure with some real data sets.