Ticket #73 (closed defect: invalid)
ext.versioned uses uppercase column names on insert to history table
| Reported by: | guest | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | extensions | Version: | |
| Keywords: | Cc: |
Description
When inserting to the history table of an entity, the versioned plugin uses the column names as returned from a select on the normal table:
old_values = instance.table.select(get_entity_where(instance)).execute().fetchone() # ... dict_values = dict(old_values.items()) connection.execute(instance.__class__.__history_table__.insert(), dict_values)
This results in column names being uppercase in the dictionary given to the insert() function. SA's behavior is to quote non-lowercase column identifiers. In Oracle, this fails, as quoted column identifiers are case-sensitive.
The solution is to use all lowercase column identifiers in the dictionary:
dict_values = dict([(tup[0].lower(), tup[1]) for tup in old_values.items()])
Thanks!
Attachments
Change History
Note: See
TracTickets for help on using
tickets.
