Sqlalchemy

Latest version: v2.0.30

Safety actively analyzes 629639 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 35 of 50

0.8.6

Not secure
:released: March 28, 2014

.. change::
:tags: bug, orm
:tickets: 3006
:versions: 0.9.4

Fixed ORM bug where changing the primary key of an object, then marking
it for DELETE would fail to target the correct row for DELETE.

.. change::
:tags: feature, postgresql
:versions: 0.9.4

Enabled "sane multi-row count" checking for the psycopg2 DBAPI, as
this seems to be supported as of psycopg2 2.0.9.

.. change::
:tags: bug, postgresql
:tickets: 3000
:versions: 0.9.4

Fixed regression caused by release 0.8.5 / 0.9.3's compatibility
enhancements where index reflection on PostgreSQL versions specific
to only the 8.1, 8.2 series again
broke, surrounding the ever problematic int2vector type. While
int2vector supports array operations as of 8.1, apparently it only
supports CAST to a varchar as of 8.3.

.. change::
:tags: bug, orm
:tickets: 2995,
:versions: 0.9.4

Fixed regression from 0.8.3 as a result of :ticket:`2818`
where :meth:`_query.Query.exists` wouldn't work on a query that only
had a :meth:`_query.Query.select_from` entry but no other entities.

.. change::
:tags: bug, general
:tickets: 2986
:versions: 0.9.4

Adjusted ``setup.py`` file to support the possible future
removal of the ``setuptools.Feature`` extension from setuptools.
If this keyword isn't present, the setup will still succeed
with setuptools rather than falling back to distutils. C extension
building can be disabled now also by setting the
DISABLE_SQLALCHEMY_CEXT environment variable. This variable works
whether or not setuptools is even available.

.. change::
:tags: bug, ext
:versions: 0.9.4
:tickets: 2997

Fixed bug in mutable extension as well as
:func:`.attributes.flag_modified` where the change event would not be
propagated if the attribute had been reassigned to itself.

.. change::
:tags: bug, orm
:versions: 0.9.4

Improved an error message which would occur if a query() were made
against a non-selectable, such as a :func:`_expression.literal_column`, and then
an attempt was made to use :meth:`_query.Query.join` such that the "left"
side would be determined as ``None`` and then fail. This condition
is now detected explicitly.

.. change::
:tags: bug, sql
:versions: 0.9.4
:tickets: 2977

Fixed bug in :func:`.tuple_` construct where the "type" of essentially
the first SQL expression would be applied as the "comparison type"
to a compared tuple value; this has the effect in some cases of an
inappropriate "type coercion" occurring, such as when a tuple that
has a mix of String and Binary values improperly coerces target
values to Binary even though that's not what they are on the left
side. :func:`.tuple_` now expects heterogeneous types within its
list of values.

.. change::
:tags: orm, bug
:versions: 0.9.4
:tickets: 2975

Removed stale names from ``sqlalchemy.orm.interfaces.__all__`` and
refreshed with current names, so that an ``import *`` from this
module again works.

.. changelog::

0.8.5

Not secure
:released: February 19, 2014

.. change::
:tags: postgresql, bug
:versions: 0.9.3
:tickets: 2936

Added an additional message to psycopg2 disconnect detection,
"could not send data to server", which complements the existing
"could not receive data from server" and has been observed by users.

.. change::
:tags: postgresql, bug
:versions: 0.9.3

Support has been improved for PostgreSQL reflection behavior on very old
(pre 8.1) versions of PostgreSQL, and potentially other PG engines
such as Redshift (assuming Redshift reports the version as < 8.1).
The query for "indexes" as well as "primary keys" relies upon inspecting
a so-called "int2vector" datatype, which refuses to coerce to an array
prior to 8.1 causing failures regarding the "ANY()" operator used
in the query. Extensive googling has located the very hacky, but
recommended-by-PG-core-developer query to use when PG version < 8.1
is in use, so index and primary key constraint reflection now work
on these versions.


.. change::
:tags: feature, mysql
:versions: 0.9.3
:tickets: 2941

Added new MySQL-specific :class:`.mysql.DATETIME` which includes
fractional seconds support; also added fractional seconds support
to :class:`.mysql.TIMESTAMP`. DBAPI support is limited, though
fractional seconds are known to be supported by MySQL Connector/Python.
Patch courtesy Geert JM Vanderkelen.

.. change::
:tags: bug, mysql
:versions: 0.9.3
:tickets: 2966

Added support for the ``PARTITION BY`` and ``PARTITIONS``
MySQL table keywords, specified as ``mysql_partition_by='value'`` and
``mysql_partitions='value'`` to :class:`_schema.Table`. Pull request
courtesy Marcus McCurdy.

.. change::
:tags: bug, sql
:versions: 0.9.3
:tickets: 2944

Fixed bug where calling :meth:`_expression.Insert.values` with an empty list
or tuple would raise an IndexError. It now produces an empty
insert construct as would be the case with an empty dictionary.

.. change::
:tags: bug, engine, pool
:versions: 0.9.3
:tickets: 2880, 2964

Fixed a critical regression caused by :ticket:`2880` where the newly
concurrent ability to return connections from the pool means that the
"first_connect" event is now no longer synchronized either, thus leading
to dialect mis-configurations under even minimal concurrency situations.

.. change::
:tags: bug, sqlite

Restored a change that was missed in the backport of unique
constraint reflection to 0.8, where :class:`.UniqueConstraint`
with SQLite would fail if reserved keywords were included in the
names of columns. Pull request courtesy Roman Podolyaka.

.. change::
:tags: bug, postgresql
:tickets: 2291
:versions: 0.9.3

Revised this very old issue where the PostgreSQL "get primary key"
reflection query were updated to take into account primary key constraints
that were renamed; the newer query fails on very old versions of
PostgreSQL such as version 7, so the old query is restored in those cases
when server_version_info < (8, 0) is detected.

.. change::
:tags: bug, sql
:tickets: 2957
:versions: 0.9.3

Fixed bug where :meth:`.ColumnOperators.in_` would go into an endless
loop if erroneously passed a column expression whose comparator
included the ``__getitem__()`` method, such as a column that uses the
:class:`_postgresql.ARRAY` type.

.. change::
:tags: bug, orm
:tickets: 2951
:versions: 0.9.3

Fixed bug where :meth:`_query.Query.get` would fail to consistently
raise the :class:`.InvalidRequestError` that invokes when called
on a query with existing criterion, when the given identity is
already present in the identity map.

.. change::
:tags: bug, mysql
:tickets: 2933
:versions: 0.9.3

Fixed bug which prevented MySQLdb-based dialects (e.g.
pymysql) from working in Py3K, where a check for "connection
charset" would fail due to Py3K's more strict value comparison
rules. The call in question wasn't taking the database
version into account in any case as the server version was
still None at that point, so the method overall has been
simplified to rely upon connection.character_set_name().

.. change::
:tags: bug, mysql
:versions: 0.9.2

Some missing methods added to the cymysql dialect, including
_get_server_version_info() and _detect_charset(). Pullreq
courtesy Hajime Nakagami.

.. change::
:tags: bug, py3k

Fixed Py3K bug where a missing import would cause "literal binary"
mode to fail to import "util.binary_type" when rendering a bound
parameter. 0.9 handles this differently. Pull request courtesy
Andreas Zeidler.

.. change::
:tags: bug, orm
:versions: 0.9.2

Fixed error message when an iterator object is passed to
:func:`.class_mapper` or similar, where the error would fail to
render on string formatting. Pullreq courtesy Kyle Stark.

.. change::
:tags: bug, firebird
:versions: 0.9.0
:tickets: 2897

The firebird dialect will quote identifiers which begin with an
underscore. Courtesy Treeve Jelbert.

.. change::
:tags: bug, firebird
:versions: 0.9.0

Fixed bug in Firebird index reflection where the columns within the
index were not sorted correctly; they are now sorted
in order of RDB$FIELD_POSITION.

.. change::
:tags: bug, mssql, firebird
:versions: 0.9.0

The "asdecimal" flag used with the :class:`.Float` type will now
work with Firebird as well as the mssql+pyodbc dialects; previously the
decimal conversion was not occurring.

.. change::
:tags: bug, mssql, pymssql
:versions: 0.9.0

Added "Net-Lib error during Connection reset by peer" message
to the list of messages checked for "disconnect" within the
pymssql dialect. Courtesy John Anderson.

.. change::
:tags: bug, sql
:versions: 0.9.0
:tickets: 2896

Fixed issue where a primary key column that has a Sequence on it,
yet the column is not the "auto increment" column, either because
it has a foreign key constraint or ``autoincrement=False`` set,
would attempt to fire the Sequence on INSERT for backends that don't
support sequences, when presented with an INSERT missing the primary
key value. This would take place on non-sequence backends like
SQLite, MySQL.

.. change::
:tags: bug, sql
:versions: 0.9.0
:tickets: 2895

Fixed bug with :meth:`_expression.Insert.from_select` method where the order
of the given names would not be taken into account when generating
the INSERT statement, thus producing a mismatch versus the column
names in the given SELECT statement. Also noted that
:meth:`_expression.Insert.from_select` implies that Python-side insert defaults
cannot be used, since the statement has no VALUES clause.

.. change::
:tags: enhancement, sql
:versions: 0.9.0

The exception raised when a :class:`.BindParameter` is present
in a compiled statement without a value now includes the key name
of the bound parameter in the error message.

.. change::
:tags: bug, orm
:versions: 0.9.0
:tickets: 2887

An adjustment to the :func:`.subqueryload` strategy which ensures that
the query runs after the loading process has begun; this is so that
the subqueryload takes precedence over other loaders that may be
hitting the same attribute due to other eager/noload situations
at the wrong time.

.. change::
:tags: bug, orm
:versions: 0.9.0
:tickets: 2885

Fixed bug when using joined table inheritance from a table to a
select/alias on the base, where the PK columns were also not same
named; the persistence system would fail to copy primary key values
from the base table to the inherited table upon INSERT.

.. change::
:tags: bug, orm
:versions: 0.9.0
:tickets: 2889

:func:`.composite` will raise an informative error message when the
columns/attribute (names) passed don't resolve to a Column or mapped
attribute (such as an erroneous tuple); previously raised an unbound
local.

.. change::
:tags: bug, declarative
:versions: 0.9.0
:tickets: 2888

Error message when a string arg sent to :func:`_orm.relationship` which
doesn't resolve to a class or mapper has been corrected to work
the same way as when a non-string arg is received, which indicates
the name of the relationship which had the configurational error.

.. changelog::

0.8.4

Not secure
:released: December 8, 2013

.. change::
:tags: bug, engine
:versions: 0.9.0
:tickets: 2881

A DBAPI that raises an error on ``connect()`` which is not a subclass
of dbapi.Error (such as ``TypeError``, ``NotImplementedError``, etc.)
will propagate the exception unchanged. Previously,
the error handling specific to the ``connect()`` routine would both
inappropriately run the exception through the dialect's
:meth:`.Dialect.is_disconnect` routine as well as wrap it in
a :class:`sqlalchemy.exc.DBAPIError`. It is now propagated unchanged
in the same way as occurs within the execute process.

.. change::
:tags: bug, engine, pool
:versions: 0.9.0
:tickets: 2880

The :class:`.QueuePool` has been enhanced to not block new connection
attempts when an existing connection attempt is blocking. Previously,
the production of new connections was serialized within the block
that monitored overflow; the overflow counter is now altered within
its own critical section outside of the connection process itself.

.. change::
:tags: bug, engine, pool
:versions: 0.9.0
:tickets: 2522

Made a slight adjustment to the logic which waits for a pooled
connection to be available, such that for a connection pool
with no timeout specified, it will every half a second break out of
the wait to check for the so-called "abort" flag, which allows the
waiter to break out in case the whole connection pool was dumped;
normally the waiter should break out due to a notify_all() but it's
possible this notify_all() is missed in very slim cases.
This is an extension of logic first introduced in 0.8.0, and the
issue has only been observed occasionally in stress tests.

.. change::
:tags: bug, mssql
:versions: 0.9.0

Fixed bug introduced in 0.8.0 where the ``DROP INDEX``
statement for an index in MSSQL would render incorrectly if the
index were in an alternate schema; the schemaname/tablename
would be reversed. The format has been also been revised to
match current MSSQL documentation. Courtesy Derek Harland.

.. change::
:tags: feature, sql
:tickets: 1443
:versions: 0.9.0b1

Added support for "unique constraint" reflection, via the
:meth:`_reflection.Inspector.get_unique_constraints` method.
Thanks for Roman Podolyaka for the patch.

.. change::
:tags: bug, oracle
:tickets: 2864
:versions: 0.9.0

Added ORA-02396 "maximum idle time" error code to list of
"is disconnect" codes with cx_oracle.

.. change::
:tags: bug, engine
:tickets: 2871
:versions: 0.9.0

Fixed bug where SQL statement would be improperly ASCII-encoded
when a pre-DBAPI :class:`.StatementError` were raised within
:meth:`_engine.Connection.execute`, causing encoding errors for
non-ASCII statements. The stringification now remains within
Python unicode thus avoiding encoding errors.

.. change::
:tags: bug, oracle
:tickets: 2870
:versions: 0.9.0

Fixed bug where Oracle ``VARCHAR`` types given with no length
(e.g. for a ``CAST`` or similar) would incorrectly render ``None CHAR``
or similar.

.. change::
:tags: bug, ext
:tickets: 2869
:versions: 0.9.0

Fixed bug which prevented the ``serializer`` extension from working
correctly with table or column names that contain non-ASCII
characters.

.. change::
:tags: bug, orm
:tickets: 2818
:versions: 0.9.0

Fixed a regression introduced by :ticket:`2818` where the EXISTS
query being generated would produce a "columns being replaced"
warning for a statement with two same-named columns,
as the internal SELECT wouldn't have use_labels set.

.. change::
:tags: bug, postgresql
:tickets: 2855
:versions: 0.9.0

Fixed bug where index reflection would mis-interpret indkey values
when using the pypostgresql adapter, which returns these values
as lists vs. psycopg2's return type of string.

.. changelog::

0.8.3

Not secure
:released: October 26, 2013

.. change::
:tags: bug, oracle
:tickets: 2853
:versions: 0.9.0b1

Fixed bug where Oracle table reflection using synonyms would fail
if the synonym and the table were in different remote schemas.
Patch to fix courtesy Kyle Derr.

.. change::
:tags: bug, sql
:tickets: 2849
:versions: 0.9.0b1

Fixed bug where :func:`.type_coerce` would not interpret ORM
elements with a ``__clause_element__()`` method properly.

.. change::
:tags: bug, sql
:tickets: 2842
:versions: 0.9.0b1

The :class:`.Enum` and :class:`.Boolean` types now bypass
any custom (e.g. TypeDecorator) type in use when producing the
CHECK constraint for the "non native" type. This so that the custom type
isn't involved in the expression within the CHECK, since this
expression is against the "impl" value and not the "decorated" value.

.. change::
:tags: bug, postgresql
:tickets: 2844
:versions: 0.9.0b1

Removed a 128-character truncation from the reflection of the
server default for a column; this code was original from
PG system views which truncated the string for readability.

.. change::
:tags: bug, mysql
:tickets: 2721, 2839
:versions: 0.9.0b1

The change in :ticket:`2721`, which is that the ``deferrable`` keyword
of :class:`_schema.ForeignKeyConstraint` is silently ignored on the MySQL
backend, will be reverted as of 0.9; this keyword will now render again, raising
errors on MySQL as it is not understood - the same behavior will also
apply to the ``initially`` keyword. In 0.8, the keywords will remain
ignored but a warning is emitted. Additionally, the ``match`` keyword
now raises a :exc:`.CompileError` on 0.9 and emits a warning on 0.8;
this keyword is not only silently ignored by MySQL but also breaks
the ON UPDATE/ON DELETE options.

To use a :class:`_schema.ForeignKeyConstraint`
that does not render or renders differently on MySQL, use a custom
compilation option. An example of this usage has been added to the
documentation, see :ref:`mysql_foreign_keys`.

.. change::
:tags: bug, sql
:tickets: 2825
:versions: 0.9.0b1

The ``.unique`` flag on :class:`.Index` could be produced as ``None``
if it was generated from a :class:`_schema.Column` that didn't specify ``unique``
(where it defaults to ``None``). The flag will now always be ``True`` or
``False``.

.. change::
:tags: feature, orm
:tickets: 2836
:versions: 0.9.0b1

Added new option to :func:`_orm.relationship` ``distinct_target_key``.
This enables the subquery eager loader strategy to apply a DISTINCT
to the innermost SELECT subquery, to assist in the case where
duplicate rows are generated by the innermost query which corresponds
to this relationship (there's not yet a general solution to the issue
of dupe rows within subquery eager loading, however, when joins outside
of the innermost subquery produce dupes). When the flag
is set to ``True``, the DISTINCT is rendered unconditionally, and when
it is set to ``None``, DISTINCT is rendered if the innermost relationship
targets columns that do not comprise a full primary key.
The option defaults to False in 0.8 (e.g. off by default in all cases),
None in 0.9 (e.g. automatic by default). Thanks to Alexander Koval
for help with this.

.. seealso::

:ref:`change_2836`

.. change::
:tags: bug, mysql
:tickets: 2515
:versions: 0.9.0b1

MySQL-connector dialect now allows options in the create_engine
query string to override those defaults set up in the connect,
including "buffered" and "raise_on_warnings".

.. change::
:tags: bug, postgresql
:tickets: 2742
:versions: 0.9.0b1

Parenthesis will be applied to a compound SQL expression as
rendered in the column list of a CREATE INDEX statement.

.. change::
:tags: bug, sql
:tickets: 2742
:versions: 0.9.0b1

Fixed bug in default compiler plus those of postgresql, mysql, and
mssql to ensure that any literal SQL expression values are
rendered directly as literals, instead of as bound parameters,
within a CREATE INDEX statement. This also changes the rendering
scheme for other DDL such as constraints.

.. change::
:tags: bug, sql
:tickets: 2815
:versions: 0.9.0b1

A :func:`_expression.select` that is made to refer to itself in its FROM clause,
typically via in-place mutation, will raise an informative error
message rather than causing a recursion overflow.

.. change::
:tags: bug, orm
:tickets: 2813
:versions: 0.9.0b1

Fixed bug where using an annotation such as :func:`.remote` or
:func:`.foreign` on a :class:`_schema.Column` before association with a parent
:class:`_schema.Table` could produce issues related to the parent table not
rendering within joins, due to the inherent copy operation performed
by an annotation.

.. change::
:tags: bug, sql
:tickets: 2831

Non-working "schema" argument on :class:`_schema.ForeignKey` is deprecated;
raises a warning. Removed in 0.9.

.. change::
:tags: bug, postgresql
:tickets: 2819
:versions: 0.9.0b1

Fixed bug where PostgreSQL version strings that had a prefix preceding
the words "PostgreSQL" or "EnterpriseDB" would not parse.
Courtesy Scott Schaefer.

.. change::
:tags: feature, engine
:tickets: 2821
:versions: 0.9.0b1

``repr()`` for the :class:`.URL` of an :class:`_engine.Engine`
will now conceal the password using asterisks.
Courtesy Gunnlaugur Þór Briem.

.. change::
:tags: bug, orm
:tickets: 2818
:versions: 0.9.0b1

Fixed bug where :meth:`_query.Query.exists` failed to work correctly
without any WHERE criterion. Courtesy Vladimir Magamedov.

.. change::
:tags: bug, sql
:tickets: 2811
:versions: 0.9.0b1

Fixed bug where using the ``column_reflect`` event to change the ``.key``
of the incoming :class:`_schema.Column` would prevent primary key constraints,
indexes, and foreign key constraints from being correctly reflected.

.. change::
:tags: feature
:versions: 0.9.0b1

Added a new flag ``system=True`` to :class:`_schema.Column`, which marks
the column as a "system" column which is automatically made present
by the database (such as PostgreSQL ``oid`` or ``xmin``). The
column will be omitted from the ``CREATE TABLE`` statement but will
otherwise be available for querying. In addition, the
:class:`.CreateColumn` construct can be applied to a custom
compilation rule which allows skipping of columns, by producing
a rule that returns ``None``.

.. change::
:tags: bug, orm
:tickets: 2779

Backported a change from 0.9 whereby the iteration of a hierarchy
of mappers used in polymorphic inheritance loads is sorted,
which allows the SELECT statements generated for polymorphic queries
to have deterministic rendering, which in turn helps with caching
schemes that cache on the SQL string itself.

.. change::
:tags: bug, orm
:tickets: 2794
:versions: 0.9.0b1

Fixed a potential issue in an ordered sequence implementation used
by the ORM to iterate mapper hierarchies; under the Jython interpreter
this implementation wasn't ordered, even though cPython and PyPy
maintained ordering.

.. change::
:tags: bug, examples
:versions: 0.9.0b1

Added "autoincrement=False" to the history table created in the
versioning example, as this table shouldn't have autoinc on it
in any case, courtesy Patrick Schmid.

.. change::
:tags: bug, sql
:versions: 0.9.0b1

The :meth:`.ColumnOperators.notin_` operator added in 0.8 now properly
produces the negation of the expression "IN" returns
when used against an empty collection.

.. change::
:tags: feature, examples
:versions: 0.9.0b1

Improved the examples in ``examples/generic_associations``, including
that ``discriminator_on_association.py`` makes use of single table
inheritance do the work with the "discriminator". Also
added a true "generic foreign key" example, which works similarly
to other popular frameworks in that it uses an open-ended integer
to point to any other table, foregoing traditional referential
integrity. While we don't recommend this pattern, information wants
to be free.

.. change::
:tags: feature, orm, declarative
:versions: 0.9.0b1

Added a convenience class decorator :func:`.as_declarative`, is
a wrapper for :func:`.declarative_base` which allows an existing base
class to be applied using a nifty class-decorated approach.

.. change::
:tags: bug, orm
:tickets: 2786
:versions: 0.9.0b1

Fixed bug in ORM-level event registration where the "raw" or
"propagate" flags could potentially be mis-configured in some
"unmapped base class" configurations.

.. change::
:tags: bug, orm
:tickets: 2778
:versions: 0.9.0b1

A performance fix related to the usage of the :func:`.defer` option
when loading mapped entities. The function overhead of applying
a per-object deferred callable to an instance at load time was
significantly higher than that of just loading the data from the row
(note that ``defer()`` is meant to reduce DB/network overhead, not
necessarily function call count); the function call overhead is now
less than that of loading data from the column in all cases. There
is also a reduction in the number of "lazy callable" objects created
per load from N (total deferred values in the result) to 1 (total
number of deferred cols).

.. change::
:tags: bug, sqlite
:tickets: 2781
:versions: 0.9.0b1

The newly added SQLite DATETIME arguments storage_format and
regexp apparently were not fully implemented correctly; while the
arguments were accepted, in practice they would have no effect;
this has been fixed.

.. change::
:tags: bug, sql, postgresql
:tickets: 2780
:versions: 0.9.0b1

Fixed bug where the expression system relied upon the ``str()``
form of a some expressions when referring to the ``.c`` collection
on a ``select()`` construct, but the ``str()`` form isn't available
since the element relies on dialect-specific compilation constructs,
notably the ``__getitem__()`` operator as used with a PostgreSQL
``ARRAY`` element. The fix also adds a new exception class
:exc:`.UnsupportedCompilationError` which is raised in those cases
where a compiler is asked to compile something it doesn't know
how to.

.. change::
:tags: bug, engine, oracle
:tickets: 2776
:versions: 0.9.0b1

Dialect.initialize() is not called a second time if an :class:`_engine.Engine`
is recreated, due to a disconnect error. This fixes a particular
issue in the Oracle 8 dialect, but in general the dialect.initialize()
phase should only be once per dialect.

.. change::
:tags: feature, sql
:tickets: 722

Added new method to the :func:`_expression.insert` construct
:meth:`_expression.Insert.from_select`. Given a list of columns and
a selectable, renders ``INSERT INTO (table) (columns) SELECT ..``.

.. change::
:tags: feature, sql
:versions: 0.9.0b1

The :func:`_expression.update`, :func:`_expression.insert`, and :func:`_expression.delete` constructs
will now interpret ORM entities as target tables to be operated upon,
e.g.::

from sqlalchemy import insert, update, delete

ins = insert(SomeMappedClass).values(x=5)

del_ = delete(SomeMappedClass).where(SomeMappedClass.id == 5)

upd = update(SomeMappedClass).where(SomeMappedClass.id == 5).values(name="ed")

.. change::
:tags: bug, orm
:tickets: 2773
:versions: 0.9.0b1

Fixed bug whereby attribute history functions would fail
when an object we moved from "persistent" to "pending"
using the :func:`.make_transient` function, for operations
involving collection-based backrefs.

.. change::
:tags: bug, engine, pool
:tickets: 2772
:versions: 0.9.0b1

Fixed bug where :class:`.QueuePool` would lose the correct
checked out count if an existing pooled connection failed to reconnect
after an invalidate or recycle event.

.. changelog::

0.8.2

Not secure
:released: July 3, 2013

.. change::
:tags: bug, mysql
:tickets: 2768
:versions: 0.9.0b1

Fixed bug when using multi-table UPDATE where a supplemental
table is a SELECT with its own bound parameters, where the positioning
of the bound parameters would be reversed versus the statement
itself when using MySQL's special syntax.

.. change::
:tags: bug, sqlite
:tickets: 2764
:versions: 0.9.0b1

Added :class:`sqlalchemy.types.BIGINT` to the list of type names that can be
reflected by the SQLite dialect; courtesy Russell Stuart.

.. change::
:tags: feature, orm, declarative
:tickets: 2761
:versions: 0.9.0b1

ORM descriptors such as hybrid properties can now be referenced
by name in a string argument used with ``order_by``,
``primaryjoin``, or similar in :func:`_orm.relationship`,
in addition to column-bound attributes.

.. change::
:tags: feature, firebird
:tickets: 2763
:versions: 0.9.0b1

Added new flag ``retaining=True`` to the kinterbasdb and fdb dialects.
This controls the value of the ``retaining`` flag sent to the
``commit()`` and ``rollback()`` methods of the DBAPI connection.
Due to historical concerns, this flag defaults to ``True`` in 0.8.2,
however in 0.9.0b1 this flag defaults to ``False``.

.. change::
:tags: requirements
:versions: 0.9.0b1

The Python `mock <https://pypi.org/project/mock>`_ library
is now required in order to run the unit test suite. While part
of the standard library as of Python 3.3, previous Python installations
will need to install this in order to run unit tests or to
use the ``sqlalchemy.testing`` package for external dialects.

.. change::
:tags: bug, orm
:tickets: 2750
:versions: 0.9.0b1

A warning is emitted when trying to flush an object of an inherited
class where the polymorphic discriminator has been assigned
to a value that is invalid for the class.

.. change::
:tags: bug, postgresql
:tickets: 2740
:versions: 0.9.0b1

The behavior of :func:`.extract` has been simplified on the
PostgreSQL dialect to no longer inject a hardcoded ``::timestamp``
or similar cast into the given expression, as this interfered
with types such as timezone-aware datetimes, but also
does not appear to be at all necessary with modern versions
of psycopg2.


.. change::
:tags: bug, firebird
:tickets: 2757
:versions: 0.9.0b1

Type lookup when reflecting the Firebird types LONG and
INT64 has been fixed so that LONG is treated as INTEGER,
INT64 treated as BIGINT, unless the type has a "precision"
in which case it's treated as NUMERIC. Patch courtesy
Russell Stuart.

.. change::
:tags: bug, postgresql
:tickets: 2766
:versions: 0.9.0b1

Fixed bug in HSTORE type where keys/values that contained
backslashed quotes would not be escaped correctly when
using the "non native" (i.e. non-psycopg2) means
of translating HSTORE data. Patch courtesy Ryan Kelly.

.. change::
:tags: bug, postgresql
:tickets: 2767
:versions: 0.9.0b1

Fixed bug where the order of columns in a multi-column
PostgreSQL index would be reflected in the wrong order.
Courtesy Roman Podolyaka.

.. change::
:tags: bug, sql
:tickets: 2746, 2668
:versions: 0.9.0b1

Multiple fixes to the correlation behavior of
:class:`_expression.Select` constructs, first introduced in 0.8.0:

* To satisfy the use case where FROM entries should be
correlated outwards to a SELECT that encloses another,
which then encloses this one, correlation now works
across multiple levels when explicit correlation is
established via :meth:`_expression.Select.correlate`, provided
that the target select is somewhere along the chain
contained by a WHERE/ORDER BY/columns clause, not
just nested FROM clauses. This makes
:meth:`_expression.Select.correlate` act more compatibly to
that of 0.7 again while still maintaining the new
"smart" correlation.

* When explicit correlation is not used, the usual
"implicit" correlation limits its behavior to just
the immediate enclosing SELECT, to maximize compatibility
with 0.7 applications, and also prevents correlation
across nested FROMs in this case, maintaining compatibility
with 0.8.0/0.8.1.

* The :meth:`_expression.Select.correlate_except` method was not
preventing the given FROM clauses from correlation in
all cases, and also would cause FROM clauses to be incorrectly
omitted entirely (more like what 0.7 would do),
this has been fixed.

* Calling `select.correlate_except(None)` will enter
all FROM clauses into correlation as would be expected.

.. change::
:tags: bug, ext
:versions: 0.9.0b1

Fixed bug whereby if a composite type were set up
with a function instead of a class, the mutable extension
would trip up when it tried to check that column
for being a :class:`.MutableComposite` (which it isn't).
Courtesy asldevi.

.. change::
:tags: feature, sql
:tickets: 2744, 2734

Provided a new attribute for :class:`.TypeDecorator`
called :attr:`.TypeDecorator.coerce_to_is_types`,
to make it easier to control how comparisons using
``==`` or ``!=`` to ``None`` and boolean types goes
about producing an ``IS`` expression, or a plain
equality expression with a bound parameter.

.. change::
:tags: feature, postgresql
:versions: 0.9.0b1

Support for PostgreSQL 9.2 range types has been added.
Currently, no type translation is provided, so works
directly with strings or psycopg2 2.5 range extension types
at the moment. Patch courtesy Chris Withers.

.. change::
:tags: bug, examples
:versions: 0.9.0b1

Fixed an issue with the "versioning" recipe whereby a many-to-one
reference could produce a meaningless version for the target,
even though it was not changed, when backrefs were present.
Patch courtesy Matt Chisholm.

.. change::
:tags: feature, postgresql
:tickets: 2072
:versions: 0.9.0b1

Added support for "AUTOCOMMIT" isolation when using the psycopg2
DBAPI. The keyword is available via the ``isolation_level``
execution option. Patch courtesy Roman Podolyaka.

.. change::
:tags: bug, orm
:tickets: 2759
:versions: 0.9.0b1

Fixed bug in polymorphic SQL generation where multiple joined-inheritance
entities against the same base class joined to each other as well
would not track columns on the base table independently of each other if
the string of joins were more than two entities long.

.. change::
:tags: bug, engine
:versions: 0.9.0b1

Fixed bug where the ``reset_on_return`` argument to various :class:`_pool.Pool`
implementations would not be propagated when the pool was regenerated.
Courtesy Eevee.

.. change::
:tags: bug, orm
:tickets: 2754
:versions: 0.9.0b1

Fixed bug where sending a composite attribute into :meth:`_query.Query.order_by`
would produce a parenthesized expression not accepted by some databases.

.. change::
:tags: bug, orm
:tickets: 2755
:versions: 0.9.0b1

Fixed the interaction between composite attributes and
the :func:`.aliased` function. Previously, composite attributes
wouldn't work correctly in comparison operations when aliasing
was applied.

.. change::
:tags: bug, mysql
:tickets: 2715
:versions: 0.9.0b1

Added another conditional to the ``mysql+gaerdbms`` dialect to
detect so-called "development" mode, where we should use the
``rdbms_mysqldb`` DBAPI. Patch courtesy Brett Slatkin.

.. change::
:tags: feature, mysql
:tickets: 2704
:versions: 0.9.0b1

The ``mysql_length`` parameter used with :class:`.Index` can now
be passed as a dictionary of column names/lengths, for use
with composite indexes. Big thanks to Roman Podolyaka for the
patch.

.. change::
:tags: bug, mssql
:tickets: 2747
:versions: 0.9.0b1

When querying the information schema on SQL Server 2000, removed
a CAST call that was added in 0.8.1 to help with driver issues,
which apparently is not compatible on 2000.
The CAST remains in place for SQL Server 2005 and greater.

.. change::
:tags: bug, mysql
:tickets: 2721
:versions: 0.9.0b1

The ``deferrable`` keyword argument on :class:`_schema.ForeignKey` and
:class:`_schema.ForeignKeyConstraint` will not render the ``DEFERRABLE`` keyword
on the MySQL dialect. For a long time we left this in place because
a non-deferrable foreign key would act very differently than a deferrable
one, but some environments just disable FKs on MySQL, so we'll be less
opinionated here.

.. change::
:tags: bug, ext, orm
:tickets: 2730
:versions: 0.9.0b1

Fixed bug where :class:`.MutableDict` didn't report a change event
when ``clear()`` was called.

.. change::
:tags: bug, sql
:tickets: 2738
:versions: 0.9.0b1

Fixed bug whereby joining a select() of a table "A" with multiple
foreign key paths to a table "B", to that table "B", would fail
to produce the "ambiguous join condition" error that would be
reported if you join table "A" directly to "B"; it would instead
produce a join condition with multiple criteria.

.. change::
:tags: bug, sql, reflection
:tickets: 2728
:versions: 0.9.0b1

Fixed bug whereby using :meth:`_schema.MetaData.reflect` across a remote
schema as well as a local schema could produce wrong results
in the case where both schemas had a table of the same name.

.. change::
:tags: bug, sql
:tickets: 2726
:versions: 0.9.0b1

Removed the "not implemented" ``__iter__()`` call from the base
:class:`.ColumnOperators` class, while this was introduced
in 0.8.0 to prevent an endless, memory-growing loop when one also
implements a ``__getitem__()`` method on a custom
operator and then calls erroneously ``list()`` on that object,
it had the effect of causing column elements to report that they
were in fact iterable types which then throw an error when you try
to iterate. There's no real way to have both sides here so we
stick with Python best practices. Careful with implementing
``__getitem__()`` on your custom operators!

.. change::
:tags: feature, orm
:tickets: 2736

Added a new method :meth:`_query.Query.select_entity_from` which
will in 0.9 replace part of the functionality of
:meth:`_query.Query.select_from`. In 0.8, the two methods perform
the same function, so that code can be migrated to use the
:meth:`_query.Query.select_entity_from` method as appropriate.
See the 0.9 migration guide for details.

.. change::
:tags: bug, orm
:tickets: 2737

Fixed a regression caused by :ticket:`2682` whereby the
evaluation invoked by :meth:`_query.Query.update` and :meth:`_query.Query.delete`
would hit upon unsupported ``True`` and ``False`` symbols
which now appear due to the usage of ``IS``.

.. change::
:tags: bug, postgresql
:tickets: 2735

Fixed the HSTORE type to correctly encode/decode for unicode.
This is always on, as the hstore is a textual type, and
matches the behavior of psycopg2 when using Python 3.
Courtesy Dmitry Mugtasimov.

.. change::
:tags: bug, examples

Fixed a small bug in the dogpile example where the generation
of SQL cache keys wasn't applying deduping labels to the
statement the same way :class:`_query.Query` normally does.

.. change::
:tags: bug, engine, sybase
:tickets: 2732

Fixed a bug where the routine to detect the correct kwargs
being sent to :func:`_sa.create_engine` would fail in some cases,
such as with the Sybase dialect.

.. change::
:tags: bug, orm
:tickets: 2481

Fixed a regression from 0.7 caused by this ticket, which
made the check for recursion overflow in self-referential
eager joining too loose, missing a particular circumstance
where a subclass had lazy="joined" or "subquery" configured
and the load was a "with_polymorphic" against the base.

.. change::
:tags: bug, orm
:tickets: 2718

Fixed a regression from 0.7 where the contextmanager feature
of :meth:`.Session.begin_nested` would fail to correctly
roll back the transaction when a flush error occurred, instead
raising its own exception while leaving the session still
pending a rollback.

.. change::
:tags: bug, mysql

Updated mysqlconnector dialect to check for disconnect based
on the apparent string message sent in the exception; tested
against mysqlconnector 1.0.9.

.. change::
:tags: bug, sql, mssql
:tickets: 2682

Regression from this ticket caused the unsupported keyword
"true" to render, added logic to convert this to 1/0
for SQL server.

.. changelog::

0.8.1

Not secure
:released: April 27, 2013

.. change::
:tags: bug, orm
:tickets: 2698

Fixes to the ``sqlalchemy.ext.serializer`` extension, including
that the "id" passed from the pickler is turned into a string
to prevent against bytes being parsed on Py3K, as well as that
``relationship()`` and ``orm.join()`` constructs are now properly
serialized.

.. change::
:tags: bug, orm
:tickets: 2714

A significant improvement to the inner workings of query.join(),
such that the decisionmaking involved on how to join has been
dramatically simplified. New test cases now pass such as
multiple joins extending from the middle of an already complex
series of joins involving inheritance and such. Joining from
deeply nested subquery structures is still complicated and
not without caveats, but with these improvements the edge
cases are hopefully pushed even farther out to the edges.

.. change::
:tags: feature, orm
:tickets: 2673

Added a convenience method to Query that turns a query into an
EXISTS subquery of the form
``EXISTS (SELECT 1 FROM ... WHERE ...)``.

.. change::
:tags: bug, orm

Added a conditional to the unpickling process for ORM
mapped objects, such that if the reference to the object
were lost when the object was pickled, we don't
erroneously try to set up _sa_instance_state - fixes
a NoneType error.

.. change::
:tags: bug, postgresql
:tickets: 2712

Opened up the checking for "disconnect" with psycopg2/libpq
to check for all the various "disconnect" messages within
the full exception hierarchy. Specifically the
"closed the connection unexpectedly" message has now been
seen in at least three different exception types.
Courtesy Eli Collins.

.. change::
:tags: bug, sql, mysql
:tickets: 2682

Fully implemented the IS and IS NOT operators with
regards to the True/False constants. An expression like
``col.is_(True)`` will now render ``col IS true``
on the target platform, rather than converting the True/
False constant to an integer bound parameter.
This allows the ``is_()`` operator to work on MySQL when
given True/False constants.

.. change::
:tags: bug, postgresql
:tickets: 2681

The operators for the PostgreSQL ARRAY type supports
input types of sets, generators, etc. even when
a dimension is not specified, by turning the given
iterable into a collection unconditionally.

.. change::
:tags: bug, mysql

Fixes to support the latest cymysql DBAPI, courtesy
Hajime Nakagami.

.. change::
:tags: bug, mysql
:tickets: 2663

Improvements to the operation of the pymysql dialect on
Python 3, including some important decode/bytes steps.
Issues remain with BLOB types due to driver issues.
Courtesy Ben Trofatter.

.. change::
:tags: bug, orm
:tickets: 2710

Fixed bug where many-to-many relationship with uselist=False
would fail to delete the association row and raise an error
if the scalar attribute were set to None. This was a
regression introduced by the changes for :ticket:`2229`.

.. change::
:tags: bug, orm
:tickets: 2708

Improved the behavior of instance management regarding
the creation of strong references within the Session;
an object will no longer have an internal reference cycle
created if it's in the transient state or moves into the
detached state - the strong ref is created only when the
object is attached to a Session and is removed when the
object is detached. This makes it somewhat safer for an
object to have a `__del__()` method, even though this is
not recommended, as relationships with backrefs produce
cycles too. A warning has been added when a class with
a `__del__()` method is mapped.

.. change::
:tags: bug, sql
:tickets: 2702

A major fix to the way in which a select() object produces
labeled columns when apply_labels() is used; this mode
produces a SELECT where each column is labeled as in
<tablename>_<columnname>, to remove column name collisions
for a multiple table select. The fix is that if two labels
collide when combined with the table name, i.e.
"foo.bar_id" and "foo_bar.id", anonymous aliasing will be
applied to one of the dupes. This allows the ORM to handle
both columns independently; previously, 0.7
would in some cases silently emit a second SELECT for the
column that was "duped", and in 0.8 an ambiguous column error
would be emitted. The "keys" applied to the .c. collection
of the select() will also be deduped, so that the "column
being replaced" warning will no longer emit for any select()
that specifies use_labels, though the dupe key will be given
an anonymous label which isn't generally user-friendly.

.. change::
:tags: bug, mysql

Updated a regexp to correctly extract error code on
google app engine v1.7.5 and newer. Courtesy
Dan Ring.

.. change::
:tags: bug, examples

Fixed a long-standing bug in the caching example, where
the limit/offset parameter values wouldn't be taken into
account when computing the cache key. The
_key_from_query() function has been simplified to work
directly from the final compiled statement in order to get
at both the full statement as well as the fully processed
parameter list.

.. change::
:tags: bug, mssql
:tickets: 2355

Part of a longer series of fixes needed for pyodbc+
mssql, a CAST to NVARCHAR(max) has been added to the bound
parameter for the table name and schema name in all information schema
queries to avoid the issue of comparing NVARCHAR to NTEXT,
which seems to be rejected by the ODBC driver in some cases,
such as FreeTDS (0.91 only?) plus unicode bound parameters being passed.
The issue seems to be specific to the SQL Server information
schema tables and the workaround is harmless for those cases
where the problem doesn't exist in the first place.

.. change::
:tags: bug, sql
:tickets: 2691

Fixed bug where disconnect detect on error would
raise an attribute error if the error were being
raised after the Connection object had already
been closed.

.. change::
:tags: bug, sql
:tickets: 2703

Reworked internal exception raises that emit
a rollback() before re-raising, so that the stack
trace is preserved from sys.exc_info() before entering
the rollback. This so that the traceback is preserved
when using coroutine frameworks which may have switched
contexts before the rollback function returns.

.. change::
:tags: bug, orm
:tickets: 2697

Fixed bug whereby ORM would run the wrong kind of
query when refreshing an inheritance-mapped class
where the superclass was mapped to a non-Table
object, like a custom join() or a select(),
running a query that assumed a hierarchy that's
mapped to individual Table-per-class.

.. change::
:tags: bug, orm

Fixed `__repr__()` on mapper property constructs
to work before the object is initialized, so
that Sphinx builds with recent Sphinx versions
can read them.

.. change::
:tags: bug, sql, postgresql

The _Binary base type now converts values through
the bytes() callable when run on Python 3; in particular
psycopg2 2.5 with Python 3.3 seems to now be returning
the "memoryview" type, so this is converted to bytes
before return.

.. change::
:tags: bug, sql
:tickets: 2695

Improvements to Connection auto-invalidation
handling. If a non-disconnect error occurs,
but leads to a delayed disconnect error within error
handling (happens with MySQL), the disconnect condition
is detected. The Connection can now also be closed
when in an invalid state, meaning it will raise "closed"
on next usage, and additionally the "close with result"
feature will work even if the autorollback in an error
handling routine fails and regardless of whether the
condition is a disconnect or not.


.. change::
:tags: bug, orm, declarative
:tickets: 2656

Fixed indirect regression regarding :func:`.has_inherited_table`,
where since it considers the current class' ``__table__``, was
sensitive to when it was called. This is 0.7's behavior also,
but in 0.7 things tended to "work out" within events like
``__mapper_args__()``. :func:`.has_inherited_table` now only
considers superclasses, so should return the same answer
regarding the current class no matter when it's called
(obviously assuming the state of the superclass).

.. change::
:tags: bug, mssql

Added support for additional "disconnect" messages
to the pymssql dialect. Courtesy John Anderson.

.. change::
:tags: feature, sql

Loosened the check on dialect-specific argument names
passed to Table(); since we want to support external dialects
and also want to support args without a certain dialect
being installed, it only checks the format of the arg now,
rather than looking for that dialect in sqlalchemy.dialects.

.. change::
:tags: bug, sql

Fixed bug whereby a DBAPI that can return "0"
for cursor.lastrowid would not function correctly
in conjunction with :attr:`_engine.ResultProxy.inserted_primary_key`.

.. change::
:tags: bug, mssql
:tickets: 2683

Fixed Py3K bug regarding "binary" types and
pymssql. Courtesy Marc Abramowitz.

.. change::
:tags: bug, postgresql
:tickets: 2680

Added missing HSTORE type to postgresql type names
so that the type can be reflected.

.. changelog::

Page 35 of 50

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.