1============= 21.0 Changelog 3============= 4 5.. changelog_imports:: 6 7 .. include:: changelog_09.rst 8 :start-line: 5 9 10 11 .. include:: changelog_08.rst 12 :start-line: 5 13 14 15 .. include:: changelog_07.rst 16 :start-line: 5 17 18 19 20.. changelog:: 21 :version: 1.0.19 22 :released: August 3, 2017 23 24 .. change:: 25 :tags: bug, oracle, performance, py2k 26 :tickets: 4035 27 :versions: 1.0.19, 1.1.13, 1.2.0b3 28 29 Fixed performance regression caused by the fix for :ticket:`3937` where 30 cx_Oracle as of version 5.3 dropped the ``.UNICODE`` symbol from its 31 namespace, which was interpreted as cx_Oracle's "WITH_UNICODE" mode being 32 turned on unconditionally, which invokes functions on the SQLAlchemy 33 side which convert all strings to unicode unconditionally and causing 34 a performance impact. In fact, per cx_Oracle's author the 35 "WITH_UNICODE" mode has been removed entirely as of 5.1, so the expensive unicode 36 conversion functions are no longer necessary and are disabled if 37 cx_Oracle 5.1 or greater is detected under Python 2. The warning against 38 "WITH_UNICODE" mode that was removed under :ticket:`3937` is also restored. 39 40.. changelog:: 41 :version: 1.0.18 42 :released: July 24, 2017 43 44 .. change:: 45 :tags: bug, tests, py3k 46 :tickets: 4034 47 :versions: 1.0.18, 1.1.12, 1.2.0b2 48 49 Fixed issue in testing fixtures which was incompatible with a change 50 made as of Python 3.6.2 involving context managers. 51 52 .. change:: 3937 53 :tags: bug, oracle 54 :tickets: 3937 55 :versions: 1.1.7 56 57 A fix to cx_Oracle's WITH_UNICODE mode which was uncovered by the 58 fact that cx_Oracle 5.3 now seems to hardcode this flag on in 59 the build; an internal method that uses this mode wasn't using 60 the correct signature. 61 62 63.. changelog:: 64 :version: 1.0.17 65 :released: January 17, 2017 66 67 .. change:: 68 :tags: bug, py3k 69 :tickets: 3886 70 :versions: 1.1.5 71 72 Fixed Python 3.6 DeprecationWarnings related to escaped strings without 73 the 'r' modifier, and added test coverage for Python 3.6. 74 75 .. change:: 76 :tags: bug, orm 77 :tickets: 3884 78 :versions: 1.1.5 79 80 Fixed bug involving joined eager loading against multiple entities 81 when polymorphic inheritance is also in use which would throw 82 "'NoneType' object has no attribute 'isa'". The issue was introduced 83 by the fix for :ticket:`3611`. 84 85.. changelog:: 86 :version: 1.0.16 87 :released: November 15, 2016 88 89 .. change:: 90 :tags: bug, orm 91 :tickets: 3849 92 :versions: 1.1.4 93 94 Fixed bug in :meth:`.Session.bulk_update_mappings` where an alternate-named 95 primary key attribute would not track properly into the UPDATE statement. 96 97 .. change:: 98 :tags: bug, mssql 99 :tickets: 3810 100 :versions: 1.1.0 101 102 Changed the query used to get "default schema name", from one that 103 queries the database principals table to using the 104 "schema_name()" function, as issues have been reported that the 105 former system was unavailable on the Azure Data Warehouse edition. 106 It is hoped that this will finally work across all SQL Server 107 versions and authentication styles. 108 109 .. change:: 110 :tags: bug, mssql 111 :tickets: 3814 112 :versions: 1.1.0 113 114 Updated the server version info scheme for pyodbc to use SQL Server 115 SERVERPROPERTY(), rather than relying upon pyodbc.SQL_DBMS_VER, which 116 continues to be unreliable particularly with FreeTDS. 117 118 .. change:: 119 :tags: bug, orm 120 :tickets: 3800 121 :versions: 1.1.0 122 123 Fixed bug where joined eager loading would fail for a polymorphically- 124 loaded mapper, where the polymorphic_on was set to an un-mapped 125 expression such as a CASE expression. 126 127 .. change:: 128 :tags: bug, orm 129 :tickets: 3798 130 :versions: 1.1.0 131 132 Fixed bug where the ArgumentError raised for an invalid bind 133 sent to a Session via :meth:`.Session.bind_mapper`, 134 :meth:`.Session.bind_table`, 135 or the constructor would fail to be correctly raised. 136 137 .. change:: 138 :tags: bug, mssql 139 :tickets: 3791 140 :versions: 1.1.0 141 142 Added error code 20017 "unexpected EOF from the server" to the list of 143 disconnect exceptions that result in a connection pool reset. Pull 144 request courtesy Ken Robbins. 145 146 .. change:: 147 :tags: bug, orm.declarative 148 :tickets: 3797 149 :versions: 1.1.0 150 151 Fixed bug where setting up a single-table inh subclass of a joined-table 152 subclass which included an extra column would corrupt the foreign keys 153 collection of the mapped table, thereby interfering with the 154 initialization of relationships. 155 156 .. change:: 157 :tags: bug, orm 158 :tickets: 3781 159 :versions: 1.1.4 160 161 Fixed bug in :meth:`.Session.bulk_save` where an UPDATE would 162 not function correctly in conjunction with a mapping that 163 implements a version id counter. 164 165 .. 3778 166 167 .. change:: 168 :tags: bug, orm 169 :tickets: 3778 170 :versions: 1.1.4 171 172 Fixed bug where the :attr:`_orm.Mapper.attrs`, 173 :attr:`_orm.Mapper.all_orm_descriptors` and other derived attributes would 174 fail to refresh when mapper properties or other ORM constructs were 175 added to the mapper/class after these accessors were first called. 176 177 .. change:: 3762 178 :tags: bug, mssql 179 :tickets: 3762 180 :versions: 1.1.4 181 182 Fixed bug in pyodbc dialect (as well as in the mostly non-working 183 adodbapi dialect) whereby a semicolon present in the password 184 or username fields could be interpreted as a separator for another 185 token; the values are now quoted when semicolons are present. 186 187.. changelog:: 188 :version: 1.0.15 189 :released: September 1, 2016 190 191 .. change:: 192 :tags: bug, mysql 193 :tickets: 3787 194 :versions: 1.1.0 195 196 Added support for parsing MySQL/Connector boolean and integer 197 arguments within the URL query string: connection_timeout, 198 connect_timeout, pool_size, get_warnings, 199 raise_on_warnings, raw, consume_results, ssl_verify_cert, force_ipv6, 200 pool_reset_session, compress, allow_local_infile, use_pure. 201 202 .. change:: 203 :tags: bug, orm 204 :tickets: 3773, 3774 205 :versions: 1.1.0 206 207 Fixed bug in subquery eager loading where a subqueryload 208 of an "of_type()" object linked to a second subqueryload of a plain 209 mapped class, or a longer chain of several "of_type()" attributes, 210 would fail to link the joins correctly. 211 212 .. change:: 213 :tags: bug, sql 214 :tickets: 3755 215 :versions: 1.1.0 216 217 Fixed bug in :class:`_schema.Table` where the internal method 218 ``_reset_exported()`` would corrupt the state of the object. This 219 method is intended for selectable objects and is called by the ORM 220 in some cases; an erroneous mapper configuration would could lead the 221 ORM to call this on a :class:`_schema.Table` object. 222 223 .. change:: 224 :tags: bug, ext 225 :tickets: 3743 226 :versions: 1.1.0b3 227 228 Fixed bug in ``sqlalchemy.ext.baked`` where the unbaking of a 229 subquery eager loader query would fail due to a variable scoping 230 issue, when multiple subquery loaders were involved. Pull request 231 courtesy Mark Hahnenberg. 232 233.. changelog:: 234 :version: 1.0.14 235 :released: July 6, 2016 236 237 .. change:: 238 :tags: bug, postgresql 239 :tickets: 3739 240 :versions: 1.1.0b3 241 242 Fixed bug whereby :class:`.TypeDecorator` and :class:`.Variant` 243 types were not deeply inspected enough by the PostgreSQL dialect 244 to determine if SMALLSERIAL or BIGSERIAL needed to be rendered 245 rather than SERIAL. 246 247 .. change:: 248 :tags: bug, oracle 249 :tickets: 3741 250 :versions: 1.1.0b3 251 252 Fixed bug in :paramref:`.Select.with_for_update.of`, where the Oracle 253 "rownum" approach to LIMIT/OFFSET would fail to accommodate for the 254 expressions inside the "OF" clause, which must be stated at the topmost 255 level referring to expression within the subquery. The expressions are 256 now added to the subquery if needed. 257 258 .. change:: 259 :tags: bug, sql 260 :tickets: 3735 261 :versions: 1.1.0b2 262 263 Fixed issue in SQL math negation operator where the type of the 264 expression would no longer be the numeric type of the original. 265 This would cause issues where the type determined result set 266 behaviors. 267 268 .. change:: 269 :tags: bug, sql 270 :tickets: 3728 271 :versions: 1.1.0b2 272 273 Fixed bug whereby the ``__getstate__`` / ``__setstate__`` 274 methods for sqlalchemy.util.Properties were 275 non-working due to the transition in the 1.0 series to ``__slots__``. 276 The issue potentially impacted some third-party applications. 277 Pull request courtesy Pieter Mulder. 278 279 .. change:: 280 :tags: bug, sql 281 :tickets: 3724 282 283 :meth:`_expression.FromClause.count` is pending deprecation for 1.1. This function 284 makes use of an arbitrary column in the table and is not reliable; 285 for Core use, ``func.count()`` should be preferred. 286 287 .. change:: 288 :tags: bug, sql 289 :tickets: 3722 290 291 Fixed bug in :class:`_expression.CTE` structure which would cause it to not 292 clone properly when a union was used, as is common in a recursive 293 CTE. The improper cloning would cause errors when the CTE is used 294 in various ORM contexts such as that of a :func:`.column_property`. 295 296 .. change:: 297 :tags: bug, sql 298 :tickets: 3721 299 300 Fixed bug whereby :meth:`_schema.Table.tometadata` would make a duplicate 301 :class:`.UniqueConstraint` for each :class:`_schema.Column` object that 302 featured the ``unique=True`` parameter. 303 304 .. change:: 305 :tags: bug, engine, postgresql 306 :tickets: 3716 307 308 Fixed bug in cross-schema foreign key reflection in conjunction 309 with the :paramref:`_schema.MetaData.schema` argument, where a referenced 310 table that is present in the "default" schema would fail since there 311 would be no way to indicate a :class:`_schema.Table` that has "blank" for 312 a schema. The special symbol :attr:`_schema.BLANK_SCHEMA` has been 313 added as an available value for :paramref:`_schema.Table.schema` and 314 :paramref:`.Sequence.schema`, indicating that the schema name 315 should be forced to be ``None`` even if :paramref:`_schema.MetaData.schema` 316 is specified. 317 318 .. change:: 319 :tags: bug, examples 320 :tickets: 3704 321 322 Fixed a regression that occurred in the 323 examples/vertical/dictlike-polymorphic.py example which prevented it 324 from running. 325 326.. changelog:: 327 :version: 1.0.13 328 :released: May 16, 2016 329 330 .. change:: 331 :tags: bug, orm 332 :tickets: 3700 333 334 Fixed bug in "evaluate" strategy of :meth:`_query.Query.update` and 335 :meth:`_query.Query.delete` which would fail to accommodate a bound 336 parameter with a "callable" value, as which occurs when filtering 337 by a many-to-one equality expression along a relationship. 338 339 .. change:: 340 :tags: bug, postgresql 341 :tickets: 3715 342 343 Added disconnect detection support for the error string 344 "SSL error: decryption failed or bad record mac". Pull 345 request courtesy Iuri de Silvio. 346 347 .. change:: 348 :tags: bug, mssql 349 :tickets: 3711 350 351 Fixed bug where by ROW_NUMBER OVER clause applied for OFFSET 352 selects in SQL Server would inappropriately substitute a plain column 353 from the local statement that overlaps with a label name used by 354 the ORDER BY criteria of the statement. 355 356 .. change:: 357 :tags: bug, orm 358 :tickets: 3710 359 360 Fixed bug whereby the event listeners used for backrefs could 361 be inadvertently applied multiple times, when using a deep class 362 inheritance hierarchy in conjunction with multiple mapper configuration 363 steps. 364 365 .. change:: 366 :tags: bug, orm 367 :tickets: 3706 368 369 Fixed bug whereby passing a :func:`_expression.text` construct to the 370 :meth:`_query.Query.group_by` method would raise an error, instead 371 of interpreting the object as a SQL fragment. 372 373 .. change:: 374 :tags: bug, oracle 375 :tickets: 3705 376 377 Fixed a bug in the cx_Oracle connect process that caused a TypeError 378 when the either the user, password or dsn was empty. This prevented 379 external authentication to Oracle databases, and prevented connecting 380 to the default dsn. The connect string oracle:// now logs into the 381 default dsn using the Operating System username, equivalent to 382 connecting using '/' with sqlplus. 383 384 .. change:: 385 :tags: bug, oracle 386 :tickets: 3699 387 388 Fixed a bug in the result proxy used mainly by Oracle when binary and 389 other LOB types are in play, such that when query / statement caching 390 were used, the type-level result processors, notably that required by 391 the binary type itself but also any other processor, would become lost 392 after the first run of the statement due to it being removed from the 393 cached result metadata. 394 395 .. change:: 396 :tags: bug, examples 397 :tickets: 3698 398 399 Changed the "directed graph" example to no longer consider 400 integer identifiers of nodes as significant; the "higher" / "lower" 401 references now allow mutual edges in both directions. 402 403 .. change:: 404 :tags: bug, sql 405 :tickets: 3690 406 407 Fixed bug where when using ``case_sensitive=False`` with an 408 :class:`_engine.Engine`, the result set would fail to correctly accommodate 409 for duplicate column names in the result set, causing an error 410 when the statement is executed in 1.0, and preventing the 411 "ambiguous column" exception from functioning in 1.1. 412 413 .. change:: 414 :tags: bug, sql 415 :tickets: 3682 416 417 Fixed bug where the negation of an EXISTS expression would not 418 be properly typed as boolean in the result, and also would fail to be 419 anonymously aliased in a SELECT list as is the case with a 420 non-negated EXISTS construct. 421 422 .. change:: 423 :tags: bug, sql 424 :tickets: 3666 425 426 Fixed bug where "unconsumed column names" exception would fail to 427 be raised in the case where :meth:`_expression.Insert.values` were called 428 with a list of parameter mappings, instead of a single mapping 429 of parameters. Pull request courtesy Athena Yao. 430 431 .. change:: 432 :tags: bug, orm 433 :tickets: 3663 434 435 Anonymous labeling is applied to a :attr:`.func` construct that is 436 passed to :func:`.column_property`, so that if the same attribute 437 is referred to as a column expression twice the names are de-duped, 438 thus avoiding "ambiguous column" errors. Previously, the 439 ``.label(None)`` would need to be applied in order for the name 440 to be de-anonymized. 441 442 .. change:: 443 :tags: bug, py3k 444 :tickets: 3660 445 446 Fixed bug in "to_list" conversion where a single bytes object 447 would be turned into a list of individual characters. This would 448 impact among other things using the :meth:`_query.Query.get` method 449 on a primary key that's a bytes object. 450 451 .. change:: 452 :tags: bug, orm 453 :tickets: 3658 454 455 Fixed regression appearing in the 1.0 series in ORM loading where the 456 exception raised for an expected column missing would incorrectly 457 be a ``NoneType`` error, rather than the expected 458 :class:`.NoSuchColumnError`. 459 460 .. change:: 461 :tags: bug, mssql, oracle 462 :tickets: 3657 463 464 Fixed regression appearing in the 1.0 series which would cause the Oracle 465 and SQL Server dialects to incorrectly account for result set columns 466 when these dialects would wrap a SELECT in a subquery in order to 467 provide LIMIT/OFFSET behavior, and the original SELECT statement 468 referred to the same column multiple times, such as a column and 469 a label of that same column. This issue is related 470 to :ticket:`3658` in that when the error occurred, it would also 471 cause a ``NoneType`` error, rather than reporting that it couldn't 472 locate a column. 473 474.. changelog:: 475 :version: 1.0.12 476 :released: February 15, 2016 477 478 .. change:: 479 :tags: bug, orm 480 :tickets: 3647 481 482 Fixed bug in :meth:`.Session.merge` where an object with a composite 483 primary key that has values for some but not all of the PK fields 484 would emit a SELECT statement leaking the internal NEVER_SET symbol 485 into the query, rather than detecting that this object does not have 486 a searchable primary key and no SELECT should be emitted. 487 488 .. change:: 489 :tags: bug, postgresql 490 :tickets: 3644 491 492 Fixed bug in :func:`_expression.text` construct where a double-colon 493 expression would not escape properly, e.g. ``some\:\:expr``, as is most 494 commonly required when rendering PostgreSQL-style CAST expressions. 495 496 .. change:: 497 :tags: bug, sql 498 :tickets: 3643 499 500 Fixed issue where the "literal_binds" flag was not propagated 501 for :func:`_expression.insert`, :func:`_expression.update` or 502 :func:`_expression.delete` constructs when compiled to string 503 SQL. Pull request courtesy Tim Tate. 504 505 .. change:: 506 :tags: bug, oracle, jython 507 :tickets: 3621 508 509 Fixed a small issue in the Jython Oracle compiler involving the 510 rendering of "RETURNING" which allows this currently 511 unsupported/untested dialect to work rudimentarily with the 1.0 series. 512 Pull request courtesy Carlos Rivas. 513 514 .. change:: 515 :tags: bug, sql 516 :tickets: 3642 517 518 Fixed issue where inadvertent use of the Python ``__contains__`` 519 override with a column expression (e.g. by using ``'x' in col``) 520 would cause an endless loop in the case of an ARRAY type, as Python 521 defers this to ``__getitem__`` access which never raises for this 522 type. Overall, all use of ``__contains__`` now raises 523 NotImplementedError. 524 525 .. change:: 526 :tags: bug, engine, mysql 527 :tickets: 2696 528 529 Revisiting :ticket:`2696`, first released in 1.0.10, which attempts to 530 work around Python 2's lack of exception context reporting by emitting 531 a warning for an exception that was interrupted by a second exception 532 when attempting to roll back the already-failed transaction; this 533 issue continues to occur for MySQL backends in conjunction with a 534 savepoint that gets unexpectedly lost, which then causes a 535 "no such savepoint" error when the rollback is attempted, obscuring 536 what the original condition was. 537 538 The approach has been generalized to the Core "safe 539 reraise" function which takes place across the ORM and Core in any 540 place that a transaction is being rolled back in response to an error 541 which occurred trying to commit, including the context managers 542 provided by :class:`.Session` and :class:`_engine.Connection`, and taking 543 place for operations such as a failure on "RELEASE SAVEPOINT". 544 Previously, the fix was only in place for a specific path within 545 the ORM flush/commit process; it now takes place for all transactional 546 context managers as well. 547 548 .. change:: 549 :tags: bug, sql 550 :tickets: 3632 551 552 Fixed bug in :class:`_schema.Table` metadata construct which appeared 553 around the 0.9 series where adding columns to a :class:`_schema.Table` 554 that was unpickled would fail to correctly establish the 555 :class:`_schema.Column` within the 'c' collection, leading to issues in 556 areas such as ORM configuration. This could impact use cases such 557 as ``extend_existing`` and others. 558 559 .. change:: 560 :tags: bug, py3k 561 :tickets: 3625 562 563 Fixed bug where some exception re-raise scenarios would attach 564 the exception to itself as the "cause"; while the Python 3 interpreter 565 is OK with this, it could cause endless loops in iPython. 566 567 .. change:: 568 :tags: bug, mssql 569 :tickets: 3624 570 571 Fixed the syntax of the :func:`.extract` function when used on 572 MSSQL against a datetime value; the quotes around the keyword 573 are removed. Pull request courtesy Guillaume Doumenc. 574 575 .. change:: 576 :tags: bug, orm 577 :tickets: 3623 578 579 Fixed regression since 0.9 where the 0.9 style loader options 580 system failed to accommodate for multiple :func:`.undefer_group` 581 loader options in a single query. Multiple :func:`.undefer_group` 582 options will now be taken into account even against the same 583 entity. 584 585 .. change:: 586 :tags: bug, mssql, firebird 587 :tickets: 3622 588 589 Fixed 1.0 regression where the eager fetch of cursor.rowcount was 590 no longer called for an UPDATE or DELETE statement emitted via plain 591 text or via the :func:`_expression.text` construct, affecting those drivers 592 that erase cursor.rowcount once the cursor is closed such as SQL 593 Server ODBC and Firebird drivers. 594 595 596.. changelog:: 597 :version: 1.0.11 598 :released: December 22, 2015 599 600 .. change:: 601 :tags: bug, mysql 602 :tickets: 3613 603 604 An adjustment to the regular expression used to parse MySQL views, 605 such that we no longer assume the "ALGORITHM" keyword is present in 606 the reflected view source, as some users have reported this not being 607 present in some Amazon RDS environments. 608 609 .. change:: 610 :tags: bug, mysql 611 612 Added new reserved words for MySQL 5.7 to the MySQL dialect, 613 including 'generated', 'optimizer_costs', 'stored', 'virtual'. 614 Pull request courtesy Hanno Schlichting. 615 616 .. change:: 617 :tags: bug, ext 618 :tickets: 3605 619 620 Further fixes to :ticket:`3605`, pop method on :class:`.MutableDict`, 621 where the "default" argument was not included. 622 623 .. change:: 624 :tags: bug, ext 625 :tickets: 3612 626 627 Fixed bug in baked loader system where the systemwide monkeypatch 628 for setting up baked lazy loaders would interfere with other 629 loader strategies that rely on lazy loading as a fallback, e.g. 630 joined and subquery eager loaders, leading to ``IndexError`` 631 exceptions at mapper configuration time. 632 633 .. change:: 634 :tags: bug, orm 635 :tickets: 3611 636 637 Fixed regression caused in 1.0.10 by the fix for :ticket:`3593` where 638 the check added for a polymorphic joinedload from a 639 poly_subclass->class->poly_baseclass connection would fail for the 640 scenario of class->poly_subclass->class. 641 642 .. change:: 643 :tags: bug, orm 644 :tickets: 3610 645 646 Fixed bug where :meth:`.Session.bulk_update_mappings` and related 647 would not bump a version id counter when in use. The experience 648 here is still a little rough as the original version id is required 649 in the given dictionaries and there's not clean error reporting 650 on that yet. 651 652 .. change:: 653 :tags: bug, sql 654 :tickets: 3609 655 656 Fixed bug in :meth:`_expression.Update.return_defaults` which would cause all 657 insert-default holding columns not otherwise included in the SET 658 clause (such as primary key cols) to get rendered into the RETURNING 659 even though this is an UPDATE. 660 661 .. change:: 662 :tags: bug, orm 663 :tickets: 3609 664 665 Major fixes to the :paramref:`_orm.Mapper.eager_defaults` flag, this 666 flag would not be honored correctly in the case that multiple 667 UPDATE statements were to be emitted, either as part of a flush 668 or a bulk update operation. Additionally, RETURNING 669 would be emitted unnecessarily within update statements. 670 671 .. change:: 672 :tags: bug, orm 673 :tickets: 3606 674 675 Fixed bug where use of the :meth:`_query.Query.select_from` method would 676 cause a subsequent call to the :meth:`_query.Query.with_parent` method to 677 fail. 678 679.. changelog:: 680 :version: 1.0.10 681 :released: December 11, 2015 682 683 .. change:: 684 :tags: bug, ext 685 :tickets: 3605 686 687 Added support for the ``dict.pop()`` and ``dict.popitem()`` methods 688 to the :class:`.mutable.MutableDict` class. 689 690 .. change:: 691 :tags: change, tests 692 693 The ORM and Core tutorials, which have always been in doctest format, 694 are now exercised within the normal unit test suite in both Python 695 2 and Python 3. 696 697 .. change:: 698 :tags: bug, sql 699 :tickets: 3603 700 701 Fixed issue within the :meth:`_expression.Insert.from_select` construct whereby 702 the :class:`_expression.Select` construct would have its ``._raw_columns`` 703 collection mutated in-place when compiling the :class:`_expression.Insert` 704 construct, when the target :class:`_schema.Table` has Python-side defaults. 705 The :class:`_expression.Select` construct would compile standalone with the 706 erroneous column present subsequent to compilation of the 707 :class:`_expression.Insert`, and the :class:`_expression.Insert` statement itself would 708 fail on a second compile attempt due to duplicate bound parameters. 709 710 .. change:: 711 :tags: bug, mysql 712 :tickets: 3602 713 714 Fixed bug in MySQL reflection where the "fractional sections portion" 715 of the :class:`.mysql.DATETIME`, :class:`.mysql.TIMESTAMP` and 716 :class:`.mysql.TIME` types would be incorrectly placed into the 717 ``timezone`` attribute, which is unused by MySQL, instead of the 718 ``fsp`` attribute. 719 720 .. change:: 721 :tags: bug, orm 722 :tickets: 3599 723 724 Fixed issue where post_update on a many-to-one relationship would 725 fail to emit an UPDATE in the case where the attribute were set to 726 None and not previously loaded. 727 728 .. change:: 729 :tags: bug, sql, postgresql 730 :tickets: 3598 731 732 Fixed bug where CREATE TABLE with a no-column table, but a constraint 733 such as a CHECK constraint would render an erroneous comma in the 734 definition; this scenario can occur such as with a PostgreSQL 735 INHERITS table that has no columns of its own. 736 737 .. change:: 738 :tags: bug, mssql 739 :tickets: 3585 740 741 742 Added the error "20006: Write to the server failed" to the list 743 of disconnect errors for the pymssql driver, as this has been observed 744 to render a connection unusable. 745 746 .. change:: 747 :tags: bug, postgresql 748 :tickets: 3573 749 750 751 Fixed issue where the "FOR UPDATE OF" PostgreSQL-specific SELECT 752 modifier would fail if the referred table had a schema qualifier; 753 PG needs the schema name to be omitted. Pull request courtesy 754 Diana Clarke. 755 756 .. change:: 757 :tags: bug, postgresql 758 759 760 Fixed bug where some varieties of SQL expression passed to the 761 "where" clause of :class:`_postgresql.ExcludeConstraint` would fail 762 to be accepted correctly. Pull request courtesy aisch. 763 764 .. change:: 765 :tags: bug, orm, declarative 766 767 768 Fixed bug where in Py2K a unicode literal would not be accepted as the 769 string name of a class or other argument within declarative using 770 :func:`.backref` on :func:`_orm.relationship`. Pull request courtesy 771 Nils Philippsen. 772 773 .. change:: 774 :tags: bug, mssql 775 776 A descriptive ValueError is now raised in the event that SQL server 777 returns an invalid date or time format from a DATE or TIME 778 column, rather than failing with a NoneType error. Pull request 779 courtesy Ed Avis. 780 781 .. change:: 782 :tags: bug, py3k 783 784 Updates to internal getargspec() calls, some py36-related 785 fixture updates, and alterations to two iterators to "return" instead 786 of raising StopIteration, to allow tests to pass without 787 errors or warnings on Py3.5, Py3.6, pull requests courtesy 788 Jacob MacDonald, Luri de Silvio, and Phil Jones. 789 790 .. change:: 791 :tags: bug, ext 792 :tickets: 3597 793 794 Fixed an issue in baked queries where the .get() method, used either 795 directly or within lazy loads, didn't consider the mapper's "get clause" 796 as part of the cache key, causing bound parameter mismatches if the 797 clause got re-generated. This clause is cached by mappers 798 on the fly but in highly concurrent scenarios may be generated more 799 than once when first accessed. 800 801 .. change:: 802 :tags: feature, sql 803 804 Added support for parameter-ordered SET clauses in an UPDATE 805 statement. This feature is available by passing the 806 :paramref:`~.sqlalchemy.sql.expression.update.preserve_parameter_order` 807 flag either to the core :class:`_expression.Update` construct or alternatively 808 adding it to the :paramref:`.Query.update.update_args` dictionary at 809 the ORM-level, also passing the parameters themselves as a list of 2-tuples. 810 Thanks to Gorka Eguileor for implementation and tests. 811 812 .. seealso:: 813 814 :ref:`updates_order_parameters` 815 816 .. change:: 817 :tags: bug, orm 818 :tickets: 3593 819 820 Fixed bug which is actually a regression that occurred between 821 versions 0.8.0 and 0.8.1, due :ticket:`2714`. The case where 822 joined eager loading needs to join out over a subclass-bound 823 relationship when "with_polymorphic" were also used would fail 824 to join from the correct entity. 825 826 .. change:: 827 :tags: bug, orm 828 :tickets: 3592 829 830 Fixed joinedload bug which would occur when a. the query includes 831 limit/offset criteria that forces a subquery b. the relationship 832 uses "secondary" c. the primaryjoin of the relationship refers to 833 a column that is either not part of the primary key, or is a PK 834 col in a joined-inheritance subclass table that is under a different 835 attribute name than the parent table's primary key column d. the 836 query defers the columns that are present in the primaryjoin, typically 837 via not being included in load_only(); the necessary column(s) would 838 not be present in the subquery and produce invalid SQL. 839 840 .. change:: 841 :tags: bug, orm 842 :tickets: 2696 843 844 A rare case which occurs when a :meth:`.Session.rollback` fails in the 845 scope of a :meth:`.Session.flush` operation that's raising an 846 exception, as has been observed in some MySQL SAVEPOINT cases, prevents 847 the original database exception from being observed when it was 848 emitted during flush, but only on Py2K because Py2K does not support 849 exception chaining; on Py3K the originating exception is chained. As 850 a workaround, a warning is emitted in this specific case showing at 851 least the string message of the original database error before we 852 proceed to raise the rollback-originating exception. 853 854 .. change:: 855 :tags: bug, postgresql 856 :tickets: 3571 857 858 Fixed the ``.python_type`` attribute of :class:`_postgresql.INTERVAL` 859 to return ``datetime.timedelta`` in the same way as that of 860 :obj:`.types.Interval.python_type`, rather than raising 861 ``NotImplementedError``. 862 863 .. change:: 864 :tags: bug, mssql 865 866 867 Fixed issue where DDL generated for the MSSQL types DATETIME2, 868 TIME and DATETIMEOFFSET with a precision of "zero" would not generate 869 the precision field. Pull request courtesy Jacobo de Vera. 870 871 872.. changelog:: 873 :version: 1.0.9 874 :released: October 20, 2015 875 876 .. change:: 877 :tags: bug, orm, postgresql 878 :tickets: 3556 879 880 Fixed regression in 1.0 where new feature of using "executemany" 881 for UPDATE statements in the ORM (e.g. :ref:`feature_updatemany`) 882 would break on PostgreSQL and other RETURNING backends 883 when using server-side version generation 884 schemes, as the server side value is retrieved via RETURNING which 885 is not supported with executemany. 886 887 .. change:: 888 :tags: feature, ext 889 :tickets: 3551 890 891 Added the :paramref:`.AssociationProxy.info` parameter to the 892 :class:`.AssociationProxy` constructor, to suit the 893 :attr:`.AssociationProxy.info` accessor that was added in 894 :ticket:`2971`. This is possible because :class:`.AssociationProxy` 895 is constructed explicitly, unlike a hybrid which is constructed 896 implicitly via the decorator syntax. 897 898 .. change:: 899 :tags: bug, oracle 900 :tickets: 3548 901 902 Fixed bug in Oracle dialect where reflection of tables and other 903 symbols with names quoted to force all-lower-case would not be 904 identified properly in reflection queries. The :class:`.quoted_name` 905 construct is now applied to incoming symbol names that detect as 906 forced into all-lower-case within the "name normalize" process. 907 908 .. change:: 909 :tags: feature, orm 910 911 Added new method :meth:`_query.Query.one_or_none`; same as 912 :meth:`_query.Query.one` but returns None if no row found. Pull request 913 courtesy esiegerman. 914 915 .. change:: 916 :tags: bug, orm 917 :tickets: 3539 918 919 Fixed rare TypeError which could occur when stringifying certain 920 kinds of internal column loader options within internal logging. 921 922 .. change:: 923 :tags: bug, orm 924 :tickets: 3525 925 926 Fixed bug in :meth:`.Session.bulk_save_objects` where a mapped 927 column that had some kind of "fetch on update" value and was not 928 locally present in the given object would cause an AttributeError 929 within the operation. 930 931 .. change:: 932 :tags: bug, sql 933 :tickets: 3520 934 935 Fixed regression in 1.0-released default-processor for multi-VALUES 936 insert statement, :ticket:`3288`, where the column type for the 937 default-holding column would not be propagated to the compiled 938 statement in the case where the default was being used, 939 leading to bind-level type handlers not being invoked. 940 941 .. change:: 942 :tags: bug, examples 943 944 945 Fixed two issues in the "history_meta" example where history tracking 946 could encounter empty history, and where a column keyed to an alternate 947 attribute name would fail to track properly. Fixes courtesy 948 Alex Fraser. 949 950 .. change:: 951 :tags: bug, orm 952 :tickets: 3510 953 954 955 Fixed 1.0 regression where the "noload" loader strategy would fail 956 to function for a many-to-one relationship. The loader used an 957 API to place "None" into the dictionary which no longer actually 958 writes a value; this is a side effect of :ticket:`3061`. 959 960 .. change:: 961 :tags: bug, sybase 962 :tickets: 3508, 3509 963 964 965 Fixed two issues regarding Sybase reflection, allowing tables 966 without primary keys to be reflected as well as ensured that 967 a SQL statement involved in foreign key detection is pre-fetched up 968 front to avoid driver issues upon nested queries. Fixes here 969 courtesy Eugene Zapolsky; note that we cannot currently test 970 Sybase to locally verify these changes. 971 972 .. change:: 973 :tags: bug, postgresql 974 975 976 An adjustment to the new PostgreSQL feature of reflecting storage 977 options and USING of :ticket:`3455` released in 1.0.6, 978 to disable the feature for PostgreSQL versions < 8.2 where the 979 ``reloptions`` column is not provided; this allows Amazon Redshift 980 to again work as it is based on an 8.0.x version of PostgreSQL. 981 Fix courtesy Pete Hollobon. 982 983 984.. changelog:: 985 :version: 1.0.8 986 :released: July 22, 2015 987 988 .. change:: 989 :tags: bug, misc 990 :tickets: 3494 991 992 Fixed an issue where a particular base class within utils 993 didn't implement ``__slots__``, and therefore meant all subclasses 994 of that class didn't either, negating the rationale for ``__slots__`` 995 to be in use. Didn't cause any issue except on IronPython 996 which apparently does not implement ``__slots__`` behavior compatibly 997 with cPython. 998 999 1000.. changelog:: 1001 :version: 1.0.7 1002 :released: July 20, 2015 1003 1004 .. change:: 1005 :tags: feature, sql 1006 :tickets: 3459 1007 1008 Added a :meth:`_expression.ColumnElement.cast` method which performs the same 1009 purpose as the standalone :func:`_expression.cast` function. Pull 1010 request courtesy Sebastian Bank. 1011 1012 .. change:: 1013 :tags: bug, engine 1014 :tickets: 3481 1015 1016 Fixed regression where new methods on :class:`_engine.ResultProxy` used 1017 by the ORM :class:`_query.Query` object (part of the performance 1018 enhancements of :ticket:`3175`) would not raise the "this result 1019 does not return rows" exception in the case where the driver 1020 (typically MySQL) fails to generate cursor.description correctly; 1021 an AttributeError against NoneType would be raised instead. 1022 1023 .. change:: 1024 :tags: bug, engine 1025 :tickets: 3483 1026 1027 Fixed regression where :meth:`_engine.ResultProxy.keys` would return 1028 un-adjusted internal symbol names for "anonymous" labels, which 1029 are the "foo_1" types of labels we see generated for SQL functions 1030 without labels and similar. This was a side effect of the 1031 performance enhancements implemented as part of #918. 1032 1033 1034 .. change:: 1035 :tags: bug, sql 1036 :tickets: 3490 1037 1038 Fixed bug where coercion of literal ``True`` or ``False`` constant 1039 in conjunction with :func:`.and_` or :func:`.or_` would fail 1040 with an AttributeError. 1041 1042 .. change:: 1043 :tags: bug, sql 1044 :tickets: 3485 1045 1046 Fixed potential issue where a custom subclass 1047 of :class:`.FunctionElement` or other column element that incorrectly 1048 states 'None' or any other invalid object as the ``.type`` 1049 attribute will report this exception instead of recursion overflow. 1050 1051 .. change:: 1052 :tags: bug, sql 1053 1054 Fixed bug where the modulus SQL operator wouldn't work in reverse 1055 due to a missing ``__rmod__`` method. Pull request courtesy 1056 dan-gittik. 1057 1058 .. change:: 1059 :tags: feature, schema 1060 1061 Added support for the MINVALUE, MAXVALUE, NO MINVALUE, NO MAXVALUE, 1062 and CYCLE arguments for CREATE SEQUENCE as supported by PostgreSQL 1063 and Oracle. Pull request courtesy jakeogh. 1064 1065 .. change:: 1066 :tags: bug, orm, declarative 1067 :tickets: 3480 1068 1069 Fixed bug in :class:`.AbstractConcreteBase` extension where 1070 a column setup on the ABC base which had a different attribute 1071 name vs. column name would not be correctly mapped on the final 1072 base class. The failure on 0.9 would be silent whereas on 1073 1.0 it raised an ArgumentError, so may not have been noticed 1074 prior to 1.0. 1075 1076 .. change:: 1077 :tags: bug, orm 1078 :tickets: 3469 1079 1080 Fixed 1.0 regression where value objects that override 1081 ``__eq__()`` to return a non-boolean-capable object, such as 1082 some geoalchemy types as well as numpy types, were being tested 1083 for ``bool()`` during a unit of work update operation, where in 1084 0.9 the return value of ``__eq__()`` was tested against "is True" 1085 to guard against this. 1086 1087 .. change:: 1088 :tags: bug, orm 1089 :tickets: 3468 1090 1091 Fixed 1.0 regression where a "deferred" attribute would not populate 1092 correctly if it were loaded within the "optimized inheritance load", 1093 which is a special SELECT emitted in the case of joined table 1094 inheritance used to populate expired or unloaded attributes against 1095 a joined table without loading the base table. This is related to 1096 the fact that SQLA 1.0 no longer guesses about loading deferred 1097 columns and must be directed explicitly. 1098 1099 .. change:: 1100 :tags: bug, orm 1101 :tickets: 3466 1102 1103 Fixed 1.0 regression where the "parent entity" of a synonym- 1104 mapped attribute on top of an :func:`.aliased` object would 1105 resolve to the original mapper, not the :func:`.aliased` 1106 version of it, thereby causing problems for a :class:`_query.Query` 1107 that relies on this attribute (e.g. it's the only representative 1108 attribute given in the constructor) to figure out the correct FROM 1109 clause for the query. 1110 1111.. changelog:: 1112 :version: 1.0.6 1113 :released: June 25, 2015 1114 1115 .. change:: 1116 :tags: bug, orm 1117 :tickets: 3465 1118 1119 Fixed a major regression in the 1.0 series where the version_id_counter 1120 feature would cause an object's version counter to be incremented 1121 when there was no net change to the object's row, but instead an object 1122 related to it via relationship (e.g. typically many-to-one) 1123 were associated or de-associated with it, resulting in an UPDATE 1124 statement that updates the object's version counter and nothing else. 1125 In the use case where the relatively recent "server side" and/or 1126 "programmatic/conditional" version counter feature were used 1127 (e.g. setting version_id_generator to False), the bug could cause an 1128 UPDATE without a valid SET clause to be emitted. 1129 1130 .. change:: 1131 :tags: bug, mssql 1132 :tickets: 3464 1133 1134 Fixed issue when using :class:`_types.VARBINARY` type in conjunction with 1135 an INSERT of NULL + pyodbc; pyodbc requires a special 1136 object be passed in order to persist NULL. As the :class:`_types.VARBINARY` 1137 type is now usually the default for :class:`.LargeBinary` due to 1138 :ticket:`3039`, this issue is partially a regression in 1.0. 1139 The pymssql driver appears to be unaffected. 1140 1141 .. change:: 1142 :tags: bug, postgresql, pypy 1143 :tickets: 3439 1144 1145 Re-fixed this issue first released in 1.0.5 to fix psycopg2cffi 1146 JSONB support once again, as they suddenly 1147 switched on unconditional decoding of JSONB types in version 2.7.1. 1148 Version detection now specifies 2.7.1 as where we should expect 1149 the DBAPI to do json encoding for us. 1150 1151 .. change:: 1152 :tags: feature, postgresql 1153 :tickets: 3455 1154 1155 Added support for storage parameters under CREATE INDEX, using 1156 a new keyword argument ``postgresql_with``. Also added support for 1157 reflection to support both the ``postgresql_with`` flag as well 1158 as the ``postgresql_using`` flag, which will now be set on 1159 :class:`.Index` objects that are reflected, as well present 1160 in a new "dialect_options" dictionary in the result of 1161 :meth:`_reflection.Inspector.get_indexes`. Pull request courtesy Pete Hollobon. 1162 1163 .. seealso:: 1164 1165 :ref:`postgresql_index_storage` 1166 1167 .. change:: 1168 :tags: bug, orm 1169 :tickets: 3462 1170 1171 Fixed 1.0 regression where the enhanced behavior of single-inheritance 1172 joins of :ticket:`3222` takes place inappropriately 1173 for a JOIN along explicit join criteria with a single-inheritance 1174 subclass that does not make use of any discriminator, resulting 1175 in an additional "AND NULL" clause. 1176 1177 .. change:: 1178 :tags: bug, postgresql 1179 :tickets: 3454 1180 1181 Repaired the :class:`.ExcludeConstraint` construct to support common 1182 features that other objects like :class:`.Index` now do, that 1183 the column expression may be specified as an arbitrary SQL 1184 expression such as :obj:`_expression.cast` or :obj:`_expression.text`. 1185 1186 .. change:: 1187 :tags: feature, postgresql 1188 1189 Added new execution option ``max_row_buffer`` which is interpreted 1190 by the psycopg2 dialect when the ``stream_results`` option is 1191 used, which sets a limit on the size of the row buffer that may be 1192 allocated. This value is also provided based on the integer 1193 value sent to :meth:`_query.Query.yield_per`. Pull request courtesy 1194 mcclurem. 1195 1196 .. change:: 1197 :tags: bug, orm 1198 :tickets: 3451 1199 1200 Fixed bug in new :meth:`.Session.bulk_update_mappings` feature where 1201 the primary key columns used in the WHERE clause to locate the row 1202 would also be included in the SET clause, setting their value to 1203 themselves unnecessarily. Pull request courtesy Patrick Hayes. 1204 1205 .. change:: 1206 :tags: bug, orm 1207 :tickets: 3448 1208 1209 Fixed an unexpected-use regression whereby custom 1210 :class:`.types.TypeEngine.Comparator` objects that made use of the 1211 ``__clause_element__()`` method and returned an object that was an 1212 ORM-mapped :class:`.InstrumentedAttribute` and not explicitly a 1213 :class:`_expression.ColumnElement` would fail to be correctly handled when passed 1214 as an expression to :meth:`.Session.query`. The logic in 0.9 happened 1215 to succeed on this, so this use case is now supported. 1216 1217 .. change:: 1218 :tags: bug, sql 1219 :tickets: 3445 1220 1221 Fixed a bug where clause adaption as applied to a :class:`.Label` 1222 object would fail to accommodate the labeled SQL expression 1223 in all cases, such that any SQL operation that made use of 1224 :meth:`.Label.self_group` would use the original unadapted 1225 expression. One effect of this would be that an ORM :func:`.aliased` 1226 construct would not fully accommodate attributes mapped by 1227 :obj:`.column_property`, such that the un-aliased table could 1228 leak out when the property were used in some kinds of SQL 1229 comparisons. 1230 1231 .. change:: 1232 :tags: bug, documentation 1233 :tickets: 2077 1234 1235 Fixed an internal "memoization" routine for method types such 1236 that a Python descriptor is no longer used; repairs inspectability 1237 of these methods including support for Sphinx documentation. 1238 1239.. changelog:: 1240 :version: 1.0.5 1241 :released: June 7, 2015 1242 1243 .. change:: 1244 :tags: feature, engine 1245 1246 Added new engine event :meth:`_events.ConnectionEvents.engine_disposed`. 1247 Called after the :meth:`_engine.Engine.dispose` method is called. 1248 1249 .. change:: 1250 :tags: bug, postgresql, pypy 1251 :tickets: 3439 1252 1253 Repaired some typing and test issues related to the pypy 1254 psycopg2cffi dialect, in particular that the current 2.7.0 version 1255 does not have native support for the JSONB type. The version detection 1256 for psycopg2 features has been tuned into a specific sub-version 1257 for psycopg2cffi. Additionally, test coverage has been enabled 1258 for the full series of psycopg2 features under psycopg2cffi. 1259 1260 .. change:: 1261 :tags: feature, ext 1262 1263 Added support for ``*args`` to be passed to the baked query 1264 initial callable, in the same way that ``*args`` are supported 1265 for the :meth:`.BakedQuery.add_criteria` and 1266 :meth:`.BakedQuery.with_criteria` methods. Initial PR courtesy 1267 Naoki INADA. 1268 1269 .. change:: 1270 :tags: bug, engine 1271 :tickets: 3435 1272 1273 Fixed bug where known boolean values used by 1274 :func:`.engine_from_config` were not being parsed correctly; 1275 these included ``pool_threadlocal`` and the psycopg2 argument 1276 ``use_native_unicode``. 1277 1278 .. change:: 1279 :tags: bug, mssql 1280 :tickets: 3424, 3430 1281 1282 Added a new dialect flag to the MSSQL dialect 1283 ``legacy_schema_aliasing`` which when set to False will disable a 1284 very old and obsolete behavior, that of the compiler's 1285 attempt to turn all schema-qualified table names into alias names, 1286 to work around old and no longer locatable issues where SQL 1287 server could not parse a multi-part identifier name in all 1288 circumstances. The behavior prevented more 1289 sophisticated statements from working correctly, including those which 1290 use hints, as well as CRUD statements that embed correlated SELECT 1291 statements. Rather than continue to repair the feature to work 1292 with more complex statements, it's better to just disable it 1293 as it should no longer be needed for any modern SQL server 1294 version. The flag defaults to True for the 1.0.x series, leaving 1295 current behavior unchanged for this version series. In the 1.1 1296 series, it will default to False. For the 1.0 series, 1297 when not set to either value explicitly, a warning is emitted 1298 when a schema-qualified table is first used in a statement, which 1299 suggests that the flag be set to False for all modern SQL Server 1300 versions. 1301 1302 .. seealso:: 1303 1304 :ref:`legacy_schema_rendering` 1305 1306 .. change:: 1307 :tags: feature, engine 1308 :tickets: 3379 1309 1310 Adjustments to the engine plugin hook, such that the 1311 :meth:`.URL.get_dialect` method will continue to return the 1312 ultimate :class:`.Dialect` object when a dialect plugin is used, 1313 without the need for the caller to be aware of the 1314 :meth:`.Dialect.get_dialect_cls` method. 1315 1316 1317 .. change:: 1318 :tags: bug, ext 1319 :tickets: 3427 1320 1321 Fixed regression in the :mod:`sqlalchemy.ext.mutable` extension 1322 as a result of the bugfix for :ticket:`3167`, 1323 where attribute and validation events are no longer 1324 called within the flush process. The mutable 1325 extension was relying upon this behavior in the case where a column 1326 level Python-side default were responsible for generating the new value 1327 on INSERT or UPDATE, or when a value were fetched from the RETURNING 1328 clause for "eager defaults" mode. The new value would not be subject 1329 to any event when populated and the mutable extension could not 1330 establish proper coercion or history listening. A new event 1331 :meth:`.InstanceEvents.refresh_flush` is added which the mutable 1332 extension now makes use of for this use case. 1333 1334 .. change:: 1335 :tags: feature, orm 1336 :tickets: 3427 1337 1338 Added new event :meth:`.InstanceEvents.refresh_flush`, invoked 1339 when an INSERT or UPDATE level default value fetched via RETURNING 1340 or Python-side default is invoked within the flush process. This 1341 is to provide a hook that is no longer present as a result of 1342 :ticket:`3167`, where attribute and validation events are no longer 1343 called within the flush process. 1344 1345 .. change:: 1346 :tags: feature, ext 1347 :tickets: 3427 1348 1349 Added a new semi-public method to :class:`.MutableBase` 1350 :meth:`.MutableBase._get_listen_keys`. Overriding this method 1351 is needed in the case where a :class:`.MutableBase` subclass needs 1352 events to propagate for attribute keys other than the key to which 1353 the mutable type is associated with, when intercepting the 1354 :meth:`.InstanceEvents.refresh` or 1355 :meth:`.InstanceEvents.refresh_flush` events. The current example of 1356 this is composites using :class:`.MutableComposite`. 1357 1358 .. change:: 1359 :tags: bug, engine 1360 :tickets: 3421 1361 1362 Added support for the case of the misbehaving DBAPI that has 1363 pep-249 exception names linked to exception classes of an entirely 1364 different name, preventing SQLAlchemy's own exception wrapping from 1365 wrapping the error appropriately. 1366 The SQLAlchemy dialect in use needs to implement a new 1367 accessor :attr:`.DefaultDialect.dbapi_exception_translation_map` 1368 to support this feature; this is implemented now for the py-postgresql 1369 dialect. 1370 1371 .. change:: 1372 :tags: bug, orm 1373 :tickets: 3420 1374 1375 The "lightweight named tuple" used when a :class:`_query.Query` returns 1376 rows failed to implement ``__slots__`` correctly such that it still 1377 had a ``__dict__``. This is resolved, but in the extremely 1378 unlikely case someone was assigning values to the returned tuples, 1379 that will no longer work. 1380 1381 .. change:: 1382 :tags: bug, engine 1383 :tickets: 3419 1384 1385 Fixed bug involving the case when pool checkout event handlers are used 1386 and connection attempts are made in the handler itself which fail, 1387 the owning connection record would not be freed until the stack trace 1388 of the connect error itself were freed. For the case where a test 1389 pool of only a single connection were used, this means the pool would 1390 be fully checked out until that stack trace were freed. This mostly 1391 impacts very specific debugging scenarios and is unlikely to have been 1392 noticeable in any production application. The fix applies an 1393 explicit checkin of the record before re-raising the caught exception. 1394 1395 1396.. changelog:: 1397 :version: 1.0.4 1398 :released: May 7, 2015 1399 1400 .. change:: 1401 :tags: bug, orm 1402 :tickets: 3416 1403 1404 Fixed unexpected-use regression where in the odd case that the 1405 primaryjoin of a relationship involved comparison to an unhashable 1406 type such as an HSTORE, lazy loads would fail due to a hash-oriented 1407 check on the statement parameters, modified in 1.0 as a result of 1408 :ticket:`3061` to use hashing and modified in :ticket:`3368` 1409 to occur in cases more common than "load on pending". 1410 The values are now checked for the ``__hash__`` attribute beforehand. 1411 1412 .. change:: 1413 :tags: bug, orm 1414 :tickets: 3412, 3347 1415 1416 Liberalized an assertion that was added as part of :ticket:`3347` 1417 to protect against unknown conditions when splicing inner joins 1418 together within joined eager loads with ``innerjoin=True``; if 1419 some of the joins use a "secondary" table, the assertion needs to 1420 unwrap further joins in order to pass. 1421 1422 .. change:: 1423 :tags: bug, schema 1424 :tickets: 3411 1425 1426 Fixed bug in enhanced constraint-attachment logic introduced in 1427 :ticket:`3341` where in the unusual case of a constraint that refers 1428 to a mixture of :class:`_schema.Column` objects and string column names 1429 at the same time, the auto-attach-on-column-attach logic will be 1430 skipped; for the constraint to be auto-attached in this case, 1431 all columns must be assembled on the target table up front. 1432 Added a new section to the migration document regarding the 1433 original feature as well as this change. 1434 1435 .. seealso:: 1436 1437 :ref:`change_3341` 1438 1439 .. change:: 1440 :tags: bug, orm 1441 :tickets: 3409, 3320 1442 1443 Repaired / added to tests yet more expressions that were reported 1444 as failing with the new 'entity' key value added to 1445 :attr:`_query.Query.column_descriptions`, the logic to discover the "from" 1446 clause is again reworked to accommodate columns from aliased classes, 1447 as well as to report the correct value for the "aliased" flag in these 1448 cases. 1449 1450 1451.. changelog:: 1452 :version: 1.0.3 1453 :released: April 30, 2015 1454 1455 .. change:: 1456 :tags: bug, orm, pypy 1457 :tickets: 3405 1458 1459 Fixed regression from 0.9.10 prior to release due to :ticket:`3349` 1460 where the check for query state on :meth:`_query.Query.update` or 1461 :meth:`_query.Query.delete` compared the empty tuple to itself using ``is``, 1462 which fails on PyPy to produce ``True`` in this case; this would 1463 erroneously emit a warning in 0.9 and raise an exception in 1.0. 1464 1465 .. change:: 1466 :tags: feature, engine 1467 :tickets: 3379 1468 1469 New features added to support engine/pool plugins with advanced 1470 functionality. Added a new "soft invalidate" feature to the 1471 connection pool at the level of the checked out connection wrapper 1472 as well as the :class:`._ConnectionRecord`. This works similarly 1473 to a modern pool invalidation in that connections aren't actively 1474 closed, but are recycled only on next checkout; this is essentially 1475 a per-connection version of that feature. A new event 1476 :meth:`_events.PoolEvents.soft_invalidate` is added to complement it. 1477 1478 Also added new flag 1479 :attr:`.ExceptionContext.invalidate_pool_on_disconnect`. 1480 Allows an error handler within :meth:`_events.ConnectionEvents.handle_error` 1481 to maintain a "disconnect" condition, but to handle calling invalidate 1482 on individual connections in a specific manner within the event. 1483 1484 .. change:: 1485 :tags: feature, engine 1486 :tickets: 3355 1487 1488 Added new event :class:`.DialectEvents.do_connect`, which allows 1489 interception / replacement of when the :meth:`.Dialect.connect` 1490 hook is called to create a DBAPI connection. Also added 1491 dialect plugin hooks :meth:`.Dialect.get_dialect_cls` and 1492 :meth:`.Dialect.engine_created` which allow external plugins to 1493 add events to existing dialects using entry points. 1494 1495 .. change:: 1496 :tags: bug, orm 1497 :tickets: 3403, 3320 1498 1499 Fixed regression from 0.9.10 prior to release where the new addition 1500 of ``entity`` to the :attr:`_query.Query.column_descriptions` accessor 1501 would fail if the target entity was produced from a core selectable 1502 such as a :class:`_schema.Table` or :class:`_expression.CTE` object. 1503 1504 .. change:: 1505 :tags: feature, sql 1506 1507 Added a placeholder method :meth:`.TypeEngine.compare_against_backend` 1508 which is now consumed by Alembic migrations as of 0.7.6. User-defined 1509 types can implement this method to assist in the comparison of 1510 a type against one reflected from the database. 1511 1512 .. change:: 1513 :tags: bug, orm 1514 :tickets: 3402 1515 1516 Fixed regression within the flush process when an attribute were 1517 set to a SQL expression for an UPDATE, and the SQL expression when 1518 compared to the previous value of the attribute would produce a SQL 1519 comparison other than ``==`` or ``!=``, the exception "Boolean value 1520 of this clause is not defined" would raise. The fix ensures that 1521 the unit of work will not interpret the SQL expression in this way. 1522 1523 .. change:: 1524 :tags: bug, ext 1525 :tickets: 3397 1526 1527 Fixed bug in association proxy where an any()/has() 1528 on an relationship->scalar non-object attribute comparison would fail, 1529 e.g. 1530 ``filter(Parent.some_collection_to_attribute.any(Child.attr == 'foo'))`` 1531 1532 .. change:: 1533 :tags: bug, sql 1534 :tickets: 3396 1535 1536 Fixed bug where the truncation of long labels in SQL could produce 1537 a label that overlapped another label that is not truncated; this 1538 because the length threshold for truncation was greater than 1539 the portion of the label that remains after truncation. These 1540 two values have now been made the same; label_length - 6. 1541 The effect here is that shorter column labels will be "truncated" 1542 where they would not have been truncated before. 1543 1544 .. change:: 1545 :tags: bug, orm 1546 :tickets: 3392 1547 1548 Fixed unexpected use regression due to :ticket:`2992` where 1549 textual elements placed 1550 into the :meth:`_query.Query.order_by` clause in conjunction with joined 1551 eager loading would be added to the columns clause of the inner query 1552 in such a way that they were assumed to be table-bound column names, 1553 in the case where the joined eager load needs to wrap the query 1554 in a subquery to accommodate for a limit/offset. 1555 1556 Originally, the behavior here was intentional, in that a query such 1557 as ``query(User).order_by('name').limit(1)`` 1558 would order by ``user.name`` even if the query was modified by 1559 joined eager loading to be within a subquery, as ``'name'`` would 1560 be interpreted as a symbol to be located within the FROM clauses, 1561 in this case ``User.name``, which would then be copied into the 1562 columns clause to ensure it were present for ORDER BY. However, the 1563 feature fails to anticipate the case where ``order_by("name")`` refers 1564 to a specific label name present in the local columns clause already 1565 and not a name bound to a selectable in the FROM clause. 1566 1567 Beyond that, the feature also fails for deprecated cases such as 1568 ``order_by("name desc")``, which, while it emits a 1569 warning that :func:`_expression.text` should be used here (note that the issue 1570 does not impact cases where :func:`_expression.text` is used explicitly), 1571 still produces a different query than previously where the "name desc" 1572 expression is copied into the columns clause inappropriately. The 1573 resolution is such that the "joined eager loading" aspect of the 1574 feature will skip over these so-called "label reference" expressions 1575 when augmenting the inner columns clause, as though they were 1576 :func:`_expression.text` constructs already. 1577 1578 .. change:: 1579 :tags: bug, sql 1580 :tickets: 3391 1581 1582 Fixed regression due to :ticket:`3282` where the ``tables`` collection 1583 passed as a keyword argument to the :meth:`.DDLEvents.before_create`, 1584 :meth:`.DDLEvents.after_create`, :meth:`.DDLEvents.before_drop`, and 1585 :meth:`.DDLEvents.after_drop` events would no longer be a list 1586 of tables, but instead a list of tuples which contained a second 1587 entry with foreign keys to be added or dropped. As the ``tables`` 1588 collection, while documented as not necessarily stable, has come 1589 to be relied upon, this change is considered a regression. 1590 Additionally, in some cases for "drop", this collection would 1591 be an iterator that would cause the operation to fail if 1592 prematurely iterated. The collection is now a list of table 1593 objects in all cases and test coverage for the format of this 1594 collection is now added. 1595 1596 1597 .. change:: 1598 :tags: bug, orm 1599 :tickets: 3388 1600 1601 Fixed a regression regarding the :meth:`.MapperEvents.instrument_class` 1602 event where its invocation was moved to be after the class manager's 1603 instrumentation of the class, which is the opposite of what the 1604 documentation for the event explicitly states. The rationale for the 1605 switch was due to Declarative taking the step of setting up 1606 the full "instrumentation manager" for a class before it was mapped 1607 for the purpose of the new ``@declared_attr`` features 1608 described in :ref:`feature_3150`, but the change was also made 1609 against the classical use of :func:`.mapper` for consistency. 1610 However, SQLSoup relies upon the instrumentation event happening 1611 before any instrumentation under classical mapping. 1612 The behavior is reverted in the case of classical and declarative 1613 mapping, the latter implemented by using a simple memoization 1614 without using class manager. 1615 1616 .. change:: 1617 :tags: bug, orm 1618 :tickets: 3387 1619 1620 Fixed issue in new :meth:`.QueryEvents.before_compile` event where 1621 changes made to the :class:`_query.Query` object's collection of entities 1622 to load within the event would render in the SQL, but would not 1623 be reflected during the loading process. 1624 1625.. changelog:: 1626 :version: 1.0.2 1627 :released: April 24, 2015 1628 1629 .. change:: 1630 :tags: bug, sql 1631 :tickets: 3338, 3385 1632 1633 Fixed a regression that was incorrectly fixed in 1.0.0b4 1634 (hence becoming two regressions); reports that 1635 SELECT statements would GROUP BY a label name and fail was misconstrued 1636 that certain backends such as SQL Server should not be emitting 1637 ORDER BY or GROUP BY on a simple label name at all; when in fact, 1638 we had forgotten that 0.9 was already emitting ORDER BY on a simple 1639 label name for all backends, as described in :ref:`migration_1068`, 1640 even though 1.0 includes a rewrite of this logic as part of 1641 :ticket:`2992`. As far 1642 as emitting GROUP BY against a simple label, even PostgreSQL has 1643 cases where it will raise an error even though the label to group 1644 on should be apparent, so it is clear that GROUP BY should never 1645 be rendered in this way automatically. 1646 1647 In 1.0.2, SQL Server, Firebird and others will again emit ORDER BY on 1648 a simple label name when passed a 1649 :class:`.Label` construct that is also present in the columns clause. 1650 Additionally, no backend will emit GROUP BY against the simple label 1651 name only when passed a :class:`.Label` construct. 1652 1653 .. change:: 1654 :tags: bug, orm, declarative 1655 :tickets: 3383 1656 1657 Fixed unexpected use regression regarding the declarative 1658 ``__declare_first__`` and ``__declare_last__`` accessors where these 1659 would no longer be called on the superclass of the declarative base. 1660 1661.. changelog:: 1662 :version: 1.0.1 1663 :released: April 23, 2015 1664 1665 .. change:: 1666 :tags: bug, firebird 1667 :tickets: 3380 1668 1669 Fixed a regression due to :ticket:`3034` where limit/offset 1670 clauses were not properly interpreted by the Firebird dialect. 1671 Pull request courtesy effem-git. 1672 1673 .. change:: 1674 :tags: bug, firebird 1675 :tickets: 3381 1676 1677 Fixed support for "literal_binds" mode when using limit/offset 1678 with Firebird, so that the values are again rendered inline when 1679 this is selected. Related to :ticket:`3034`. 1680 1681 .. change:: 1682 :tags: bug, sqlite 1683 :tickets: 3378 1684 1685 Fixed a regression due to :ticket:`3282`, where due to the fact that 1686 we attempt to assume the availability of ALTER when creating/dropping 1687 schemas, in the case of SQLite we simply said to not worry about 1688 foreign keys at all, since ALTER is not available, when creating 1689 and dropping tables. This meant that the sorting of tables was 1690 basically skipped in the case of SQLite, and for the vast majority 1691 of SQLite use cases, this is not an issue. 1692 1693 However, users who were doing DROPs on SQLite 1694 with tables that contained data and with referential integrity 1695 turned on would then experience errors, as the 1696 dependency sorting *does* matter in the case of DROP with 1697 enforced constraints, when those tables have data (SQLite will still 1698 happily let you create foreign keys to nonexistent tables and drop 1699 tables referring to existing ones with constraints enabled, as long as 1700 there's no data being referenced). 1701 1702 In order to maintain the new feature of :ticket:`3282` while still 1703 allowing a SQLite DROP operation to maintain ordering, we now 1704 do the sort with full FKs taken under consideration, and if we encounter 1705 an unresolvable cycle, only *then* do we forego attempting to sort 1706 the tables; we instead emit a warning and go with the unsorted list. 1707 If an environment needs both ordered DROPs *and* has foreign key 1708 cycles, then the warning notes they will need to restore the 1709 ``use_alter`` flag to their :class:`_schema.ForeignKey` and 1710 :class:`_schema.ForeignKeyConstraint` objects so that just those objects will 1711 be omitted from the dependency sort. 1712 1713 .. seealso:: 1714 1715 :ref:`feature_3282` - contains an updated note about SQLite. 1716 1717 .. change:: 1718 :tags: bug, sql 1719 :tickets: 3372 1720 1721 Fixed issue where a straight SELECT EXISTS query would fail to 1722 assign the proper result type of Boolean to the result mapping, and 1723 instead would leak column types from within the query into the 1724 result map. This issue exists in 0.9 and earlier as well, however 1725 has less of an impact in those versions. In 1.0, due to :ticket:`918` 1726 this becomes a regression in that we now rely upon the result mapping 1727 to be very accurate, else we can assign result-type processors to 1728 the wrong column. In all versions, this issue also has the effect 1729 that a simple EXISTS will not apply the Boolean type handler, leading 1730 to simple 1/0 values for backends without native boolean instead of 1731 True/False. The fix includes that an EXISTS columns argument 1732 will be anon-labeled like other column expressions; a similar fix is 1733 implemented for pure-boolean expressions like ``not_(True())``. 1734 1735 .. change:: 1736 :tags: bug, orm 1737 :tickets: 3374 1738 1739 Fixed issue where a query of the form 1740 ``query(B).filter(B.a != A(id=7))`` would render the ``NEVER_SET`` 1741 symbol, when 1742 given a transient object. For a persistent object, it would 1743 always use the persisted database value and not the currently 1744 set value. Assuming autoflush is turned on, this usually would 1745 not be apparent for persistent values, as any pending changes 1746 would be flushed first in any case. However, this is inconsistent 1747 vs. the logic used for the non-negated comparison, 1748 ``query(B).filter(B.a == A(id=7))``, which does use the 1749 current value and additionally allows comparisons to transient 1750 objects. The comparison now uses the current value and not 1751 the database-persisted value. 1752 1753 Unlike the other ``NEVER_SET`` issues that are repaired as regressions 1754 caused by :ticket:`3061` in this release, this particular issue is 1755 present at least as far back as 0.8 and possibly earlier, however it 1756 was discovered as a result of repairing the related ``NEVER_SET`` 1757 issues. 1758 1759 .. seealso:: 1760 1761 :ref:`bug_3374` 1762 1763 .. change:: 1764 :tags: bug, orm 1765 :tickets: 3371 1766 1767 Fixed unexpected use regression cause by :ticket:`3061` where 1768 the NEVER_SET 1769 symbol could leak into relationship-oriented queries, including 1770 ``filter()`` and ``with_parent()`` queries. The ``None`` symbol 1771 is returned in all cases, however many of these queries have never 1772 been correctly supported in any case, and produce comparisons 1773 to NULL without using the IS operator. For this reason, a warning 1774 is also added to that subset of relationship queries that don't 1775 currently provide for ``IS NULL``. 1776 1777 .. seealso:: 1778 1779 :ref:`bug_3371` 1780 1781 1782 .. change:: 1783 :tags: bug, orm 1784 :tickets: 3368 1785 1786 Fixed a regression caused by :ticket:`3061` where the 1787 NEVER_SET symbol could leak into a lazyload query, subsequent 1788 to the flush of a pending object. This would occur typically 1789 for a many-to-one relationship that does not use a simple 1790 "get" strategy. The good news is that the fix improves efficiency 1791 vs. 0.9, because we can now skip the SELECT statement entirely 1792 when we detect NEVER_SET symbols present in the parameters; prior to 1793 :ticket:`3061`, we couldn't discern if the None here were set or not. 1794 1795 1796.. changelog:: 1797 :version: 1.0.0 1798 :released: April 16, 2015 1799 1800 .. change:: 1801 :tags: bug, orm 1802 :tickets: 3367 1803 1804 Identified an inconsistency when handling :meth:`_query.Query.join` to the 1805 same target more than once; it implicitly dedupes only in the case of 1806 a relationship join, and due to :ticket:`3233`, in 1.0 a join 1807 to the same table twice behaves differently than 0.9 in that it no 1808 longer erroneously aliases. To help document this change, 1809 the verbiage regarding :ticket:`3233` in the migration notes has 1810 been generalized, and a warning has been added when :meth:`_query.Query.join` 1811 is called against the same target relationship more than once. 1812 1813 .. change:: 1814 :tags: bug, orm 1815 :tickets: 3364 1816 1817 Made a small improvement to the heuristics of relationship when 1818 determining remote side with semi-self-referential (e.g. two joined 1819 inh subclasses referring to each other), non-simple join conditions 1820 such that the parententity is taken into account and can reduce the 1821 need for using the ``remote()`` annotation; this can restore some 1822 cases that might have worked without the annotation prior to 0.9.4 1823 via :ticket:`2948`. 1824 1825 .. change:: 1826 :tags: bug, mssql 1827 :tickets: 3360 1828 1829 Fixed a regression where the "last inserted id" mechanics would 1830 fail to store the correct value for MSSQL on an INSERT where the 1831 primary key value was present in the insert params before execution, 1832 as well as in the case where an INSERT from SELECT would state the 1833 target columns as column objects, instead of string keys. 1834 1835 1836 .. change:: 1837 :tags: bug, mssql 1838 1839 Using the ``Binary`` constructor now present in pymssql rather than 1840 patching one in. Pull request courtesy Ramiro Morales. 1841 1842 .. change:: 1843 :tags: bug, tests 1844 :tickets: 3356 1845 1846 Fixed the pathing used when tests run; for sqla_nose.py and py.test, 1847 the "./lib" prefix is again inserted at the head of sys.path but 1848 only if sys.flags.no_user_site isn't set; this makes it act just 1849 like the way Python puts "." in the current path by default. 1850 For tox, we are setting the PYTHONNOUSERSITE flag now. 1851 1852 .. change:: 1853 :tags: feature, sql 1854 :tickets: 3084 1855 1856 The topological sorting used to sort :class:`_schema.Table` objects 1857 and available via the :attr:`_schema.MetaData.sorted_tables` collection 1858 will now produce a **deterministic** ordering; that is, the same 1859 ordering each time given a set of tables with particular names 1860 and dependencies. This is to help with comparison of DDL scripts 1861 and other use cases. The tables are sent to the topological sort 1862 sorted by name, and the topological sort itself will process 1863 the incoming data in an ordered fashion. Pull request 1864 courtesy Sebastian Bank. 1865 1866 .. seealso:: 1867 1868 :ref:`feature_3084` 1869 1870 .. change:: 1871 :tags: feature, orm 1872 1873 Added new argument :paramref:`.Query.update.update_args` which allows 1874 kw arguments such as ``mysql_limit`` to be passed to the underlying 1875 :class:`_expression.Update` construct. Pull request courtesy Amir Sadoughi. 1876 1877.. changelog:: 1878 :version: 1.0.0b5 1879 :released: April 3, 2015 1880 1881 .. change:: 1882 :tags: bug, orm 1883 :tickets: 3349 1884 1885 :class:`_query.Query` doesn't support joins, subselects, or special 1886 FROM clauses when using the :meth:`_query.Query.update` or 1887 :meth:`_query.Query.delete` methods; instead of silently ignoring these 1888 fields if methods like :meth:`_query.Query.join` or 1889 :meth:`_query.Query.select_from` has been called, an error is raised. 1890 In 0.9.10 this only emits a warning. 1891 1892 .. change:: 1893 :tags: bug, orm 1894 1895 Added a list() call around a weak dictionary used within the 1896 commit phase of the session, which without it could cause 1897 a "dictionary changed size during iter" error if garbage collection 1898 interacted within the process. Change was introduced by 1899 #3139. 1900 1901 .. change:: 1902 :tags: bug, postgresql 1903 :tickets: 3343 1904 1905 Fixed bug where updated PG index reflection as a result of 1906 :ticket:`3184` would cause index operations to fail on PostgreSQL 1907 versions 8.4 and earlier. The enhancements are now 1908 disabled when using an older version of PostgreSQL. 1909 1910 .. change:: 1911 :tags: bug, sql 1912 :tickets: 3346 1913 1914 The warning emitted by the unicode type for a non-unicode type 1915 has been liberalized to warn for values that aren't even string 1916 values, such as integers; previously, the updated warning system 1917 of 1.0 made use of string formatting operations which 1918 would raise an internal TypeError. While these cases should ideally 1919 raise totally, some backends like SQLite and MySQL do accept them 1920 and are potentially in use by legacy code, not to mention that they 1921 will always pass through if unicode conversion is turned off 1922 for the target backend. 1923 1924 .. change:: 1925 :tags: bug, orm 1926 :tickets: 3347 1927 1928 Fixed a bug related to "nested" inner join eager loading, which 1929 exists in 0.9 as well but is more of a regression in 1.0 due to 1930 :ticket:`3008` which turns on "nested" by default, such that 1931 a joined eager load that travels across sibling paths from a common 1932 ancestor using innerjoin=True will correctly splice each "innerjoin" 1933 sibling into the appropriate part of the join, when a series of 1934 inner/outer joins are mixed together. 1935 1936.. changelog:: 1937 :version: 1.0.0b4 1938 :released: March 29, 2015 1939 1940 .. change:: 1941 :tags: bug, mssql, oracle, firebird, sybase 1942 :tickets: 3338 1943 1944 Turned off the "simple order by" flag on the MSSQL, Oracle dialects; 1945 this is the flag that per :ticket:`2992` causes an order by or group by 1946 an expression that's also in the columns clause to be copied by 1947 label, even if referenced as the expression object. The behavior 1948 for MSSQL is now the old behavior that copies the whole expression 1949 in by default, as MSSQL can be picky on these particularly in 1950 GROUP BY expressions. The flag is also turned off defensively 1951 for the Firebird and Sybase dialects. 1952 1953 .. note:: this resolution was incorrect, please see version 1.0.2 1954 for a rework of this resolution. 1955 1956 .. change:: 1957 :tags: feature, schema 1958 :tickets: 3341 1959 1960 The "auto-attach" feature of constraints such as :class:`.UniqueConstraint` 1961 and :class:`.CheckConstraint` has been further enhanced such that 1962 when the constraint is associated with non-table-bound :class:`_schema.Column` 1963 objects, the constraint will set up event listeners with the 1964 columns themselves such that the constraint auto attaches at the 1965 same time the columns are associated with the table. This in particular 1966 helps in some edge cases in declarative but is also of general use. 1967 1968 .. seealso:: 1969 1970 :ref:`change_3341` 1971 1972 .. change:: 1973 :tags: bug, sql 1974 :tickets: 3340 1975 1976 Fixed bug in new "label resolution" feature of :ticket:`2992` where 1977 a label that was anonymous, then labeled again with a name, would 1978 fail to be locatable via a textual label. This situation occurs 1979 naturally when a mapped :func:`.column_property` is given an 1980 explicit label in a query. 1981 1982 .. change:: 1983 :tags: bug, sql 1984 :tickets: 3335 1985 1986 Fixed bug in new "label resolution" feature of :ticket:`2992` where 1987 the string label placed in the order_by() or group_by() of a statement 1988 would place higher priority on the name as found 1989 inside the FROM clause instead of a more locally available name 1990 inside the columns clause. 1991 1992.. changelog:: 1993 :version: 1.0.0b3 1994 :released: March 20, 2015 1995 1996 .. change:: 1997 :tags: bug, mysql 1998 :tickets: 2771 1999 2000 Repaired the commit for issue #2771 which was inadvertently commented 2001 out. 2002 2003 2004.. changelog:: 2005 :version: 1.0.0b2 2006 :released: March 20, 2015 2007 2008 .. change:: 2009 :tags: bug, mysql 2010 :tickets: 2771 2011 2012 Fixes to fully support using the ``'utf8mb4'`` MySQL-specific charset 2013 with MySQL dialects, in particular MySQL-Python and PyMySQL. In 2014 addition, MySQL databases that report more unusual charsets such as 2015 'koi8u' or 'eucjpms' will also work correctly. Pull request 2016 courtesy Thomas Grainger. 2017 2018 .. change:: 2019 :tags: change, orm, declarative 2020 :tickets: 3331 2021 2022 Loosened some restrictions that were added to ``@declared_attr`` 2023 objects, such that they were prevented from being called outside 2024 of the declarative process; this is related to the enhancements 2025 of #3150 which allow ``@declared_attr`` to return a value that is 2026 cached based on the current class as it's being configured. 2027 The exception raise has been removed, and the behavior changed 2028 so that outside of the declarative process, the function decorated by 2029 ``@declared_attr`` is called every time just like a regular 2030 ``@property``, without using any caching, as none is available 2031 at this stage. 2032 2033 .. change:: 2034 :tags: bug, engine 2035 :tickets: 3330, 3329 2036 2037 The "auto close" for :class:`_engine.ResultProxy` is now a "soft" close. 2038 That is, after exhausting all rows using the fetch methods, the 2039 DBAPI cursor is released as before and the object may be safely 2040 discarded, but the fetch methods may continue to be called for which 2041 they will return an end-of-result object (None for fetchone, empty list 2042 for fetchmany and fetchall). Only if :meth:`_engine.ResultProxy.close` 2043 is called explicitly will these methods raise the "result is closed" 2044 error. 2045 2046 .. seealso:: 2047 2048 :ref:`change_3330` 2049 2050 .. change:: 2051 :tags: bug, orm 2052 :tickets: 3327 2053 2054 Fixed unexpected use regression from pullreq github:137 where 2055 Py2K unicode literals (e.g. ``u""``) would not be accepted by the 2056 :paramref:`_orm.relationship.cascade` option. 2057 Pull request courtesy Julien Castets. 2058 2059 2060.. changelog:: 2061 :version: 1.0.0b1 2062 :released: March 13, 2015 2063 2064 Version 1.0.0b1 is the first release of the 1.0 series. Many changes 2065 described here are also present in the 0.9 and sometimes the 0.8 2066 series as well. For changes that are specific to 1.0 with an emphasis 2067 on compatibility concerns, see :doc:`/changelog/migration_10`. 2068 2069 .. change:: 2070 :tags: feature, ext 2071 :tickets: 3054 2072 2073 Added a new extension suite :mod:`sqlalchemy.ext.baked`. This 2074 simple but unusual system allows for a dramatic savings in Python 2075 overhead for the construction and processing of orm :class:`_query.Query` 2076 objects, from query construction up through rendering of a string 2077 SQL statement. 2078 2079 .. seealso:: 2080 2081 :ref:`baked_toplevel` 2082 2083 .. change:: 2084 :tags: bug, postgresql 2085 :tickets: 3319 2086 2087 The PostgreSQL :class:`_postgresql.ENUM` type will emit a 2088 DROP TYPE instruction when a plain ``table.drop()`` is called, 2089 assuming the object is not associated directly with a 2090 :class:`_schema.MetaData` object. In order to accommodate the use case of 2091 an enumerated type shared between multiple tables, the type should 2092 be associated directly with the :class:`_schema.MetaData` object; in this 2093 case the type will only be created at the metadata level, or if 2094 created directly. The rules for create/drop of 2095 PostgreSQL enumerated types have been highly reworked in general. 2096 2097 .. seealso:: 2098 2099 :ref:`change_3319` 2100 2101 .. change:: 2102 :tags: feature, orm 2103 :tickets: 3317 2104 2105 Added a new event suite :class:`.QueryEvents`. The 2106 :meth:`.QueryEvents.before_compile` event allows the creation 2107 of functions which may place additional modifications to 2108 :class:`_query.Query` objects before the construction of the SELECT 2109 statement. It is hoped that this event be made much more 2110 useful via the advent of a new inspection system that will 2111 allow for detailed modifications to be made against 2112 :class:`_query.Query` objects in an automated fashion. 2113 2114 .. seealso:: 2115 2116 :class:`.QueryEvents` 2117 2118 2119 .. change:: 2120 :tags: feature, orm 2121 :tickets: 3249 2122 2123 The subquery wrapping which occurs when joined eager loading 2124 is used with a one-to-many query that also features LIMIT, 2125 OFFSET, or DISTINCT has been disabled in the case of a one-to-one 2126 relationship, that is a one-to-many with 2127 :paramref:`_orm.relationship.uselist` set to False. This will produce 2128 more efficient queries in these cases. 2129 2130 .. seealso:: 2131 2132 :ref:`change_3249` 2133 2134 2135 .. change:: 2136 :tags: bug, orm 2137 :tickets: 3301 2138 2139 Fixed bug where the session attachment error "object is already 2140 attached to session X" would fail to prevent the object from 2141 also being attached to the new session, in the case that execution 2142 continued after the error raise occurred. 2143 2144 .. change:: 2145 :tags: bug, orm, declarative 2146 :tickets: 3219, 3240 2147 2148 Fixed bug where using an ``__abstract__`` mixin in the middle 2149 of a declarative inheritance hierarchy would prevent attributes 2150 and configuration being correctly propagated from the base class 2151 to the inheriting class. 2152 2153 .. change:: 2154 :tags: feature, sql 2155 :tickets: 918 2156 2157 The SQL compiler now generates the mapping of expected columns 2158 such that they are matched to the received result set positionally, 2159 rather than by name. Originally, this was seen as a way to handle 2160 cases where we had columns returned with difficult-to-predict names, 2161 though in modern use that issue has been overcome by anonymous 2162 labeling. In this version, the approach basically reduces function 2163 call count per-result by a few dozen calls, or more for larger 2164 sets of result columns. The approach still degrades into a modern 2165 version of the old approach if any discrepancy in size exists between 2166 the compiled set of columns versus what was received, so there's no 2167 issue for partially or fully textual compilation scenarios where these 2168 lists might not line up. 2169 2170 .. change:: 2171 :tags: feature, postgresql 2172 2173 The PG8000 dialect now supports the 2174 :paramref:`_sa.create_engine.encoding` parameter, by setting up 2175 the client encoding on the connection which is then intercepted 2176 by pg8000. Pull request courtesy Tony Locke. 2177 2178 .. change:: 2179 :tags: feature, postgresql 2180 2181 Added support for PG8000's native JSONB feature. Pull request 2182 courtesy Tony Locke. 2183 2184 .. change:: 2185 :tags: change, orm 2186 2187 Mapped attributes marked as deferred without explicit undeferral 2188 will now remain "deferred" even if their column is otherwise 2189 present in the result set in some way. This is a performance 2190 enhancement in that an ORM load no longer spends time searching 2191 for each deferred column when the result set is obtained. However, 2192 for an application that has been relying upon this, an explicit 2193 :func:`.undefer` or similar option should now be used. 2194 2195 .. change:: 2196 :tags: feature, orm 2197 :tickets: 3307 2198 2199 Mapped state internals have been reworked to allow for a 50% reduction 2200 in callcounts specific to the "expiration" of objects, as in 2201 the "auto expire" feature of :meth:`.Session.commit` and 2202 for :meth:`.Session.expire_all`, as well as in the "cleanup" step 2203 which occurs when object states are garbage collected. 2204 2205 .. change:: 2206 :tags: bug, mysql 2207 2208 The MySQL dialect now supports CAST on types that are constructed 2209 as :class:`.TypeDecorator` objects. 2210 2211 .. change:: 2212 :tags: bug, mysql 2213 :tickets: 3237 2214 2215 A warning is emitted when :func:`.cast` is used with the MySQL 2216 dialect on a type where MySQL does not support CAST; MySQL only 2217 supports CAST on a subset of datatypes. SQLAlchemy has for a long 2218 time just omitted the CAST for unsupported types in the case of 2219 MySQL. While we don't want to change this now, we emit a warning 2220 to show that it's taken place. A warning is also emitted when 2221 a CAST is used with an older MySQL version (< 4) that doesn't support 2222 CAST at all, it's skipped in this case as well. 2223 2224 .. change:: 2225 :tags: feature, sql 2226 :tickets: 3087 2227 2228 Literal values within a :class:`.DefaultClause`, which is invoked 2229 when using the :paramref:`_schema.Column.server_default` parameter, will 2230 now be rendered using the "inline" compiler, so that they are rendered 2231 as-is, rather than as bound parameters. 2232 2233 .. seealso:: 2234 2235 :ref:`change_3087` 2236 2237 .. change:: 2238 :tags: feature, oracle 2239 2240 Added support for cx_oracle connections to a specific service 2241 name, as opposed to a tns name, by passing ``?service_name=<name>`` 2242 to the URL. Pull request courtesy Sławomir Ehlert. 2243 2244 .. change:: 2245 :tags: feature, mysql 2246 :tickets: 3155 2247 2248 The MySQL dialect now renders TIMESTAMP with NULL / NOT NULL in 2249 all cases, so that MySQL 5.6.6 with the 2250 ``explicit_defaults_for_timestamp`` flag enabled will 2251 will allow TIMESTAMP to continue to work as expected when 2252 ``nullable=False``. Existing applications are unaffected as 2253 SQLAlchemy has always emitted NULL for a TIMESTAMP column that 2254 is ``nullable=True``. 2255 2256 .. seealso:: 2257 2258 :ref:`change_3155` 2259 2260 :ref:`mysql_timestamp_null` 2261 2262 .. change:: 2263 :tags: bug, schema 2264 :tickets: 3299, 3067 2265 2266 The :class:`.CheckConstraint` construct now supports naming 2267 conventions that include the token ``%(column_0_name)s``; the 2268 constraint expression is scanned for columns. Additionally, 2269 naming conventions for check constraints that don't include the 2270 ``%(constraint_name)s`` token will now work for :class:`.SchemaType`- 2271 generated constraints, such as those of :class:`.Boolean` and 2272 :class:`.Enum`; this stopped working in 0.9.7 due to :ticket:`3067`. 2273 2274 .. seealso:: 2275 2276 :ref:`naming_check_constraints` 2277 2278 :ref:`naming_schematypes` 2279 2280 2281 .. change:: 2282 :tags: feature, postgresql, pypy 2283 :tickets: 3052 2284 2285 Added support for the psycopg2cffi DBAPI on pypy. Pull request 2286 courtesy shauns. 2287 2288 .. seealso:: 2289 2290 :mod:`sqlalchemy.dialects.postgresql.psycopg2cffi` 2291 2292 .. change:: 2293 :tags: feature, orm 2294 :tickets: 3262 2295 2296 A warning is emitted when the same polymorphic identity is assigned 2297 to two different mappers in the same hierarchy. This is typically a 2298 user error and means that the two different mapping types cannot be 2299 correctly distinguished at load time. Pull request courtesy 2300 Sebastian Bank. 2301 2302 .. change:: 2303 :tags: feature, sql 2304 2305 The type of expression is reported when an object passed to a 2306 SQL expression unit can't be interpreted as a SQL fragment; 2307 pull request courtesy Ryan P. Kelly. 2308 2309 .. change:: 2310 :tags: bug, orm 2311 :tickets: 3227, 3242, 1326 2312 2313 The primary :class:`_orm.Mapper` of a :class:`_query.Query` is now passed to the 2314 :meth:`.Session.get_bind` method when calling upon 2315 :meth:`_query.Query.count`, :meth:`_query.Query.update`, :meth:`_query.Query.delete`, 2316 as well as queries against mapped columns, 2317 :obj:`.column_property` objects, and SQL functions and expressions 2318 derived from mapped columns. This allows sessions that rely upon 2319 either customized :meth:`.Session.get_bind` schemes or "bound" metadata 2320 to work in all relevant cases. 2321 2322 .. seealso:: 2323 2324 :ref:`bug_3227` 2325 2326 .. change:: 2327 :tags: enhancement, sql 2328 :tickets: 3074 2329 2330 Custom dialects that implement :class:`.GenericTypeCompiler` can 2331 now be constructed such that the visit methods receive an indication 2332 of the owning expression object, if any. Any visit method that 2333 accepts keyword arguments (e.g. ``**kw``) will in most cases 2334 receive a keyword argument ``type_expression``, referring to the 2335 expression object that the type is contained within. For columns 2336 in DDL, the dialect's compiler class may need to alter its 2337 ``get_column_specification()`` method to support this as well. 2338 The ``UserDefinedType.get_col_spec()`` method will also receive 2339 ``type_expression`` if it provides ``**kw`` in its argument 2340 signature. 2341 2342 .. change:: 2343 :tags: bug, sql 2344 :tickets: 3288 2345 2346 The multi-values version of :meth:`_expression.Insert.values` has been 2347 repaired to work more usefully with tables that have Python- 2348 side default values and/or functions, as well as server-side 2349 defaults. The feature will now work with a dialect that uses 2350 "positional" parameters; a Python callable will also be 2351 invoked individually for each row just as is the case with an 2352 "executemany" style invocation; a server- side default column 2353 will no longer implicitly receive the value explicitly 2354 specified for the first row, instead refusing to invoke 2355 without an explicit value. 2356 2357 .. seealso:: 2358 2359 :ref:`bug_3288` 2360 2361 .. change:: 2362 :tags: feature, general 2363 2364 Structural memory use has been improved via much more significant use 2365 of ``__slots__`` for many internal objects. This optimization is 2366 particularly geared towards the base memory size of large applications 2367 that have lots of tables and columns, and greatly reduces memory 2368 size for a variety of high-volume objects including event listening 2369 internals, comparator objects and parts of the ORM attribute and 2370 loader strategy system. 2371 2372 .. seealso:: 2373 2374 :ref:`feature_slots` 2375 2376 .. change:: 2377 :tags: bug, mysql 2378 :tickets: 3283 2379 2380 The :class:`.mysql.SET` type has been overhauled to no longer 2381 assume that the empty string, or a set with a single empty string 2382 value, is in fact a set with a single empty string; instead, this 2383 is by default treated as the empty set. In order to handle persistence 2384 of a :class:`.mysql.SET` that actually wants to include the blank 2385 value ``''`` as a legitimate value, a new bitwise operational mode 2386 is added which is enabled by the 2387 :paramref:`.mysql.SET.retrieve_as_bitwise` flag, which will persist 2388 and retrieve values unambiguously using their bitflag positioning. 2389 Storage and retrieval of unicode values for driver configurations 2390 that aren't converting unicode natively is also repaired. 2391 2392 .. seealso:: 2393 2394 :ref:`change_3283` 2395 2396 2397 .. change:: 2398 :tags: feature, schema 2399 :tickets: 3282 2400 2401 The DDL generation system of :meth:`_schema.MetaData.create_all` 2402 and :meth:`_schema.MetaData.drop_all` has been enhanced to in most 2403 cases automatically handle the case of mutually dependent 2404 foreign key constraints; the need for the 2405 :paramref:`_schema.ForeignKeyConstraint.use_alter` flag is greatly 2406 reduced. The system also works for constraints which aren't given 2407 a name up front; only in the case of DROP is a name required for 2408 at least one of the constraints involved in the cycle. 2409 2410 .. seealso:: 2411 2412 :ref:`feature_3282` 2413 2414 .. change:: 2415 :tags: feature, schema 2416 2417 Added a new accessor :attr:`_schema.Table.foreign_key_constraints` 2418 to complement the :attr:`_schema.Table.foreign_keys` collection, 2419 as well as :attr:`_schema.ForeignKeyConstraint.referred_table`. 2420 2421 .. change:: 2422 :tags: bug, sqlite 2423 :tickets: 3244, 3261 2424 2425 UNIQUE and FOREIGN KEY constraints are now fully reflected on 2426 SQLite both with and without names. Previously, foreign key 2427 names were ignored and unnamed unique constraints were skipped. 2428 Thanks to Jon Nelson for assistance with this. 2429 2430 .. change:: 2431 :tags: feature, examples 2432 2433 A new suite of examples dedicated to providing a detailed study 2434 into performance of SQLAlchemy ORM and Core, as well as the DBAPI, 2435 from multiple perspectives. The suite runs within a container 2436 that provides built in profiling displays both through console 2437 output as well as graphically via the RunSnake tool. 2438 2439 .. seealso:: 2440 2441 :ref:`examples_performance` 2442 2443 .. change:: 2444 :tags: feature, orm 2445 :tickets: 3100 2446 2447 A new series of :class:`.Session` methods which provide hooks 2448 directly into the unit of work's facility for emitting INSERT 2449 and UPDATE statements has been created. When used correctly, 2450 this expert-oriented system can allow ORM-mappings to be used 2451 to generate bulk insert and update statements batched into 2452 executemany groups, allowing the statements to proceed at 2453 speeds that rival direct use of the Core. 2454 2455 .. seealso:: 2456 2457 :ref:`bulk_operations` 2458 2459 .. change:: 2460 :tags: feature, mssql 2461 :tickets: 3039 2462 2463 SQL Server 2012 now recommends VARCHAR(max), NVARCHAR(max), 2464 VARBINARY(max) for large text/binary types. The MSSQL dialect will 2465 now respect this based on version detection, as well as the new 2466 ``deprecate_large_types`` flag. 2467 2468 .. seealso:: 2469 2470 :ref:`mssql_large_type_deprecation` 2471 2472 .. change:: 2473 :tags: bug, sqlite 2474 :tickets: 3257 2475 2476 The SQLite dialect, when using the :class:`_sqlite.DATE`, 2477 :class:`_sqlite.TIME`, 2478 or :class:`_sqlite.DATETIME` types, and given a ``storage_format`` that 2479 only renders numbers, will render the types in DDL as 2480 ``DATE_CHAR``, ``TIME_CHAR``, and ``DATETIME_CHAR``, so that despite the 2481 lack of alpha characters in the values, the column will still 2482 deliver the "text affinity". Normally this is not needed, as the 2483 textual values within the default storage formats already 2484 imply text. 2485 2486 .. seealso:: 2487 2488 :ref:`sqlite_datetime` 2489 2490 .. change:: 2491 :tags: bug, engine 2492 :tickets: 3266 2493 2494 The engine-level error handling and wrapping routines will now 2495 take effect in all engine connection use cases, including 2496 when user-custom connect routines are used via the 2497 :paramref:`_sa.create_engine.creator` parameter, as well as when 2498 the :class:`_engine.Connection` encounters a connection error on 2499 revalidation. 2500 2501 .. seealso:: 2502 2503 :ref:`change_3266` 2504 2505 .. change:: 2506 :tags: feature, oracle 2507 2508 New Oracle DDL features for tables, indexes: COMPRESS, BITMAP. 2509 Patch courtesy Gabor Gombas. 2510 2511 .. change:: 2512 :tags: bug, oracle 2513 2514 An alias name will be properly quoted when referred to using the 2515 ``%(name)s`` token inside the :meth:`_expression.Select.with_hint` method. 2516 Previously, the Oracle backend hadn't implemented this quoting. 2517 2518 .. change:: 2519 :tags: feature, oracle 2520 :tickets: 3220 2521 2522 Added support for CTEs under Oracle. This includes some tweaks 2523 to the aliasing syntax, as well as a new CTE feature 2524 :meth:`_expression.CTE.suffix_with`, which is useful for adding in special 2525 Oracle-specific directives to the CTE. 2526 2527 .. seealso:: 2528 2529 :ref:`change_3220` 2530 2531 .. change:: 2532 :tags: feature, mysql 2533 :tickets: 3121 2534 2535 Updated the "supports_unicode_statements" flag to True for MySQLdb 2536 and Pymysql under Python 2. This refers to the SQL statements 2537 themselves, not the parameters, and affects issues such as table 2538 and column names using non-ASCII characters. These drivers both 2539 appear to support Python 2 Unicode objects without issue in modern 2540 versions. 2541 2542 .. change:: 2543 :tags: bug, mysql 2544 :tickets: 3263 2545 2546 The :meth:`.ColumnOperators.match` operator is now handled such that the 2547 return type is not strictly assumed to be boolean; it now 2548 returns a :class:`.Boolean` subclass called :class:`.MatchType`. 2549 The type will still produce boolean behavior when used in Python 2550 expressions, however the dialect can override its behavior at 2551 result time. In the case of MySQL, while the MATCH operator 2552 is typically used in a boolean context within an expression, 2553 if one actually queries for the value of a match expression, a 2554 floating point value is returned; this value is not compatible 2555 with SQLAlchemy's C-based boolean processor, so MySQL's result-set 2556 behavior now follows that of the :class:`.Float` type. 2557 A new operator object ``notmatch_op`` is also added to better allow 2558 dialects to define the negation of a match operation. 2559 2560 .. seealso:: 2561 2562 :ref:`change_3263` 2563 2564 .. change:: 2565 :tags: bug, postgresql 2566 :tickets: 3264 2567 2568 The :meth:`.PGDialect.has_table` method will now query against 2569 ``pg_catalog.pg_table_is_visible(c.oid)``, rather than testing 2570 for an exact schema match, when the schema name is None; this 2571 so that the method will also illustrate that temporary tables 2572 are present. Note that this is a behavioral change, as PostgreSQL 2573 allows a non-temporary table to silently overwrite an existing 2574 temporary table of the same name, so this changes the behavior 2575 of ``checkfirst`` in that unusual scenario. 2576 2577 .. seealso:: 2578 2579 :ref:`change_3264` 2580 2581 .. change:: 2582 :tags: bug, sql 2583 :tickets: 3260 2584 2585 Fixed bug in :meth:`_schema.Table.tometadata` method where the 2586 :class:`.CheckConstraint` associated with a :class:`.Boolean` 2587 or :class:`.Enum` type object would be doubled in the target table. 2588 The copy process now tracks the production of this constraint object 2589 as local to a type object. 2590 2591 .. change:: 2592 :tags: feature, orm 2593 :tickets: 3217 2594 2595 Added a parameter :paramref:`.Query.join.isouter` which is synonymous 2596 with calling :meth:`_query.Query.outerjoin`; this flag is to provide a more 2597 consistent interface compared to Core :meth:`_expression.FromClause.join`. 2598 Pull request courtesy Jonathan Vanasco. 2599 2600 .. change:: 2601 :tags: bug, sql 2602 :tickets: 3243 2603 2604 The behavioral contract of the :attr:`_schema.ForeignKeyConstraint.columns` 2605 collection has been made consistent; this attribute is now a 2606 :class:`_expression.ColumnCollection` like that of all other constraints and 2607 is initialized at the point when the constraint is associated with 2608 a :class:`_schema.Table`. 2609 2610 .. seealso:: 2611 2612 :ref:`change_3243` 2613 2614 .. change:: 2615 :tags: bug, orm 2616 :tickets: 3256 2617 2618 The :meth:`.PropComparator.of_type` modifier has been 2619 improved in conjunction with loader directives such as 2620 :func:`_orm.joinedload` and :func:`.contains_eager` such that if 2621 two :meth:`.PropComparator.of_type` modifiers of the same 2622 base type/path are encountered, they will be joined together 2623 into a single "polymorphic" entity, rather than replacing 2624 the entity of type A with the one of type B. E.g. 2625 a joinedload of ``A.b.of_type(BSub1)->BSub1.c`` combined with 2626 joinedload of ``A.b.of_type(BSub2)->BSub2.c`` will create a 2627 single joinedload of ``A.b.of_type((BSub1, BSub2)) -> BSub1.c, BSub2.c``, 2628 without the need for the ``with_polymorphic`` to be explicit 2629 in the query. 2630 2631 .. seealso:: 2632 2633 :ref:`eagerloading_polymorphic_subtypes` - contains an updated 2634 example illustrating the new format. 2635 2636 .. change:: 2637 :tags: bug, sql 2638 :tickets: 3245 2639 2640 The :attr:`_schema.Column.key` attribute is now used as the source of 2641 anonymous bound parameter names within expressions, to match the 2642 existing use of this value as the key when rendered in an INSERT 2643 or UPDATE statement. This allows :attr:`_schema.Column.key` to be used 2644 as a "substitute" string to work around a difficult column name 2645 that doesn't translate well into a bound parameter name. Note that 2646 the paramstyle is configurable on :func:`_sa.create_engine` in any case, 2647 and most DBAPIs today support a named and positional style. 2648 2649 .. change:: 2650 :tags: bug, sql 2651 2652 Fixed the name of the :paramref:`.PoolEvents.reset.dbapi_connection` 2653 parameter as passed to this event; in particular this affects 2654 usage of the "named" argument style for this event. Pull request 2655 courtesy Jason Goldberger. 2656 2657 .. change:: 2658 :tags: feature, sql 2659 2660 Added a new parameter :paramref:`.Table.tometadata.name` to 2661 the :meth:`_schema.Table.tometadata` method. Similar to 2662 :paramref:`.Table.tometadata.schema`, this argument causes the newly 2663 copied :class:`_schema.Table` to take on the new name instead of 2664 the existing one. An interesting capability this adds is that of 2665 copying a :class:`_schema.Table` object to the *same* :class:`_schema.MetaData` 2666 target with a new name. Pull request courtesy n.d. parker. 2667 2668 .. change:: 2669 :tags: bug, orm 2670 2671 Repaired support of the ``copy.deepcopy()`` call when used by the 2672 :class:`.orm.util.CascadeOptions` argument, which occurs 2673 if ``copy.deepcopy()`` is being used with :func:`_orm.relationship` 2674 (not an officially supported use case). Pull request courtesy 2675 duesenfranz. 2676 2677 .. change:: 2678 :tags: bug, sql 2679 :tickets: 3170 2680 2681 Reversing a change that was made in 0.9, the "singleton" nature 2682 of the "constants" :func:`.null`, :func:`.true`, and :func:`.false` 2683 has been reverted. These functions returning a "singleton" object 2684 had the effect that different instances would be treated as the 2685 same regardless of lexical use, which in particular would impact 2686 the rendering of the columns clause of a SELECT statement. 2687 2688 .. seealso:: 2689 2690 :ref:`bug_3170` 2691 2692 .. change:: 2693 :tags: bug, orm 2694 :tickets: 3139 2695 2696 Fixed bug where :meth:`.Session.expunge` would not fully detach 2697 the given object if the object had been subject to a delete 2698 operation that was flushed, but not committed. This would also 2699 affect related operations like :func:`.make_transient`. 2700 2701 .. seealso:: 2702 2703 :ref:`bug_3139` 2704 2705 .. change:: 2706 :tags: bug, orm 2707 :tickets: 3230 2708 2709 A warning is emitted in the case of multiple relationships that 2710 ultimately will populate a foreign key column in conflict with 2711 another, where the relationships are attempting to copy values 2712 from different source columns. This occurs in the case where 2713 composite foreign keys with overlapping columns are mapped to 2714 relationships that each refer to a different referenced column. 2715 A new documentation section illustrates the example as well as how 2716 to overcome the issue by specifying "foreign" columns specifically 2717 on a per-relationship basis. 2718 2719 .. seealso:: 2720 2721 :ref:`relationship_overlapping_foreignkeys` 2722 2723 .. change:: 2724 :tags: feature, sql 2725 :tickets: 3172 2726 2727 Exception messages have been spiffed up a bit. The SQL statement 2728 and parameters are not displayed if None, reducing confusion for 2729 error messages that weren't related to a statement. The full 2730 module and classname for the DBAPI-level exception is displayed, 2731 making it clear that this is a wrapped DBAPI exception. The 2732 statement and parameters themselves are bounded within a bracketed 2733 sections to better isolate them from the error message and from 2734 each other. 2735 2736 .. change:: 2737 :tags: bug, orm 2738 :tickets: 3228 2739 2740 The :meth:`_query.Query.update` method will now convert string key 2741 names in the given dictionary of values into mapped attribute names 2742 against the mapped class being updated. Previously, string names 2743 were taken in directly and passed to the core update statement without 2744 any means to resolve against the mapped entity. Support for synonyms 2745 and hybrid attributes as the subject attributes of 2746 :meth:`_query.Query.update` are also supported. 2747 2748 .. seealso:: 2749 2750 :ref:`bug_3228` 2751 2752 .. change:: 2753 :tags: bug, orm 2754 :tickets: 3035 2755 2756 Improvements to the mechanism used by :class:`.Session` to locate 2757 "binds" (e.g. engines to use), such engines can be associated with 2758 mixin classes, concrete subclasses, as well as a wider variety 2759 of table metadata such as joined inheritance tables. 2760 2761 .. seealso:: 2762 2763 :ref:`bug_3035` 2764 2765 .. change:: 2766 :tags: bug, general 2767 :tickets: 3218 2768 2769 The ``__module__`` attribute is now set for all those SQL and 2770 ORM functions that are derived as "public factory" symbols, which 2771 should assist with documentation tools being able to report on the 2772 target module. 2773 2774 .. change:: 2775 :tags: feature, sql 2776 2777 :meth:`_expression.Insert.from_select` now includes Python and SQL-expression 2778 defaults if otherwise unspecified; the limitation where non- 2779 server column defaults aren't included in an INSERT FROM 2780 SELECT is now lifted and these expressions are rendered as 2781 constants into the SELECT statement. 2782 2783 .. seealso:: 2784 2785 :ref:`feature_insert_from_select_defaults` 2786 2787 .. change:: 2788 :tags: bug, orm 2789 :tickets: 3233 2790 2791 Fixed bug in single table inheritance where a chain of joins 2792 that included the same single inh entity more than once 2793 (normally this should raise an error) could, in some cases 2794 depending on what was being joined "from", implicitly alias the 2795 second case of the single inh entity, producing 2796 a query that "worked". But as this implicit aliasing is not 2797 intended in the case of single table inheritance, it didn't 2798 really "work" fully and was very misleading, since it wouldn't 2799 always appear. 2800 2801 .. seealso:: 2802 2803 :ref:`bug_3233` 2804 2805 2806 .. change:: 2807 :tags: bug, orm 2808 :tickets: 3222 2809 2810 The ON clause rendered when using :meth:`_query.Query.join`, 2811 :meth:`_query.Query.outerjoin`, or the standalone :func:`_orm.join` / 2812 :func:`_orm.outerjoin` functions to a single-inheritance subclass will 2813 now include the "single table criteria" in the ON clause even 2814 if the ON clause is otherwise hand-rolled; it is now added to the 2815 criteria using AND, the same way as if joining to a single-table 2816 target using relationship or similar. 2817 2818 This is sort of in-between feature and bug. 2819 2820 .. seealso:: 2821 2822 :ref:`migration_3222` 2823 2824 .. change:: 2825 :tags: feature, sql 2826 :tickets: 3184 2827 2828 The :class:`.UniqueConstraint` construct is now included when 2829 reflecting a :class:`_schema.Table` object, for databases where this 2830 is applicable. In order to achieve this 2831 with sufficient accuracy, MySQL and PostgreSQL now contain features 2832 that correct for the duplication of indexes and unique constraints 2833 when reflecting tables, indexes, and constraints. 2834 In the case of MySQL, there is not actually a "unique constraint" 2835 concept independent of a "unique index", so for this backend 2836 :class:`.UniqueConstraint` continues to remain non-present for a 2837 reflected :class:`_schema.Table`. For PostgreSQL, the query used to 2838 detect indexes against ``pg_index`` has been improved to check for 2839 the same construct in ``pg_constraint``, and the implicitly 2840 constructed unique index is not included with a 2841 reflected :class:`_schema.Table`. 2842 2843 In both cases, the :meth:`_reflection.Inspector.get_indexes` and the 2844 :meth:`_reflection.Inspector.get_unique_constraints` methods return both 2845 constructs individually, but include a new token 2846 ``duplicates_constraint`` in the case of PostgreSQL or 2847 ``duplicates_index`` in the case 2848 of MySQL to indicate when this condition is detected. 2849 Pull request courtesy Johannes Erdfelt. 2850 2851 .. seealso:: 2852 2853 :ref:`feature_3184` 2854 2855 .. change:: 2856 :tags: feature, postgresql 2857 2858 Added support for the FILTER keyword as applied to aggregate 2859 functions, supported by PostgreSQL 9.4. Pull request 2860 courtesy Ilja Everilä. 2861 2862 .. seealso:: 2863 2864 :ref:`feature_gh134` 2865 2866 .. change:: 2867 :tags: bug, sql, engine 2868 :tickets: 3215 2869 2870 Fixed bug where a "branched" connection, that is the kind you get 2871 when you call :meth:`_engine.Connection.connect`, would not share invalidation 2872 status with the parent. The architecture of branching has been tweaked 2873 a bit so that the branched connection defers to the parent for 2874 all invalidation status and operations. 2875 2876 .. change:: 2877 :tags: bug, sql, engine 2878 :tickets: 3190 2879 2880 Fixed bug where a "branched" connection, that is the kind you get 2881 when you call :meth:`_engine.Connection.connect`, would not share transaction 2882 status with the parent. The architecture of branching has been tweaked 2883 a bit so that the branched connection defers to the parent for 2884 all transactional status and operations. 2885 2886 .. change:: 2887 :tags: bug, orm, declarative 2888 :tickets: 2670 2889 2890 A relationship set up with :class:`.declared_attr` on 2891 a :class:`.AbstractConcreteBase` base class will now be configured 2892 on the abstract base mapping automatically, in addition to being 2893 set up on descendant concrete classes as usual. 2894 2895 .. seealso:: 2896 2897 :ref:`feature_3150` 2898 2899 .. change:: 2900 :tags: feature, orm, declarative 2901 :tickets: 3150 2902 2903 The :class:`.declared_attr` construct has newly improved 2904 behaviors and features in conjunction with declarative. The 2905 decorated function will now have access to the final column 2906 copies present on the local mixin when invoked, and will also 2907 be invoked exactly once for each mapped class, the returned result 2908 being memoized. A new modifier :attr:`.declared_attr.cascading` 2909 is added as well. 2910 2911 .. seealso:: 2912 2913 :ref:`feature_3150` 2914 2915 .. change:: 2916 :tags: feature, ext 2917 :tickets: 3210 2918 2919 The :mod:`sqlalchemy.ext.automap` extension will now set 2920 ``cascade="all, delete-orphan"`` automatically on a one-to-many 2921 relationship/backref where the foreign key is detected as containing 2922 one or more non-nullable columns. This argument is present in the 2923 keywords passed to :func:`.automap.generate_relationship` in this 2924 case and can still be overridden. Additionally, if the 2925 :class:`_schema.ForeignKeyConstraint` specifies ``ondelete="CASCADE"`` 2926 for a non-nullable or ``ondelete="SET NULL"`` for a nullable set 2927 of columns, the argument ``passive_deletes=True`` is also added to the 2928 relationship. Note that not all backends support reflection of 2929 ondelete, but backends that do include PostgreSQL and MySQL. 2930 2931 .. change:: 2932 :tags: feature, sql 2933 :tickets: 3206 2934 2935 Added new method :meth:`_expression.Select.with_statement_hint` and ORM 2936 method :meth:`_query.Query.with_statement_hint` to support statement-level 2937 hints that are not specific to a table. 2938 2939 .. change:: 2940 :tags: bug, sqlite 2941 :tickets: 3203 2942 2943 SQLite now supports reflection of unique constraints from 2944 temp tables; previously, this would fail with a TypeError. 2945 Pull request courtesy Johannes Erdfelt. 2946 2947 .. seealso:: 2948 2949 :ref:`change_3204` - changes regarding SQLite temporary 2950 table and view reflection. 2951 2952 .. change:: 2953 :tags: bug, sqlite 2954 :tickets: 3204 2955 2956 Added :meth:`_reflection.Inspector.get_temp_table_names` and 2957 :meth:`_reflection.Inspector.get_temp_view_names`; currently, only the 2958 SQLite and Oracle dialects support these methods. The return of 2959 temporary table and view names has been **removed** from SQLite and 2960 Oracle's version of :meth:`_reflection.Inspector.get_table_names` and 2961 :meth:`_reflection.Inspector.get_view_names`; other database backends cannot 2962 support this information (such as MySQL), and the scope of operation 2963 is different in that the tables can be local to a session and 2964 typically aren't supported in remote schemas. 2965 2966 .. seealso:: 2967 2968 :ref:`change_3204` 2969 2970 .. change:: 2971 :tags: feature, postgresql 2972 :tickets: 2891 2973 2974 Support has been added for reflection of materialized views 2975 and foreign tables, as well as support for materialized views 2976 within :meth:`_reflection.Inspector.get_view_names`, and a new method 2977 :meth:`.PGInspector.get_foreign_table_names` available on the 2978 PostgreSQL version of :class:`_reflection.Inspector`. Pull request courtesy 2979 Rodrigo Menezes. 2980 2981 .. seealso:: 2982 2983 :ref:`feature_2891` 2984 2985 2986 .. change:: 2987 :tags: feature, orm 2988 2989 Added new event handlers :meth:`.AttributeEvents.init_collection` 2990 and :meth:`.AttributeEvents.dispose_collection`, which track when 2991 a collection is first associated with an instance and when it is 2992 replaced. These handlers supersede the :meth:`.collection.linker` 2993 annotation. The old hook remains supported through an event adapter. 2994 2995 .. change:: 2996 :tags: bug, orm 2997 :tickets: 3148, 3188 2998 2999 A major rework to the behavior of expression labels, most 3000 specifically when used with ColumnProperty constructs with 3001 custom SQL expressions and in conjunction with the "order by 3002 labels" logic first introduced in 0.9. Fixes include that an 3003 ``order_by(Entity.some_col_prop)`` will now make use of "order by 3004 label" rules even if Entity has been subject to aliasing, 3005 either via inheritance rendering or via the use of the 3006 ``aliased()`` construct; rendering of the same column property 3007 multiple times with aliasing (e.g. ``query(Entity.some_prop, 3008 entity_alias.some_prop)``) will label each occurrence of the 3009 entity with a distinct label, and additionally "order by 3010 label" rules will work for both (e.g. 3011 ``order_by(Entity.some_prop, entity_alias.some_prop)``). 3012 Additional issues that could prevent the "order by label" 3013 logic from working in 0.9, most notably that the state of a 3014 Label could change such that "order by label" would stop 3015 working depending on how things were called, has been fixed. 3016 3017 .. seealso:: 3018 3019 :ref:`bug_3188` 3020 3021 3022 .. change:: 3023 :tags: bug, mysql 3024 :tickets: 3186 3025 3026 MySQL boolean symbols "true", "false" work again. 0.9's change 3027 in :ticket:`2682` disallowed the MySQL dialect from making use of the 3028 "true" and "false" symbols in the context of "IS" / "IS NOT", but 3029 MySQL supports this syntax even though it has no boolean type. 3030 MySQL remains "non native boolean", but the :func:`.true` 3031 and :func:`.false` symbols again produce the 3032 keywords "true" and "false", so that an expression like 3033 ``column.is_(true())`` again works on MySQL. 3034 3035 .. seealso:: 3036 3037 :ref:`bug_3186` 3038 3039 .. change:: 3040 :tags: changed, mssql 3041 :tickets: 3182 3042 3043 The hostname-based connection format for SQL Server when using 3044 pyodbc will no longer specify a default "driver name", and a warning 3045 is emitted if this is missing. The optimal driver name for SQL Server 3046 changes frequently and is per-platform, so hostname based connections 3047 need to specify this. DSN-based connections are preferred. 3048 3049 .. seealso:: 3050 3051 :ref:`change_3182` 3052 3053 .. change:: 3054 :tags: changed, sql 3055 3056 The :func:`_expression.column` and :func:`_expression.table` 3057 constructs are now importable from the "from sqlalchemy" namespace, 3058 just like every other Core construct. 3059 3060 .. change:: 3061 :tags: changed, sql 3062 :tickets: 2992 3063 3064 The implicit conversion of strings to :func:`_expression.text` constructs 3065 when passed to most builder methods of :func:`_expression.select` as 3066 well as :class:`_query.Query` now emits a warning with just the 3067 plain string sent. The textual conversion still proceeds normally, 3068 however. The only method that accepts a string without a warning 3069 are the "label reference" methods like order_by(), group_by(); 3070 these functions will now at compile time attempt to resolve a single 3071 string argument to a column or label expression present in the 3072 selectable; if none is located, the expression still renders, but 3073 you get the warning again. The rationale here is that the implicit 3074 conversion from string to text is more unexpected than not these days, 3075 and it is better that the user send more direction to the Core / ORM 3076 when passing a raw string as to what direction should be taken. 3077 Core/ORM tutorials have been updated to go more in depth as to how text 3078 is handled. 3079 3080 .. seealso:: 3081 3082 :ref:`migration_2992` 3083 3084 3085 .. change:: 3086 :tags: feature, engine 3087 :tickets: 3178 3088 3089 A new style of warning can be emitted which will "filter" up to 3090 N occurrences of a parameterized string. This allows parameterized 3091 warnings that can refer to their arguments to be delivered a fixed 3092 number of times until allowing Python warning filters to squelch them, 3093 and prevents memory from growing unbounded within Python's 3094 warning registries. 3095 3096 .. seealso:: 3097 3098 :ref:`feature_3178` 3099 3100 .. change:: 3101 :tags: feature, orm 3102 3103 The :class:`_query.Query` will raise an exception when :meth:`_query.Query.yield_per` 3104 is used with mappings or options where either 3105 subquery eager loading, or joined eager loading with collections, 3106 would take place. These loading strategies are 3107 not currently compatible with yield_per, so by raising this error, 3108 the method is safer to use. Eager loads can be disabled with 3109 the ``lazyload('*')`` option or :meth:`_query.Query.enable_eagerloads`. 3110 3111 .. seealso:: 3112 3113 :ref:`migration_yield_per_eager_loading` 3114 3115 .. change:: 3116 :tags: bug, orm 3117 :tickets: 3177 3118 3119 Changed the approach by which the "single inheritance criterion" 3120 is applied, when using :meth:`_query.Query.from_self`, or its common 3121 user :meth:`_query.Query.count`. The criteria to limit rows to those 3122 with a certain type is now indicated on the inside subquery, 3123 not the outside one, so that even if the "type" column is not 3124 available in the columns clause, we can filter on it on the "inner" 3125 query. 3126 3127 .. seealso:: 3128 3129 :ref:`migration_3177` 3130 3131 .. change:: 3132 :tags: changed, orm 3133 3134 The ``proc()`` callable passed to the ``create_row_processor()`` 3135 method of custom :class:`.Bundle` classes now accepts only a single 3136 "row" argument. 3137 3138 .. seealso:: 3139 3140 :ref:`bundle_api_change` 3141 3142 .. change:: 3143 :tags: changed, orm 3144 3145 Deprecated event hooks removed: ``populate_instance``, 3146 ``create_instance``, ``translate_row``, ``append_result`` 3147 3148 .. seealso:: 3149 3150 :ref:`migration_deprecated_orm_events` 3151 3152 .. change:: 3153 :tags: bug, orm 3154 :tickets: 3145 3155 3156 Made a small adjustment to the mechanics of lazy loading, 3157 such that it has less chance of interfering with a joinload() in the 3158 very rare circumstance that an object points to itself; in this 3159 scenario, the object refers to itself while loading its attributes 3160 which can cause a mixup between loaders. The use case of 3161 "object points to itself" is not fully supported, but the fix also 3162 removes some overhead so for now is part of testing. 3163 3164 .. change:: 3165 :tags: feature, orm 3166 :tickets: 3176 3167 3168 A new implementation for :class:`.KeyedTuple` used by the 3169 :class:`_query.Query` object offers dramatic speed improvements when 3170 fetching large numbers of column-oriented rows. 3171 3172 .. seealso:: 3173 3174 :ref:`feature_3176` 3175 3176 .. change:: 3177 :tags: feature, orm 3178 :tickets: 3008 3179 3180 The behavior of :paramref:`_orm.joinedload.innerjoin` as well as 3181 :paramref:`_orm.relationship.innerjoin` is now to use "nested" 3182 inner joins, that is, right-nested, as the default behavior when an 3183 inner join joined eager load is chained to an outer join eager load. 3184 3185 .. seealso:: 3186 3187 :ref:`migration_3008` 3188 3189 .. change:: 3190 :tags: bug, orm 3191 :tickets: 3171 3192 3193 The "resurrect" ORM event has been removed. This event hook had 3194 no purpose since the old "mutable attribute" system was removed 3195 in 0.8. 3196 3197 .. change:: 3198 :tags: bug, sql 3199 :tickets: 3169 3200 3201 Using :meth:`_expression.Insert.from_select` now implies ``inline=True`` 3202 on :func:`_expression.insert`. This helps to fix a bug where an 3203 INSERT...FROM SELECT construct would inadvertently be compiled 3204 as "implicit returning" on supporting backends, which would 3205 cause breakage in the case of an INSERT that inserts zero rows 3206 (as implicit returning expects a row), as well as arbitrary 3207 return data in the case of an INSERT that inserts multiple 3208 rows (e.g. only the first row of many). 3209 A similar change is also applied to an INSERT..VALUES 3210 with multiple parameter sets; implicit RETURNING will no longer emit 3211 for this statement either. As both of these constructs deal 3212 with variable numbers of rows, the 3213 :attr:`_engine.ResultProxy.inserted_primary_key` accessor does not 3214 apply. Previously, there was a documentation note that one 3215 may prefer ``inline=True`` with INSERT..FROM SELECT as some databases 3216 don't support returning and therefore can't do "implicit" returning, 3217 but there's no reason an INSERT...FROM SELECT needs implicit returning 3218 in any case. Regular explicit :meth:`_expression.Insert.returning` should 3219 be used to return variable numbers of result rows if inserted 3220 data is needed. 3221 3222 .. change:: 3223 :tags: bug, orm 3224 :tickets: 3167 3225 3226 Fixed bug where attribute "set" events or columns with 3227 ``@validates`` would have events triggered within the flush process, 3228 when those columns were the targets of a "fetch and populate" 3229 operation, such as an autoincremented primary key, a Python side 3230 default, or a server-side default "eagerly" fetched via RETURNING. 3231 3232 .. change:: 3233 :tags: feature, oracle 3234 3235 Added support for the Oracle table option ON COMMIT. 3236 3237 .. change:: 3238 :tags: feature, postgresql 3239 :tickets: 2051 3240 3241 Added support for PG table options TABLESPACE, ON COMMIT, 3242 WITH(OUT) OIDS, and INHERITS, when rendering DDL via 3243 the :class:`_schema.Table` construct. Pull request courtesy 3244 malikdiarra. 3245 3246 .. seealso:: 3247 3248 :ref:`postgresql_table_options` 3249 3250 .. change:: 3251 :tags: bug, orm, py3k 3252 3253 The :class:`.IdentityMap` exposed from :attr:`.Session.identity_map` 3254 now returns lists for ``items()`` and ``values()`` in Py3K. 3255 Early porting to Py3K here had these returning iterators, when 3256 they technically should be "iterable views"..for now, lists are OK. 3257 3258 .. change:: 3259 :tags: orm, feature 3260 3261 UPDATE statements can now be batched within an ORM flush 3262 into more performant executemany() call, similarly to how INSERT 3263 statements can be batched; this will be invoked within flush 3264 to the degree that subsequent UPDATE statements for the 3265 same mapping and table involve the identical columns within the 3266 VALUES clause, that no SET-level SQL expressions 3267 are embedded, and that the versioning requirements for the mapping 3268 are compatible with the backend dialect's ability to return 3269 a correct rowcount for an executemany operation. 3270 3271 .. change:: 3272 :tags: engine, bug 3273 :tickets: 3163 3274 3275 Removing (or adding) an event listener at the same time that the event 3276 is being run itself, either from inside the listener or from a 3277 concurrent thread, now raises a RuntimeError, as the collection used is 3278 now an instance of ``collections.deque()`` and does not support changes 3279 while being iterated. Previously, a plain Python list was used where 3280 removal from inside the event itself would produce silent failures. 3281 3282 .. change:: 3283 :tags: orm, feature 3284 :tickets: 2963 3285 3286 The ``info`` parameter has been added to the constructor for 3287 :class:`.SynonymProperty` and :class:`.ComparableProperty`. 3288 3289 .. change:: 3290 :tags: sql, feature 3291 :tickets: 2963 3292 3293 The ``info`` parameter has been added as a constructor argument 3294 to all schema constructs including :class:`_schema.MetaData`, 3295 :class:`.Index`, :class:`_schema.ForeignKey`, :class:`_schema.ForeignKeyConstraint`, 3296 :class:`.UniqueConstraint`, :class:`.PrimaryKeyConstraint`, 3297 :class:`.CheckConstraint`. 3298 3299 .. change:: 3300 :tags: orm, feature 3301 :tickets: 2971 3302 3303 The :attr:`.InspectionAttr.info` collection is now moved down to 3304 :class:`.InspectionAttr`, where in addition to being available 3305 on all :class:`.MapperProperty` objects, it is also now available 3306 on hybrid properties, association proxies, when accessed via 3307 :attr:`_orm.Mapper.all_orm_descriptors`. 3308 3309 .. change:: 3310 :tags: sql, feature 3311 :tickets: 3027 3312 3313 The :paramref:`_schema.Table.autoload_with` flag now implies that 3314 :paramref:`_schema.Table.autoload` should be ``True``. Pull request 3315 courtesy Malik Diarra. 3316 3317 .. change:: 3318 :tags: postgresql, feature 3319 3320 Added new method :meth:`.PGInspector.get_enums`, when using the 3321 inspector for PostgreSQL will provide a list of ENUM types. 3322 Pull request courtesy Ilya Pekelny. 3323 3324 .. change:: 3325 :tags: mysql, bug 3326 3327 The MySQL dialect will now disable :meth:`_events.ConnectionEvents.handle_error` 3328 events from firing for those statements which it uses internally 3329 to detect if a table exists or not. This is achieved using an 3330 execution option ``skip_user_error_events`` that disables the handle 3331 error event for the scope of that execution. In this way, user code 3332 that rewrites exceptions doesn't need to worry about the MySQL 3333 dialect or other dialects that occasionally need to catch 3334 SQLAlchemy specific exceptions. 3335 3336 .. change:: 3337 :tags: mysql, bug 3338 :tickets: 2515 3339 3340 Changed the default value of "raise_on_warnings" to False for 3341 MySQLconnector. This was set at True for some reason. The "buffered" 3342 flag unfortunately must stay at True as MySQLconnector does not allow 3343 a cursor to be closed unless all results are fully fetched. 3344 3345 .. change:: 3346 :tags: bug, orm 3347 :tickets: 3117 3348 3349 The "evaluator" for query.update()/delete() won't work with multi-table 3350 updates, and needs to be set to `synchronize_session=False` or 3351 `synchronize_session='fetch'`; this now raises an exception, with a 3352 message to change the synchronize setting. 3353 This is upgraded from a warning emitted as of 0.9.7. 3354 3355 .. change:: 3356 :tags: removed 3357 3358 The Drizzle dialect has been removed from the Core; it is now 3359 available as `sqlalchemy-drizzle <https://bitbucket.org/zzzeek/sqlalchemy-drizzle>`_, 3360 an independent, third party dialect. The dialect is still based 3361 almost entirely off of the MySQL dialect present in SQLAlchemy. 3362 3363 .. seealso:: 3364 3365 :ref:`change_2984` 3366 3367 .. change:: 3368 :tags: enhancement, orm 3369 :tickets: 3061 3370 3371 Adjustment to attribute mechanics concerning when a value is 3372 implicitly initialized to None via first access; this action, 3373 which has always resulted in a population of the attribute, 3374 no longer does so; the None value is returned but the underlying 3375 attribute receives no set event. This is consistent with how collections 3376 work and allows attribute mechanics to behave more consistently; 3377 in particular, getting an attribute with no value does not squash 3378 the event that should proceed if the value is actually set to None. 3379 3380 .. seealso:: 3381 3382 :ref:`migration_3061` 3383 3384 .. change:: 3385 :tags: feature, sql 3386 :tickets: 3034 3387 3388 The :meth:`_expression.Select.limit` and :meth:`_expression.Select.offset` methods 3389 now accept any SQL expression, in addition to integer values, as 3390 arguments. Typically this is used to allow a bound parameter to be 3391 passed, which can be substituted with a value later thus allowing 3392 Python-side caching of the SQL query. The implementation 3393 here is fully backwards compatible with existing third party dialects, 3394 however those dialects which implement special LIMIT/OFFSET systems 3395 will need modification in order to take advantage of the new 3396 capabilities. Limit and offset also support "literal_binds" mode, 3397 where bound parameters are rendered inline as strings based on 3398 a compile-time option. 3399 Work on this feature is courtesy of Dobes Vandermeer. 3400 3401 3402 .. seealso:: 3403 3404 :ref:`feature_3034`. 3405