Skip to content
This repository has been archived by the owner on Jun 14, 2019. It is now read-only.

Commit

Permalink
Merge pull request #4 from ethantkoenig/master
Browse files Browse the repository at this point in the history
Fix empty IN/NOT IN conditions
  • Loading branch information
lunny authored May 19, 2017
2 parents c6e604e + 0431863 commit 31ad0dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions cond_in.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ func In(col string, values ...interface{}) Cond {
}

func (condIn condIn) handleBlank(w Writer) error {
if _, err := fmt.Fprintf(w, "%s IN ()", condIn.col); err != nil {
return err
}
return nil
_, err := fmt.Fprint(w, "0=1")
return err
}

func (condIn condIn) WriteTo(w Writer) error {
Expand Down
6 changes: 2 additions & 4 deletions cond_notin.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ func NotIn(col string, values ...interface{}) Cond {
}

func (condNotIn condNotIn) handleBlank(w Writer) error {
if _, err := fmt.Fprintf(w, "%s NOT IN ()", condNotIn.col); err != nil {
return err
}
return nil
_, err := fmt.Fprint(w, "0=0")
return err
}

func (condNotIn condNotIn) WriteTo(w Writer) error {
Expand Down

0 comments on commit 31ad0dd

Please sign in to comment.