[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/common/src/dbdrivers/_dbsig DBdriver.py
From: |
Jason Cater |
Subject: |
gnue/common/src/dbdrivers/_dbsig DBdriver.py |
Date: |
Mon, 04 Mar 2002 17:28:28 -0500 |
CVSROOT: /cvsroot/gnue
Module name: gnue
Changes by: Jason Cater <address@hidden> 02/03/04 17:28:28
Modified files:
common/src/dbdrivers/_dbsig: DBdriver.py
Log message:
fixed '= NULL' versus 'IS NULL' problem w/master-detail sources
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/dbdrivers/_dbsig/DBdriver.py.diff?tr1=1.41&tr2=1.42&r1=text&r2=text
Patches:
Index: gnue/common/src/dbdrivers/_dbsig/DBdriver.py
diff -c gnue/common/src/dbdrivers/_dbsig/DBdriver.py:1.41
gnue/common/src/dbdrivers/_dbsig/DBdriver.py:1.42
*** gnue/common/src/dbdrivers/_dbsig/DBdriver.py:1.41 Fri Mar 1 14:05:48 2002
--- gnue/common/src/dbdrivers/_dbsig/DBdriver.py Mon Mar 4 17:28:28 2002
***************
*** 197,203 ****
'le': (2, 2, '(%s <= %s)', None ),
'like': (2, 2, '%s LIKE %s', None ),
'notlike': (2, 2, '%s NOT LIKE %s', None ),
! 'between': (3, 3, '%s BETWEEN %s AND %s', None ) }
def __init__(self, strictQueryCount=1):
GDataObjects.DataObject.__init__(self)
--- 197,207 ----
'le': (2, 2, '(%s <= %s)', None ),
'like': (2, 2, '%s LIKE %s', None ),
'notlike': (2, 2, '%s NOT LIKE %s', None ),
! 'between': (3, 3, '%s BETWEEN %s AND %s', None ),
! # These two are hacks... these are not really valid tags
! # Used when the 2nd value of EQ or NE is NULL.
! '__iseq': (2, 2, '(%s IS %s)', None ),
! '__isne': (2, 2, '(%s IS NOT %s)', None )}
def __init__(self, strictQueryCount=1):
GDataObjects.DataObject.__init__(self)
***************
*** 355,373 ****
v = element.getValue()
return (v == None and "NULL") or ("'%s'" % element.getValue())
elif self.conditionElements.has_key(otype):
! for i in range(0, len(element._children)):
element._children[i] = self.__conditionToSQL(element._children[i])
! if len(element._children) < self.conditionElements[otype][0]:
raise GConditions.ConditionError, \
'Condition element "%s" expects at least %s arguments; found %s'
% \
(otype, self.conditionElements[otype][0],
len(element._children))
! if len(element._children) > self.conditionElements[otype][1]:
raise GConditions.ConditionError, \
'Condition element "%s" expects at most %s arguments; found %s' %
\
(otype, self.conditionElements[otype][0],
len(element._children))
! if self.conditionElements[otype][3] == None:
return self.conditionElements[otype][2] % tuple(element._children)
! else:
return self.conditionElements[otype][2] % \
(string.join(element._children, self.conditionElements[otype][3]))
else:
--- 359,381 ----
v = element.getValue()
return (v == None and "NULL") or ("'%s'" % element.getValue())
elif self.conditionElements.has_key(otype):
! for i in range(0, len(element._children)):
element._children[i] = self.__conditionToSQL(element._children[i])
! if len(element._children) == 2 and \
! otype in ('eq','ne') and \
! element._children[1] == 'NULL':
! otype = "__is%s" % otype
! if len(element._children) < self.conditionElements[otype][0]:
raise GConditions.ConditionError, \
'Condition element "%s" expects at least %s arguments; found %s'
% \
(otype, self.conditionElements[otype][0],
len(element._children))
! if len(element._children) > self.conditionElements[otype][1]:
raise GConditions.ConditionError, \
'Condition element "%s" expects at most %s arguments; found %s' %
\
(otype, self.conditionElements[otype][0],
len(element._children))
! if self.conditionElements[otype][3] == None:
return self.conditionElements[otype][2] % tuple(element._children)
! else:
return self.conditionElements[otype][2] % \
(string.join(element._children, self.conditionElements[otype][3]))
else:
- gnue/common/src/dbdrivers/_dbsig DBdriver.py,
Jason Cater <=