Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
RQL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cubicweb
RQL
Commits
a206766be96c
Commit
a206766be96c
authored
16 years ago
by
Sylvain Thenault
Browse files
Options
Downloads
Patches
Plain Diff
should not simplify variables used in the GROUPBY clause when there is a
HAVING clause
parent
aedcc8f477b7
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ChangeLog
+4
-0
4 additions, 0 deletions
ChangeLog
stcheck.py
+5
-0
5 additions, 0 deletions
stcheck.py
test/unittest_stcheck.py
+3
-0
3 additions, 0 deletions
test/unittest_stcheck.py
with
12 additions
and
0 deletions
ChangeLog
+
4
−
0
View file @
a206766b
...
@@ -2,6 +2,10 @@
...
@@ -2,6 +2,10 @@
=================
=================
--
--
* should not simplify variables used in the GROUPBY clause when there is a
HAVING clause
2008-07-22 -- 0.19.0
* grammar changes: LIMIT / OFFSET should now be before the WHERE clause,
* grammar changes: LIMIT / OFFSET should now be before the WHERE clause,
though bw compat will be kept for some time
though bw compat will be kept for some time
* when simplifying constant uid nodes, don't remove them from group terms if
* when simplifying constant uid nodes, don't remove them from group terms if
...
...
This diff is collapsed.
Click to expand it.
stcheck.py
+
5
−
0
View file @
a206766b
...
@@ -331,6 +331,11 @@
...
@@ -331,6 +331,11 @@
self
.
visit_union
(
subquery
.
query
)
self
.
visit_union
(
subquery
.
query
)
subquery
.
query
.
schema
=
node
.
root
.
schema
subquery
.
query
.
schema
=
node
.
root
.
schema
self
.
_visit_stmt
(
node
)
self
.
_visit_stmt
(
node
)
if
node
.
having
:
# if there is a having clause, bloc simplification of variables used in GROUPBY
for
term
in
node
.
groupby
:
for
vref
in
term
.
iget_nodes
(
VariableRef
):
vref
.
variable
.
stinfo
[
'
blocsimplification
'
].
add
(
term
)
def
rewrite_shared_optional
(
self
,
exists
,
var
):
def
rewrite_shared_optional
(
self
,
exists
,
var
):
"""
if variable is shared across multiple scopes, need some tree
"""
if variable is shared across multiple scopes, need some tree
...
...
This diff is collapsed.
Click to expand it.
test/unittest_stcheck.py
+
3
−
0
View file @
a206766b
...
@@ -125,6 +125,9 @@
...
@@ -125,6 +125,9 @@
(
'
Any X WITH X BEING (Any X WHERE X eid 12)
'
,
(
'
Any X WITH X BEING (Any X WHERE X eid 12)
'
,
'
Any X WITH X BEING (Any 12)
'
),
'
Any X WITH X BEING (Any 12)
'
),
(
'
Any X GROUPBY X WHERE X eid 12, X connait Y HAVING COUNT(Y) > 10
'
,
'
Any X GROUPBY X WHERE X eid 12, X connait Y HAVING COUNT(Y) > 10
'
)
):
):
yield
self
.
_test_rewrite
,
rql
,
expected
yield
self
.
_test_rewrite
,
rql
,
expected
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment