Merge lp:~zorba-coders/zorba/markos-scratch into lp:zorba

Proposed by Markos Zaharioudakis
Status: Merged
Approved by: Markos Zaharioudakis
Approved revision: 11073
Merged at revision: 11409
Proposed branch: lp:~zorba-coders/zorba/markos-scratch
Merge into: lp:zorba
Diff against target: 96 lines (+13/-56)
2 files modified
src/compiler/codegen/plan_visitor.cpp (+13/-2)
src/compiler/expression/flwor_expr.cpp (+0/-54)
To merge this branch: bzr merge lp:~zorba-coders/zorba/markos-scratch
Reviewer Review Type Date Requested Status
Markos Zaharioudakis Approve
Review via email: mp+160868@code.launchpad.net

Commit message

an optimization on the fix for bug #1172331

Description of the change

an optimization on the fix for bug #1172331

To post a comment you must log in.
Revision history for this message
Markos Zaharioudakis (markos-za) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job markos-scratch-2013-04-25T12-01-13.891Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/compiler/codegen/plan_visitor.cpp'
2--- src/compiler/codegen/plan_visitor.cpp 2013-04-24 18:01:51 +0000
3+++ src/compiler/codegen/plan_visitor.cpp 2013-04-25 11:58:30 +0000
4@@ -1603,9 +1603,20 @@
5
6 PlanIter_t winVarIter = pop_itstack();
7
8- treatIter = new TreatIterator(sctx, qloc, winVarIter,
9+ bool checkPrime = true;
10+
11+ xqtref_t varPType = TypeOps::prime_type(tm, *varType);
12+ xqtref_t domainPType = TypeOps::prime_type(tm, *domainType);
13+
14+ if (TypeOps::is_subtype(tm, *domainPType, *varPType, qloc))
15+ {
16+ checkPrime = false;
17+ }
18+
19+ treatIter = new TreatIterator(sctx, qloc,
20+ winVarIter,
21 varType,
22- true,
23+ checkPrime,
24 TREAT_TYPE_MATCH,
25 NULL);
26 }
27
28=== modified file 'src/compiler/expression/flwor_expr.cpp'
29--- src/compiler/expression/flwor_expr.cpp 2013-04-24 18:01:51 +0000
30+++ src/compiler/expression/flwor_expr.cpp 2013-04-25 11:58:30 +0000
31@@ -92,31 +92,6 @@
32 if (theVarExpr != NULL)
33 {
34 theVarExpr->set_flwor_clause(this);
35-
36-#if 0
37- if (theKind == window_clause && theVarExpr->get_type() != NULL)
38- {
39- RootTypeManager& rtm = GENV_TYPESYSTEM;
40- TypeManager* tm = theVarExpr->get_type_manager();
41-
42- const QueryLoc& loc = theVarExpr->get_loc();
43-
44- xqtref_t varType = theVarExpr->get_type();
45- xqtref_t domainType = theDomainExpr->get_return_type();
46-
47- if (!TypeOps::is_subtype(tm, *rtm.ITEM_TYPE_STAR, *varType, loc) &&
48- !TypeOps::is_subtype(tm, *domainType, *varType, loc))
49- {
50- theDomainExpr = theCCB->theEM->
51- create_treat_expr(theDomainExpr->get_sctx(),
52- theDomainExpr->get_udf(),
53- theDomainExpr->get_loc(),
54- theDomainExpr,
55- varType,
56- TREAT_TYPE_MATCH);
57- }
58- }
59-#endif
60 }
61 }
62
63@@ -305,35 +280,6 @@
64
65 if (winKind == tumbling_window)
66 theLazyEval = true;
67-
68-#if 0
69- if (varExpr != NULL && sctx != NULL)
70- {
71- RootTypeManager& rtm = GENV_TYPESYSTEM;
72- TypeManager* tm = sctx->get_typemanager();
73-
74- xqtref_t varType = varExpr->get_type();
75-
76- if (varType != NULL)
77- {
78- xqtref_t domainType = domainExpr->get_return_type();
79-
80- if (!TypeOps::is_subtype(tm, *rtm.ITEM_TYPE_STAR, *varType, loc) &&
81- !TypeOps::is_subtype(tm, *domainType, *varType, loc))
82- {
83- domainExpr = theCCB->theEM->
84- create_treat_expr(sctx,
85- domainExpr->get_udf(),
86- loc,
87- domainExpr,
88- varType,
89- TREAT_TYPE_MATCH);
90-
91- set_expr(domainExpr);
92- }
93- }
94- }
95-#endif
96 }
97
98

Subscribers

People subscribed via source and target branches