It would be cleaner to initialize expr and optionally as needed a local copy of m_outputColumnSrcTableIndexes[i] before the while loop.