fix one sql query bug on master repo