parent
169ec22543
commit
9d21359c44
|
@ -57,7 +57,7 @@ func (self *FromClause) GetString() string {
|
|||
if t.Alias != "" {
|
||||
alias = fmt.Sprintf(" as %s", t.Alias)
|
||||
}
|
||||
names = append(names, fmt.Sprintf("%s%s", t.Name.GetString(), alias))
|
||||
names = append(names, fmt.Sprintf(`"%s"%s`, t.Name.GetString(), alias))
|
||||
}
|
||||
buffer.WriteString(strings.Join(names, ","))
|
||||
}
|
||||
|
|
|
@ -73,6 +73,20 @@ func (self *QueryParserSuite) TestParseBasicSelectQuery(c *C) {
|
|||
}
|
||||
}
|
||||
|
||||
func (self *QueryParserSuite) TestGetQueryStringWithDoubleQuotes(c *C) {
|
||||
q := `select dashboard from "grafana.dashboard_VWx0cmFNUg=="`
|
||||
query, err := ParseQuery(q)
|
||||
c.Assert(err, IsNil)
|
||||
c.Assert(query, HasLen, 1)
|
||||
actualQ := query[0].GetQueryStringWithTimeCondition()
|
||||
actualQuery, err := ParseQuery(actualQ)
|
||||
c.Assert(err, IsNil)
|
||||
c.Assert(actualQuery, HasLen, 1)
|
||||
query[0].SelectQuery.startTimeSpecified = false
|
||||
actualQuery[0].SelectQuery.startTimeSpecified = false
|
||||
c.Assert(actualQuery, DeepEquals, query)
|
||||
}
|
||||
|
||||
func (self *QueryParserSuite) TestGetQueryString(c *C) {
|
||||
for _, query := range []string{
|
||||
"select value from t",
|
||||
|
|
Loading…
Reference in New Issue