Skip to content

Commit

Permalink
Increase maxiumum SQL statement length to 100MB (initially 512K)
Browse files Browse the repository at this point in the history
Signed-off-by: Zach Musgrave <zach@liquidata.co>
  • Loading branch information
zachmu committed Oct 8, 2020
1 parent 4ff07ca commit 5797ae5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions go/cmd/dolt/commands/sql_statement_scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ type statementScanner struct {
lineNum int // the current line number being parsed
}

const maxStatementBufferBytes = 100 * 1024 * 1024

func NewSqlStatementScanner(input io.Reader) *statementScanner {
scanner := bufio.NewScanner(input)
const maxCapacity = 512 * 1024
buf := make([]byte, maxCapacity)
scanner.Buffer(buf, maxCapacity)
const initialCapacity = 512 * 1024
buf := make([]byte, initialCapacity)
scanner.Buffer(buf, maxStatementBufferBytes)

s := &statementScanner{
Scanner: scanner,
Expand Down

0 comments on commit 5797ae5

Please sign in to comment.