fix issue #12388 since of unexpectedly overwrite query
Merge pull request #12633 from crook/develop

fix issue #12388 since of unexpectedly overwrite query