mirror of
https://github.com/django/django.git
synced 2025-07-04 17:59:13 +00:00
[boulder-oracle-sprint] add trace for dbname
git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@3998 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
6c0c0bd331
commit
2651cf0c7c
@ -81,11 +81,13 @@ def destroy_test_db(settings, connection, backend, old_database_name, verbosity=
|
||||
connection.close()
|
||||
|
||||
def _create_test_db(cursor, dbname, verbosity):
|
||||
if verbosity >= 2:
|
||||
print "_create_test_db(): dbname = %s" % dbname
|
||||
statements = [
|
||||
"""create tablespace %(user)s
|
||||
datafile '%(user)s.dat' size 10M autoextend on next 10M maxsize 20M
|
||||
"""create tablespace "%(user)s"
|
||||
datafile '%(user)s.dbf' size 10M autoextend on next 10M maxsize 20M
|
||||
""",
|
||||
"""create temporary tablespace %(user)s_temp
|
||||
"""create temporary tablespace "%(user)s_temp"
|
||||
tempfile '%(user)s_temp.dat' size 10M autoextend on next 10M maxsize 20M
|
||||
""",
|
||||
"""create user %(user)s
|
||||
@ -99,6 +101,8 @@ def _create_test_db(cursor, dbname, verbosity):
|
||||
_execute_statements(cursor, statements, dbname, verbosity)
|
||||
|
||||
def _destroy_test_db(cursor, dbname, verbosity):
|
||||
if verbosity >= 2:
|
||||
print "_destroy_test_db(): dbname=%s" % dbname
|
||||
statements = [
|
||||
"""drop user %(user)s cascade""",
|
||||
"""drop tablespace %(user)s including contents and datafiles cascade constraints""",
|
||||
@ -109,7 +113,7 @@ def _destroy_test_db(cursor, dbname, verbosity):
|
||||
def _execute_statements(cursor, statements, dbname, verbosity):
|
||||
for template in statements:
|
||||
stmt = template % {'user': dbname, 'password': "Im a lumberjack"}
|
||||
if verbosity >= 1:
|
||||
if verbosity >= 2:
|
||||
print stmt
|
||||
try:
|
||||
cursor.execute(stmt)
|
||||
|
Loading…
x
Reference in New Issue
Block a user