{{{#!sql
CREATE USER foo
IDENTIFIED BY 2fXHVnA9KRH4uTSSvV3fVDel4kyVum
DEFAULT TABLESPACE foo_tbls_test
TEMPORARY TABLESPACE foo_tbls_temp_test
QUOTA UNLIMITED ON foo_tbls_test;
}}}
is incorrect (`ORA-00922: missing or invalid option`) it should be:
{{{#!sql
CREATE USER foo
IDENTIFIED BY "2fXHVnA9KRH4uTSSvV3fVDel4kyVum"
DEFAULT TABLESPACE foo_tbls_test
TEMPORARY TABLESPACE foo_tbls_temp_test
QUOTA UNLIMITED ON foo_tbls_test;
}}}
All versions are vulnerable ie 1.8.16, 1.9.11, 1.10.3 and master.
--
Ticket URL: <https://code.djangoproject.com/ticket/27420>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* severity: Normal => Release blocker
* version: master => 1.8
* needs_docs: 0 => 1
* has_patch: 0 => 1
* stage: Unreviewed => Accepted
Comment:
[https://github.com/django/django/pull/7463 PR]. This might explain some
of the failures that have popped up on Jenkins. Release notes for 1.10.4,
1.9.12, and 1.8.17 are also needed.
--
Ticket URL: <https://code.djangoproject.com/ticket/27420#comment:1>
* needs_docs: 1 => 0
Comment:
I added release notes for 1.8.17/1.9.12/1.10.4.
--
Ticket URL: <https://code.djangoproject.com/ticket/27420#comment:2>
Old description:
> Oracle DB test user password can not start with digits because quotation
> marks are missing in SQL. For example:
>
> {{{#!sql
> CREATE USER foo
> IDENTIFIED BY 2fXHVnA9KRH4uTSSvV3fVDel4kyVum
> DEFAULT TABLESPACE foo_tbls_test
> TEMPORARY TABLESPACE foo_tbls_temp_test
> QUOTA UNLIMITED ON foo_tbls_test;
> }}}
>
> is incorrect (`ORA-00922: missing or invalid option`) it should be:
>
> {{{#!sql
> CREATE USER foo
> IDENTIFIED BY "2fXHVnA9KRH4uTSSvV3fVDel4kyVum"
> DEFAULT TABLESPACE foo_tbls_test
> TEMPORARY TABLESPACE foo_tbls_temp_test
> QUOTA UNLIMITED ON foo_tbls_test;
> }}}
>
> All versions are vulnerable ie 1.8.16, 1.9.11, 1.10.3 and master.
New description:
Oracle DB test user password cannot start with digits because quotation
marks are missing in SQL. For example:
{{{#!sql
CREATE USER foo
IDENTIFIED BY 2fXHVnA9KRH4uTSSvV3fVDel4kyVum
DEFAULT TABLESPACE foo_tbls_test
TEMPORARY TABLESPACE foo_tbls_temp_test
QUOTA UNLIMITED ON foo_tbls_test;
}}}
is incorrect (`ORA-00922: missing or invalid option`) it should be:
{{{#!sql
CREATE USER foo
IDENTIFIED BY "2fXHVnA9KRH4uTSSvV3fVDel4kyVum"
DEFAULT TABLESPACE foo_tbls_test
TEMPORARY TABLESPACE foo_tbls_temp_test
QUOTA UNLIMITED ON foo_tbls_test;
}}}
All versions are vulnerable ie 1.8.16, 1.9.11, 1.10.3 and master.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/27420#comment:3>
Comment (by Shai Berger):
Replying to [comment:1 Tim Graham]:
> This might explain some of the failures that have popped up on Jenkins.
I believe they are actually unrelated, the error was about password
expiry.
--
Ticket URL: <https://code.djangoproject.com/ticket/27420#comment:4>
* cc: marti@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/27420#comment:5>
Comment (by Marti):
I was really puzzled about this bug because it should have a 10/62 chance
of occurring, but I had ran dozens of tests using patched Django and never
seen such a failure.
I investigated this further and the consequences are uglier than I
expected. :(
If the test user creation fails -- with whatever exception -- and
`--keepdb` is specified, then `_create_test_db` simply returns out of the
function without switching to the test user. This means that tests are
executed using the main connection parameters instead of the test user.
{{{#!python
def _create_test_db(self, verbosity=1, autoclobber=False,
keepdb=False):
...
try:
self._create_test_user(cursor, parameters, verbosity,
keepdb)
except Exception as e:
# If we want to keep the db, then we want to also keep the
user.
if keepdb:
return
...
self._maindb_connection.close() # done with main user -- test
user and tablespaces created
self._switch_to_test_user(parameters)
return self.connection.settings_dict['NAME']
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27420#comment:6>
Comment (by felixxm):
I had bad luck and my tests failed just few hours after Django upgrade.
The simplest (and quickest) solution for now is to set `PASSWORD`
parameter for `TEST` database (without number or special character at the
beginning).
--
Ticket URL: <https://code.djangoproject.com/ticket/27420#comment:7>
Comment (by felixxm):
I agree that this little hack is currently unnecessary and can cause
unexpected behavior. It should be removed.
{{{#!python
--- a/django/db/backends/oracle/creation.py
+++ b/django/db/backends/oracle/creation.py
@@ -77,9 +77,6 @@ class DatabaseCreation(BaseDatabaseCreation):
try:
self._create_test_user(cursor, parameters, verbosity,
keepdb)
except Exception as e:
- # If we want to keep the db, then we want to also keep
the user.
- if keepdb:
- return
sys.stderr.write("Got an error creating the test user:
%s\n" % e)
if not autoclobber:
confirm = input(
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27420#comment:8>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"c4b04e1598c4325454c808183dce17b284ed9e28" c4b04e15]:
{{{
#!CommitTicketReference repository=""
revision="c4b04e1598c4325454c808183dce17b284ed9e28"
Fixed #27420 -- Quoted the Oracle test user password in queries.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27420#comment:9>
Comment (by Tim Graham <timograham@…>):
In [changeset:"dacef9137f43fff88b527d1c02f6fe6a81e975aa" dacef913]:
{{{
#!CommitTicketReference repository=""
revision="dacef9137f43fff88b527d1c02f6fe6a81e975aa"
Refs #27420 -- Removed exception hiding in Oracle test user creation
during --keepdb.
If the test user creation fails here, _create_test_db() would return
without
switching to the test user which caused the tests to run using the main
connection instead of the test user.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27420#comment:10>
Comment (by Tim Graham <timograham@…>):
In [changeset:"a3fa2c463122974460adcab91defb479841de745" a3fa2c4]:
{{{
#!CommitTicketReference repository=""
revision="a3fa2c463122974460adcab91defb479841de745"
[1.9.x] Fixed #27420 -- Quoted the Oracle test user password in queries.
Backport of c4b04e1598c4325454c808183dce17b284ed9e28 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27420#comment:11>
Comment (by Tim Graham <timograham@…>):
In [changeset:"32f50999cd4ccf4e5667f20df3d89421c599a9af" 32f50999]:
{{{
#!CommitTicketReference repository=""
revision="32f50999cd4ccf4e5667f20df3d89421c599a9af"
[1.8.x] Fixed #27420 -- Quoted the Oracle test user password in queries.
Backport of c4b04e1598c4325454c808183dce17b284ed9e28 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27420#comment:13>
Comment (by Tim Graham <timograham@…>):
In [changeset:"bc74bc1f35e33b0f37cea76aae81840e067d7802" bc74bc1f]:
{{{
#!CommitTicketReference repository=""
revision="bc74bc1f35e33b0f37cea76aae81840e067d7802"
[1.10.x] Fixed #27420 -- Quoted the Oracle test user password in queries.
Backport of c4b04e1598c4325454c808183dce17b284ed9e28 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27420#comment:12>