Skip to content

Commit df03fb0

Browse files
authored
Merge pull request #264 from noborus/fix-multi
Fixed flag set for multiple queries
2 parents a5fc44c + a47fd1f commit df03fb0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

exporter.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ type WriteFormat struct {
2828
func NewExporter(writer Writer) *WriteFormat {
2929
return &WriteFormat{
3030
Writer: writer,
31+
multi: false,
3132
}
3233
}
3334

@@ -42,11 +43,11 @@ func (e *WriteFormat) Export(db *DB, sql string) error {
4243
// ExportContext is called from ExecContext.
4344
func (e *WriteFormat) ExportContext(ctx context.Context, db *DB, sqlQuery string) error {
4445
queries := sqlss.SplitQueries(sqlQuery)
45-
e.multi = false
4646
if !multi || len(queries) == 1 {
47-
e.multi = true
4847
return e.exportContext(ctx, db, sqlQuery)
4948
}
49+
50+
e.multi = true
5051
for _, query := range queries {
5152
if err := e.exportContext(ctx, db, query); err != nil {
5253
return err

0 commit comments

Comments
 (0)