mirror of
https://github.com/pgsty/minio.git
synced 2026-03-16 01:26:03 +01:00
fix: s3 sql parse error for colums as with quotes (#18765)
This commit is contained in:
@@ -112,6 +112,14 @@ func ParseSelectStatement(s string) (stmt SelectStatement, err error) {
|
||||
|
||||
// Set table alias
|
||||
stmt.tableAlias = selectAST.From.As
|
||||
// Remove quotes from column aliases
|
||||
if selectAST.Expression != nil {
|
||||
for _, exp := range selectAST.Expression.Expressions {
|
||||
if strings.HasSuffix(exp.As, "'") && strings.HasPrefix(exp.As, "'") && len(exp.As) >= 2 {
|
||||
exp.As = exp.As[1 : len(exp.As)-1]
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user