class to the same target. An informative
error is raised now.
+ - [bug] Fixed bug where incorrect type information
+ would be passed when the ORM would bind the
+ "version" column, when using the "version" feature.
+ Tests courtesy Daniel Miller. [ticket:2539]
+
- sql
- [bug] Fixed CTE bug whereby positional
bound parameters present in the CTEs themselves
import sqlalchemy as sa
from test.lib import engines, testing
from sqlalchemy import Integer, String, Date, ForeignKey, literal_column, \
- orm, exc, select
+ orm, exc, select, TypeDecorator
from test.lib.schema import Table, Column
from sqlalchemy.orm import mapper, relationship, Session, \
create_session, column_property, sessionmaker,\
@classmethod
def define_tables(cls, metadata):
+ class SpecialType(TypeDecorator):
+ impl = Date
+ def process_bind_param(self, value, dialect):
+ assert isinstance(value, datetime.date)
+ return value
+
Table('version_table', metadata,
- Column('id', Date, primary_key=True),
+ Column('id', SpecialType, primary_key=True),
Column('version_id', Integer, nullable=False),
Column('value', String(40), nullable=False))