diff options
| author | Claude Paroz <claude@2xlibre.net> | 2024-09-17 08:56:44 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-17 08:56:44 +0200 |
| commit | 8b9a2bf34e132ccf0ab0a074440dc55f90c76598 (patch) | |
| tree | 7dc0cb7ba9c37deea0e0d6b1fe4348299392c848 | |
| parent | c0128e3a81cfb07238324b185958a88631e94963 (diff) | |
Fixed #35762 -- Avoided unneeded quote_name() calls in SQLite introspection.
Double-quoting string literals is deprecated in recent SQLite versions.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
| -rw-r--r-- | django/db/backends/sqlite3/introspection.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/django/db/backends/sqlite3/introspection.py b/django/db/backends/sqlite3/introspection.py index 79aa1934c0..a21bc22413 100644 --- a/django/db/backends/sqlite3/introspection.py +++ b/django/db/backends/sqlite3/introspection.py @@ -316,8 +316,8 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): # Find inline check constraints. try: table_schema = cursor.execute( - "SELECT sql FROM sqlite_master WHERE type='table' and name=%s" - % (self.connection.ops.quote_name(table_name),) + "SELECT sql FROM sqlite_master WHERE type='table' and name=%s", + [table_name], ).fetchone()[0] except TypeError: # table_name is a view. @@ -337,8 +337,8 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): # columns. Discard last 2 columns if there. number, index, unique = row[:3] cursor.execute( - "SELECT sql FROM sqlite_master " - "WHERE type='index' AND name=%s" % self.connection.ops.quote_name(index) + "SELECT sql FROM sqlite_master WHERE type='index' AND name=%s", + [index], ) # There's at most one row. (sql,) = cursor.fetchone() or (None,) |
