]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
- The :meth:`.Operators.match` operator is now handled such that the
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 4 Dec 2014 23:29:56 +0000 (18:29 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 4 Dec 2014 23:29:56 +0000 (18:29 -0500)
commitf5ff86983f9cc7914a89b96da1fd2638677d345b
tree39490890539b0b65cf0d3daadd22c99d604bdd15
parent87bfcf91e9659893f17adf307090bc0a4a8a8f23
- The :meth:`.Operators.match` operator is now handled such that the
return type is not strictly assumed to be boolean; it now
returns a :class:`.Boolean` subclass called :class:`.MatchType`.
The type will still produce boolean behavior when used in Python
expressions, however the dialect can override its behavior at
result time.  In the case of MySQL, while the MATCH operator
is typically used in a boolean context within an expression,
if one actually queries for the value of a match expression, a
floating point value is returned; this value is not compatible
with SQLAlchemy's C-based boolean processor, so MySQL's result-set
behavior now follows that of the :class:`.Float` type.
A new operator object ``notmatch_op`` is also added to better allow
dialects to define the negation of a match operation.
fixes #3263
14 files changed:
doc/build/changelog/changelog_10.rst
doc/build/changelog/migration_10.rst
doc/build/core/types.rst
lib/sqlalchemy/dialects/mysql/base.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/default_comparator.py
lib/sqlalchemy/sql/elements.py
lib/sqlalchemy/sql/operators.py
lib/sqlalchemy/sql/sqltypes.py
lib/sqlalchemy/sql/type_api.py
lib/sqlalchemy/types.py
test/dialect/mysql/test_query.py
test/dialect/postgresql/test_query.py
test/sql/test_operators.py