Fix a problem with sql data install with empty select query