Fixes a problem with query variables where SQL query returning for example only numeric values didn't populate the query variables with values. Fixes #35391