Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
c2381308
Commit
c2381308
authored
Jul 20, 2015
by
woodsaj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quote table names passed by arguments
parent
76e9ebde
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
pkg/services/sqlstore/quota.go
+2
-2
No files found.
pkg/services/sqlstore/quota.go
View file @
c2381308
...
@@ -29,7 +29,7 @@ func GetQuotaByTarget(query *m.GetQuotaByTargetQuery) error {
...
@@ -29,7 +29,7 @@ func GetQuotaByTarget(query *m.GetQuotaByTargetQuery) error {
}
}
//get quota used.
//get quota used.
rawSql
:=
fmt
.
Sprintf
(
"SELECT COUNT(*) as count from %s where org_id=?"
,
string
(
query
.
Target
))
rawSql
:=
fmt
.
Sprintf
(
"SELECT COUNT(*) as count from %s where org_id=?"
,
dialect
.
Quote
(
string
(
query
.
Target
)
))
resp
:=
make
([]
*
targetCount
,
0
)
resp
:=
make
([]
*
targetCount
,
0
)
if
err
:=
x
.
Sql
(
rawSql
,
query
.
OrgId
)
.
Find
(
&
resp
);
err
!=
nil
{
if
err
:=
x
.
Sql
(
rawSql
,
query
.
OrgId
)
.
Find
(
&
resp
);
err
!=
nil
{
return
err
return
err
...
@@ -69,7 +69,7 @@ func GetQuotas(query *m.GetQuotasQuery) error {
...
@@ -69,7 +69,7 @@ func GetQuotas(query *m.GetQuotasQuery) error {
result
:=
make
([]
*
m
.
QuotaDTO
,
len
(
quotas
))
result
:=
make
([]
*
m
.
QuotaDTO
,
len
(
quotas
))
for
i
,
q
:=
range
quotas
{
for
i
,
q
:=
range
quotas
{
//get quota used.
//get quota used.
rawSql
:=
fmt
.
Sprintf
(
"SELECT COUNT(*) as count from %s where org_id=?"
,
string
(
q
.
Target
))
rawSql
:=
fmt
.
Sprintf
(
"SELECT COUNT(*) as count from %s where org_id=?"
,
dialect
.
Quote
(
string
(
q
.
Target
)
))
resp
:=
make
([]
*
targetCount
,
0
)
resp
:=
make
([]
*
targetCount
,
0
)
if
err
:=
x
.
Sql
(
rawSql
,
q
.
OrgId
)
.
Find
(
&
resp
);
err
!=
nil
{
if
err
:=
x
.
Sql
(
rawSql
,
q
.
OrgId
)
.
Find
(
&
resp
);
err
!=
nil
{
return
err
return
err
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment