Update of /cvsroot/modeling/ProjectModeling/Modeling
In directory sc8-pr-cvs1:/tmp/cvs-serv21866
Modified Files:
CHANGES SQLExpression.py
Log Message:
Fixed bug #780495: when ec.fetch() is joining two tables or more, the
returned set of objects could have duplicates.
Index: CHANGES
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/CHANGES,v
retrieving revision 1.142
retrieving revision 1.143
diff -C2 -d -r1.142 -r1.143
*** CHANGES 2 Aug 2003 11:14:57 -0000 1.142
--- CHANGES 3 Aug 2003 10:34:14 -0000 1.143
***************
*** 8,11 ****
--- 8,14 ----
--------------------------------------------------------
+ * Fixed bug #780495: when ec.fetch() is joining two tables or more, the
+ returned set of objects could have duplicates.
+
* Fixed bug #774989: improper result returned by CustomObject.snapshot()
wrt tomany relationships --see CustomObject.snapshot() documentation for
Index: SQLExpression.py
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/SQLExpression.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** SQLExpression.py 2 Aug 2003 09:40:49 -0000 1.20
--- SQLExpression.py 3 Aug 2003 10:34:14 -0000 1.21
***************
*** 765,769 ****
lockClause=''
if lock:
! raise 'Unimplemented', 'lock is not implemented yet'
for attribute in attributes:
--- 765,769 ----
lockClause=''
if lock:
! raise NotImplementedError, 'lock is not implemented yet'
for attribute in attributes:
***************
*** 775,779 ****
self._entity.restrictingQualifier() is not None:
# TBD
! raise 'Unimplemented', \
"fetchSpec and/or entity's restrictingQualifier is not None"
--- 775,779 ----
self._entity.restrictingQualifier() is not None:
# TBD
! raise NotImplementedError, \
"fetchSpec and/or entity's restrictingQualifier is not None"
***************
*** 798,802 ****
--- 798,806 ----
joinClause=''
+ # Do we join some tables?
+ multiple_tables_joined=len(self.entityExternalNamesByAliases())>1
selectString=''
+ if multiple_tables_joined:
+ selectString='SELECT DISTINCT '
fetchOrder=None
whereClause=self.whereClauseString()
***************
*** 804,808 ****
orderByClause=''
! if count:
columnList=' COUNT(*) '
else:
--- 808,812 ----
orderByClause=''
! if count and not multiple_tables_joined:
columnList=' COUNT(*) '
else:
***************
*** 820,824 ****
orderByClause=orderByClause,
lockClause=lockClause)
!
def prepareSelectCountExpressionWithAttributes(self,
--- 824,829 ----
orderByClause=orderByClause,
lockClause=lockClause)
! if count and multiple_tables_joined:
! self._statement='SELECT COUNT(*) FROM ( '+self._statement+' )'
def prepareSelectCountExpressionWithAttributes(self,
***************
*** 1015,1019 ****
"""
if not self.useAliases():
! raise 'Unimplemented', '__TBD'
if type(path)==types.StringType:
--- 1020,1024 ----
"""
if not self.useAliases():
! raise NotImplementedError, '__TBD'
if type(path)==types.StringType:
***************
*** 1592,1594 ****
def __unimplemented__(msg='Unimplemented yet'):
! raise 'Unimplemented', msg
--- 1597,1599 ----
def __unimplemented__(msg='Unimplemented yet'):
! raise NotImplementedError, msg
|