Original columns disappear when returning results of a database query

In a previous post you described the following process to query a database based on a parameter

“ To use a parameter in a query, put the action with the query in a separate module, define a parameter in the module and use the parameter in the query. Then, in the main module, use the "Iterate" action on the single value and assign it from a column to the parameter of the module with the query.”

This works fine but the original columns disappear and are replaced with the results of the query - is that a bug or by design? I worked around it be enumerating the source dataset and then including that as a parameter in the iterate command so that I could then join the results back to the source columns using a derived table

Yes, it's by design. To simplify merging, the "Iterate" action adds input parameters as columns to the output dataset. So, if your iteration parameters are unique, there is no need to enumerate them additionally.