- added undefer_group() MapperOption, sets a set of "deferred"
columns joined by a "group" to load as "undeferred".
- sql
+ - result.last_inserted_ids() should return a list that is identically
+ sized to the primary key constraint of the table. values that were
+ "passively" created and not available via cursor.lastrowid will be None.
- long-identifier detection fixed to use > rather than >= for
max ident length [ticket:589]
- fixed bug where selectable.corresponding_column(selectable.c.col)
class MySQLExecutionContext(default.DefaultExecutionContext):
def post_exec(self):
if self.compiled.isinsert:
- self._last_inserted_ids = [self.cursor.lastrowid]
+ self._last_inserted_ids = [self.cursor.lastrowid] + self._last_inserted_ids[1:]
class MySQLDialect(ansisql.ANSIDialect):
def __init__(self, **kwargs):
class SQLiteExecutionContext(default.DefaultExecutionContext):
def post_exec(self):
if self.compiled.isinsert:
- self._last_inserted_ids = [self.cursor.lastrowid]
+ self._last_inserted_ids = [self.cursor.lastrowid] + self._last_inserted_ids[1:]
super(SQLiteExecutionContext, self).post_exec()
class SQLiteDialect(ansisql.ANSIDialect):
if c in self.compiled.inline_params:
self._lastrow_has_defaults = True
if c.primary_key:
- need_lastrowid = True
+ last_inserted_ids.append(None)
# check if its not present at all. see if theres a default
# and fire it off, and add to bind parameters. if
# its a pk, add the value to our last_inserted_ids list,
if c.primary_key:
last_inserted_ids.append(param.get_processed(c.key))
elif c.primary_key:
- need_lastrowid = True
+ last_inserted_ids.append(None)
# its an explicitly passed pk value - add it to
# our last_inserted_ids list.
elif c.primary_key:
last_inserted_ids.append(param.get_processed(c.key))
- if need_lastrowid:
- self._last_inserted_ids = None
- else:
- self._last_inserted_ids = last_inserted_ids
+ self._last_inserted_ids = last_inserted_ids
self._last_inserted_params = param
elif self.compiled.isupdate:
if isinstance(self.compiled_parameters, list):