Closed valodzka closed 1 year ago
ParseQuery in in collector.go incorrectly handles case when there are params before and after query https://github.com/nikepan/clickhouse-bulk/blob/b34e73cdafdd3682fe5e3dd193a0f977f7121ad1/collector.go#L315
It might cause incorrect results or panic: runtime error: slice bounds out of range depending on params length.
panic: runtime error: slice bounds out of range
Instead of
if eoq >= 0 { q = queryString[i+6 : eoq+6] params = queryString[:i] + queryString[eoq+7:] }
It should be:
if eoq >= 0 { q = queryString[i+6 : i+eoq+6] params = queryString[:i] + queryString[i+eoq+7:] }
Example of problematic string: queryString = "a=11111111111111111111111111111&query=insert into x format fmt&a=1"
queryString = "a=11111111111111111111111111111&query=insert into x format fmt&a=1"
ParseQuery in in collector.go incorrectly handles case when there are params before and after query https://github.com/nikepan/clickhouse-bulk/blob/b34e73cdafdd3682fe5e3dd193a0f977f7121ad1/collector.go#L315
It might cause incorrect results or
panic: runtime error: slice bounds out of range
depending on params length.Instead of
It should be:
Example of problematic string:
queryString = "a=11111111111111111111111111111&query=insert into x format fmt&a=1"