From f7f724096d015422688eaa799d2c2a45c396dcec Mon Sep 17 00:00:00 2001 From: Timothy Sehn Date: Mon, 7 Oct 2019 15:47:52 -0700 Subject: [PATCH 1/2] Increased the length of the buffer to read from STDIN for SQL statements. --- go/cmd/dolt/commands/sql.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/go/cmd/dolt/commands/sql.go b/go/cmd/dolt/commands/sql.go index b30f3a8f64..43a31654e5 100755 --- a/go/cmd/dolt/commands/sql.go +++ b/go/cmd/dolt/commands/sql.go @@ -165,6 +165,9 @@ func scanStatements(data []byte, atEOF bool) (advance int, token []byte, err err // runBatchMode processes queries until EOF and returns the resulting root value func runBatchMode(ctx context.Context, dEnv *env.DoltEnv, root *doltdb.RootValue) (*doltdb.RootValue, error) { scanner := bufio.NewScanner(os.Stdin) + const maxCapacity = 512*1024 + buf := make([]byte, maxCapacity) + scanner.Buffer(buf, maxCapacity) scanner.Split(scanStatements) batcher := dsql.NewSqlBatcher(dEnv.DoltDB, root) From 85f9500de45261b57c0f178010184edf299f5fc7 Mon Sep 17 00:00:00 2001 From: Timothy Sehn Date: Mon, 7 Oct 2019 16:13:56 -0700 Subject: [PATCH 2/2] Formatted per script --- go/cmd/dolt/commands/sql.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/cmd/dolt/commands/sql.go b/go/cmd/dolt/commands/sql.go index 43a31654e5..b355e002b8 100755 --- a/go/cmd/dolt/commands/sql.go +++ b/go/cmd/dolt/commands/sql.go @@ -165,7 +165,7 @@ func scanStatements(data []byte, atEOF bool) (advance int, token []byte, err err // runBatchMode processes queries until EOF and returns the resulting root value func runBatchMode(ctx context.Context, dEnv *env.DoltEnv, root *doltdb.RootValue) (*doltdb.RootValue, error) { scanner := bufio.NewScanner(os.Stdin) - const maxCapacity = 512*1024 + const maxCapacity = 512 * 1024 buf := make([]byte, maxCapacity) scanner.Buffer(buf, maxCapacity) scanner.Split(scanStatements)