Skip to content

Commit

Permalink
Merge 9767765 into f16ee58
Browse files Browse the repository at this point in the history
  • Loading branch information
errx committed Nov 13, 2018
2 parents f16ee58 + 9767765 commit 1f6d1e6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

var (
splitInsertRe = regexp.MustCompile(`(.+\s+VALUES)\s*(\(.+\))`)
splitInsertRe = regexp.MustCompile(`(?s)(.+\s+VALUES)\s*(\(.+\))`)
)

type stmt struct {
Expand Down
12 changes: 12 additions & 0 deletions stmt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,18 @@ func (s *stmtSuite) TestFixDoubleInterpolateInStmt() {
s.NoError(rows.Close())
}

func (s *stmtSuite) TestFixMultiLineInsert() {
q := `
INSERT INTO tbl (
a
) VALUES (
?
)
`
st := newStmt(q)
s.True(st.batchMode)
}

func TestStmt(t *testing.T) {
suite.Run(t, new(stmtSuite))
}

0 comments on commit 1f6d1e6

Please sign in to comment.