Skip to content

fix trim sql#804

Merged
Yancey0623 merged 4 commits intosql-machine-learning:developfrom
Yancey0623:fix_trim_sql
Sep 11, 2019
Merged

fix trim sql#804
Yancey0623 merged 4 commits intosql-machine-learning:developfrom
Yancey0623:fix_trim_sql

Conversation

@Yancey0623
Copy link
Copy Markdown
Collaborator

@Yancey0623 Yancey0623 commented Sep 10, 2019

fixed #796

Comment thread server/sqlflowserver.go
trimedStatements := []string{}
for _, singleSQL := range sqlStatements {
sqlToRun := strings.Trim(singleSQL, "\n")
sqlToRun := strings.TrimSpace(singleSQL)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe \n also need to be trimmed?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strings.TrimSpace can trim \n and space: https://golang.org/pkg/strings/#TrimSpace

@Yancey0623 Yancey0623 merged commit 098093c into sql-machine-learning:develop Sep 11, 2019
@Yancey0623 Yancey0623 deleted the fix_trim_sql branch September 11, 2019 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

commit 2041069 cause select data problem

2 participants