summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/requirements.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2021-01-30 16:57:50 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2021-01-30 23:12:31 -0500
commit2db1eccb382c3be2c03e5be80c6f68e41a8545a2 (patch)
tree531462b017eb25d5ba2eff1672f0a0ef572c9515 /lib/sqlalchemy/testing/requirements.py
parent532026f97f402d6673cd9746f1a7daee99327a68 (diff)
downloadsqlalchemy-2db1eccb382c3be2c03e5be80c6f68e41a8545a2.tar.gz
set identifier length for MySQL constraints to 64
The rule to limit index names to 64 also applies to all DDL names, such as those coming from naming conventions. Add another limiting variable for constraint names and create test cases against all constraint types. Additionally, codified in the test suite MySQL's lack of support for naming of a FOREIGN KEY constraint after the name was given, which apparently assigns the name to an associated KEY but not the constraint itself, until MySQL 8 and MariaDB 10.5 which appear to have resolved the behavior. However it's not clear how Alembic hasn't had issues reported with this so far. Fixed long-lived bug in MySQL dialect where the maximum identifier length of 255 was too long for names of all types of constraints, not just indexes, all of which have a size limit of 64. As metadata naming conventions can create too-long names in this area, apply the limit to the identifier generator within the DDL compiler. Fixes: #5898 Change-Id: I79549474845dc29922275cf13321c07598dcea08
Diffstat (limited to 'lib/sqlalchemy/testing/requirements.py')
-rw-r--r--lib/sqlalchemy/testing/requirements.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/requirements.py b/lib/sqlalchemy/testing/requirements.py
index e5dda7d3e..f5286c85d 100644
--- a/lib/sqlalchemy/testing/requirements.py
+++ b/lib/sqlalchemy/testing/requirements.py
@@ -460,6 +460,18 @@ class SuiteRequirements(Requirements):
return exclusions.closed()
@property
+ def foreign_key_constraint_name_reflection(self):
+ """Target supports refleciton of FOREIGN KEY constraints and
+ will return the name of the constraint that was used in the
+ "CONSTRANT <name> FOREIGN KEY" DDL.
+
+ MySQL prior to version 8 and MariaDB prior to version 10.5
+ don't support this.
+
+ """
+ return exclusions.closed()
+
+ @property
def implicit_default_schema(self):
"""target system has a strong concept of 'default' schema that can
be referred to implicitly.