-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix query batch mode returning zero exit code when rows return errors. Closes #3044 #3046
Conversation
cmd/query.go
Outdated
@@ -135,7 +135,7 @@ func runQueryCmd(cmd *cobra.Command, args []string) { | |||
} | |||
defer initData.Cleanup(ctx) | |||
|
|||
var failures int | |||
var failures, rowErrors int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a need to distinguish between failures
and rowErrors
- can't we just use a single var?
pkg/display/display.go
Outdated
@@ -53,7 +53,8 @@ func EnableTiming() DisplayOption { | |||
} | |||
|
|||
// ShowOutput displays the output using the proper formatter as applicable | |||
func ShowOutput(ctx context.Context, result *queryresult.Result, opts ...DisplayOption) { | |||
func ShowOutput(ctx context.Context, result *queryresult.Result, opts ...DisplayOption) int { | |||
rowErr := 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rowErrors
pkg/query/queryexecute/execute.go
Outdated
// print the data as it comes | ||
for r := range resultsStreamer.Results { | ||
display.ShowOutput(ctx, r, display.ShowTimingOnOutput(constants.OutputFormatTable)) | ||
rowErr = display.ShowOutput(ctx, r, display.ShowTimingOnOutput(constants.OutputFormatTable)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rowErrors
No description provided.