up ORM decision making [ticket:593]
- added Interval type to types.py [ticket:595]
- mysql
+ - fixed escaping of the modulo operator [ticket:624]
- added 'fields' to reserved words [ticket:590]
- oracle
- datetime fixes: got subsecond TIMESTAMP to work [ticket:604],
LOB objects detected in a result set to be forced into OracleBinary
so that the LOB is read() automatically, if no typemap was present
(i.e., if a textual execute() was issued).
+- postgres
+ - fixed escaping of the modulo operator [ticket:624]
- sqlite
- sqlite better handles datetime/date/time objects mixed and matched
with various Date/Time/DateTime columns
text += " \n LIMIT 18446744073709551615"
text += " OFFSET " + str(select.offset)
return text
+
+ def binary_operator_string(self, binary):
+ if binary.operator == '%':
+ return '%%'
+ else:
+ return ansisql.ANSICompiler.binary_operator_string(self, binary)
class MySQLSchemaGenerator(ansisql.ANSISchemaGenerator):
def get_column_specification(self, column, override_pk=False, first_pk=False):
def binary_operator_string(self, binary):
if isinstance(binary.type, sqltypes.String) and binary.operator == '+':
return '||'
+ elif binary.operator == '%':
+ return '%%'
else:
return ansisql.ANSICompiler.binary_operator_string(self, binary)
assert u.execute().fetchall() == [('aaa', 'bbb'), ('bbb', 'ccc'), ('ccc', 'aaa')]
assert u.alias('foo').select().execute().fetchall() == [('aaa', 'bbb'), ('bbb', 'ccc'), ('ccc', 'aaa')]
+class OperatorTest(PersistTest):
+ def setUpAll(self):
+ global metadata, flds
+ metadata = BoundMetaData(testbase.db)
+ flds = Table('flds', metadata,
+ Column('idcol', Integer, Sequence('t1pkseq'), primary_key=True),
+ Column('intcol', Integer),
+ Column('strcol', String(50)),
+ )
+ metadata.create_all()
+
+ flds.insert().execute([
+ dict(intcol=5, strcol='foo'),
+ dict(intcol=13, strcol='bar')
+ ])
+
+ def tearDownAll(self):
+ metadata.drop_all()
+
+ def test_modulo(self):
+ self.assertEquals(
+ select([flds.c.intcol % 3], order_by=flds.c.idcol).execute().fetchall(),
+ [(2,),(1,)]
+ )
if __name__ == "__main__":
testbase.main()