go-mssqldb icon indicating copy to clipboard operation
go-mssqldb copied to clipboard

"Reduce use of goroutines" has broken some functionality

Open arjitj2 opened this issue 3 years ago • 2 comments

Describe the bug Something about this commit (https://github.com/denisenkom/go-mssqldb/commit/162e654480e2bffeaeab32d1dca87820df58a840) has broken functionality when using this library in conjunction with Ratchet (https://github.com/dailyburn/ratchet)

Best description of the bug I can give is that it's breaking Ratchet's understanding of queries being executed and the data coming out of it.

The introduction of this new commit gives me error="pq: syntax error at or near \")\"" when attempting to do the load aspect of the ETL into postgres, with MSSQL as the extract.

Also, data from one extract is now leaking into the load of the next query in the pipeline.

Not sure what might have gone wrong, my knowledge of Go isn't very deep. For now, I'm manually pointing myself to commit 2b7eb882b6953bc873544823e68843e09a64a0c2.

arjitj2 avatar Nov 19 '20 21:11 arjitj2

Can you provide a reproducible example?

denisenkom avatar Nov 20 '20 22:11 denisenkom

Hard to provide a good example as it's so dependent on Ratchet. Will do the best I can:

transform := processors.NewPassthrough()

		layout, err = ratchet.NewPipelineLayout(
			ratchet.NewPipelineStage(
				ratchet.Do(extract).Outputs(transform),
			),
			ratchet.NewPipelineStage(
				ratchet.Do(transform).Outputs(replicationRoleTask),
			),
			ratchet.NewPipelineStage(
				ratchet.Do(replicationRoleTask).Outputs(load),
			),
			ratchet.NewPipelineStage(
				ratchet.Do(load),
			),
		)

pipeline = ratchet.NewBranchingPipeline(layout)

I use this mssql driver to read data in the extract step. This probably won't make sense to you unless you understand the ratchet library.

This pipeline is working great before the commit I noted above. After the breaking commit, the load still happens, but the data appears to be in the wrong order and/or corrupted. When I do the load step into postgres, I get issues saying I missed a parentheses, or that a column value from the last table is trying to make it into the current table.

arjitj2 avatar Nov 23 '20 17:11 arjitj2