Opened 6 years ago
Last modified 6 years ago
#31019 closed Bug
The database backend specific checks could be bypassed when using multiple databases with one empty default database. — at Version 2
| Reported by: | Shipeng Feng | Owned by: | nobody |
|---|---|---|---|
| Component: | Core (System checks) | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
Here is the settings:
DATABASES = { 'default': {}, 'users': { 'NAME': 'user_data', 'ENGINE': 'django.db.backends.mysql', 'USER': 'mysql_user', 'PASSWORD': 'superS3cret' }, }
Here is the related source code: https://github.com/django/django/blob/f97a6123c07de5099fdf8b7d00ef7d20ed354e07/django/db/models/fields/__init__.py#L340
We only run checks for the first db, and the behavior of the first db is undetermined (the first entry of a dictionary),
if the first db is default, then we would only run dummy backend checks, mysql checks are bypassed.
Change History (2)
comment:1 by , 6 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 6 years ago
| Description: | modified (diff) |
|---|
Note:
See TracTickets
for help on using tickets.