Closed CaledoniaProject closed 11 months ago
Can you please provide the steps to reproduce the issue? Is it with interactive mode or from an input file or both?
I just run sqlcmd -S XXX -C -i XXX.sql
and it prints tons of bufio error. The ubuntu sqlcmd binary package does not suffer from this.
For any size of xxx.sql? Or for a certain batch size inside the file? What OS and sqlcmd version combination are you using?
I have completely no idea, because you're not printing the line number. I also think you don't have to know the size of the SQL file.
If you want to produce the issue, you could create a large blob, e.g 100MB to test it. My input file is exported from a SQLServer. I believe that line is longer than your buffer size, unless there's a line number in the error output, I have no idea which line is the problem. But looks like at least 1000 lines is longer than that.
thx for the pointer, we'll take a look
What should I do with bufio.scanner: token too long? Can you use a unbuffered reader?