Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pony
tshistory
Commits
d4e2605c761e
Commit
2c83b805
authored
May 24, 2019
by
Aurélien Campéas
Browse files
log: fix limit vs order issue
sql is such a fuss...
parent
7a40906739f0
Changes
2
Hide whitespace changes
Inline
Side-by-side
test/test_tsio.py
View file @
d4e2605c
...
...
@@ -369,6 +369,9 @@ def test_changeset_metadata(engine, tsh):
meta
=
tsh
.
changeset_metadata
(
engine
,
log
[
0
][
'rev'
])
assert
meta
==
{
'foo'
:
'A'
,
'bar'
:
42
}
log
=
tsh
.
log
(
engine
,
names
=
[
'ts-cs-metadata'
],
limit
=
1
)
assert
len
(
log
)
==
1
def
test_revision_date
(
engine
,
tsh
):
for
i
in
range
(
1
,
5
):
...
...
tshistory/tsio.py
View file @
d4e2605c
...
...
@@ -503,9 +503,9 @@ class timeseries(SeriesServices):
if
todate
:
q
.
where
(
'cset.insertion_date <= %(todate)s'
,
todate
=
todate
)
q
.
option
(
'order by cset.id desc'
)
if
limit
:
q
.
option
(
'limit %(limit)s'
,
limit
=
limit
)
q
.
option
(
'order by cset.id desc'
)
rset
=
q
.
do
(
cn
)
for
csetid
,
author
,
revdate
,
meta
in
rset
.
fetchall
():
...
...
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