From: Mike Bayer Date: Sun, 29 Dec 2019 07:09:04 +0000 (-0500) Subject: De-implement non-working / testing copy_internals from dml X-Git-Tag: rel_1_4_0b1~582 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b59f87e6185b26e286147316c20022df4d729f77;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git De-implement non-working / testing copy_internals from dml The DML constructs will need to have traverse_internals symbols set up; as there are currently non-working /non-used _copy_internals methods, just remove these for now as they are unlikely to be working correctly in any case. Additionally remove an errant "return" statement noted on the same issue from the MySQL dialect. Fixes: #5060 Change-Id: I289005af04192e4c755d53244b1ea0711c266c6c --- diff --git a/lib/sqlalchemy/dialects/mysql/base.py b/lib/sqlalchemy/dialects/mysql/base.py index 81e80fdbc4..3dff145457 100644 --- a/lib/sqlalchemy/dialects/mysql/base.py +++ b/lib/sqlalchemy/dialects/mysql/base.py @@ -2969,8 +2969,6 @@ class MySQLDialect(default.DefaultDialect): raise exc.NoSuchTableError(full_name) return row[1].strip() - return sql - def _describe_table(self, connection, table, charset=None, full_name=None): """Run DESCRIBE for a ``Table`` and return processed rows.""" diff --git a/lib/sqlalchemy/sql/dml.py b/lib/sqlalchemy/sql/dml.py index 66e92a63cc..8b62e57e13 100644 --- a/lib/sqlalchemy/sql/dml.py +++ b/lib/sqlalchemy/sql/dml.py @@ -15,7 +15,6 @@ from .base import _from_objects from .base import _generative from .base import DialectKWArgs from .base import Executable -from .elements import _clone from .elements import and_ from .elements import ClauseElement from .elements import Null @@ -204,6 +203,9 @@ class UpdateBase( self._hints = self._hints.union({(selectable, dialect_name): text}) + def _copy_internals(self, **kw): + raise NotImplementedError() + class ValuesBase(UpdateBase): """Supplies support for :meth:`.ValuesBase.values` to @@ -623,12 +625,6 @@ class Insert(ValuesBase): self.include_insert_from_select_defaults = include_defaults self.select = coercions.expect(roles.DMLSelectRole, select) - def _copy_internals(self, clone=_clone, **kw): - # TODO: coverage - self.parameters = self.parameters.copy() - if self.select is not None: - self.select = _clone(self.select) - class Update(ValuesBase): """Represent an Update construct. @@ -785,11 +781,6 @@ class Update(ValuesBase): else: return () - def _copy_internals(self, clone=_clone, **kw): - # TODO: coverage - self._whereclause = clone(self._whereclause, **kw) - self.parameters = self.parameters.copy() - @_generative def where(self, whereclause): """return a new update() construct with the given expression added to @@ -921,7 +912,3 @@ class Delete(UpdateBase): seen.update(item._cloned_set) return froms - - def _copy_internals(self, clone=_clone, **kw): - # TODO: coverage - self._whereclause = clone(self._whereclause, **kw)