You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Sql Metric Expression which uses % has % duped in tableView query #274
When I used this metric to create a table view the values were not being populated. Looking into the JSON I found the query had duplicated the %:
query: "SELECT "serviceName" AS "serviceName", CAST(strftime("%%s", max("timestamp")) AS INT)
AS latest_date FROM "testResults" WHERE timestamp >= '2016-03-29 15:57:43.000000' AND timestamp <= '2016-04-05 15:57:43.000000' GROUP BY "serviceName" ORDER BY
CAST(strftime("%%s", max("timestamp")) AS INT) DESC LIMIT 50000 OFFSET 0"
Current end result is this column ends up displaying a 0 for each entry
I did try escaping around the % and the " characters surrounding the %s but I'm still getting the % duplicated.
query: "SELECT CAST(strftime("/_%%s", max("timestamp")) AS INT) AS latest_date FROM "testResults" WHERE timestamp >= '2016-03-30 08:36:01.000000' AND timestamp <= '2016-04-06 08:36:01.000000' LIMIT 50000 OFFSET 0"
query: "SELECT CAST(strftime("\%%s", max("timestamp")) AS INT) AS latest_date FROM "testResults" WHERE timestamp >= '2016-03-30 08:36:01.000000' AND timestamp <= '2016-04-06 08:36:01.000000' LIMIT 50000 OFFSET 0"
Have you tried doubling the % as in %%? I think we had this bug before but forgot about the details/workaround.
I'll give that a shot.
It appears to make more % characters
query: "SELECT "serviceName" AS "serviceName", CAST(strftime("%%%%s", max("timestamp")) AS INT) AS latest_date FROM "testResults" WHERE timestamp >= '2016-03-31 11:20:59.000000' AND timestamp <= '2016-04-07 11:20:59.000000' GROUP BY "serviceName" ORDER BY CAST(strftime("%%%%s", max("timestamp")) AS INT) DESC LIMIT 50000 OFFSET 0"
Activity
kingo55 commentedon Apr 6, 2016
Does it need escaping? It's weird it's returning the quote marks unescaped too.
scophotog commentedon Apr 6, 2016
I did try escaping around the % and the " characters surrounding the %s but I'm still getting the % duplicated.
mistercrunch commentedon Apr 7, 2016
Have you tried doubling the
%as in%%? I think we had this bug before but forgot about the details/workaround.mistercrunch commentedon Apr 7, 2016
Also which DB / sqlalchemy dialect are you using?
scophotog commentedon Apr 7, 2016
I'll give that a shot.
I'm using sqllite3.
scophotog commentedon Apr 7, 2016
It appears to make more % characters
mtkage commentedon Dec 29, 2016
Is there a workaround for this problem?
ratb3rt commentedon Mar 8, 2017
This seems refers to a SQLAlchemy bug, which should be fixed in v1.2. It's patched for DateTimes in models.py :
Patch for sqlalchemy bugBug ref: https://bitbucket.org/zzzeek/sqlalchemy/issues/3740/clean-up-doubling-of-percent-signs-base-on
mistercrunch commentedon Mar 8, 2017
in #2330 I started doubling the
%in the WHERE clause and in the new LIKE clause of filters.SO-166: Fixed bug editing uploaded database connection (apache#274)