#31019: The database backend specific checks could be bypassed when using
multiple
databases with one empty default database.
-------------------------------------+-------------------------------------
Reporter: Shipeng Feng | Owner: nobody
Type: Bug | Status: new
Component: Core (System | Version: master
checks) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Shipeng Feng:
Old description:
> Here is the settings:
>
> {{{
> #!python
> 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 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.
New description:
Here is the settings:
{{{
#!python
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.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/31019#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.c46104adcf7ddaa56822547999c6708b%40djangoproject.com.