mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +00:00
boulder-oracle-sprint: Return DebugCursorWrapper if DEBUG == True like other
backends. Return None rather than empty string for get_transaction_start_sql to conform with other similar methods. git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@4776 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
2c300b1dc6
commit
4a4417787b
@ -1653,6 +1653,7 @@ def execute_from_command_line(action_mapping=DEFAULT_ACTION_MAPPING, argv=None):
|
|||||||
parser.print_usage_and_exit()
|
parser.print_usage_and_exit()
|
||||||
if action not in NO_SQL_TRANSACTION:
|
if action not in NO_SQL_TRANSACTION:
|
||||||
from django.db import backend
|
from django.db import backend
|
||||||
|
if backend.get_start_transaction_sql():
|
||||||
print style.SQL_KEYWORD(backend.get_start_transaction_sql())
|
print style.SQL_KEYWORD(backend.get_start_transaction_sql())
|
||||||
for mod in mod_list:
|
for mod in mod_list:
|
||||||
if action == 'reset':
|
if action == 'reset':
|
||||||
|
@ -49,18 +49,17 @@ class DatabaseWrapper(local):
|
|||||||
# set oracle date to ansi date format
|
# set oracle date to ansi date format
|
||||||
cursor.execute("ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD'")
|
cursor.execute("ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD'")
|
||||||
cursor.execute("ALTER SESSION SET NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS.FF'")
|
cursor.execute("ALTER SESSION SET NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS.FF'")
|
||||||
|
if settings.DEBUG:
|
||||||
|
return util.CursorDebugWrapper(cursor, self)
|
||||||
return cursor
|
return cursor
|
||||||
|
|
||||||
def _commit(self):
|
def _commit(self):
|
||||||
if self.connection is not None:
|
if self.connection is not None:
|
||||||
self.connection.commit()
|
return self.connection.commit()
|
||||||
|
|
||||||
def _rollback(self):
|
def _rollback(self):
|
||||||
if self.connection is not None:
|
if self.connection is not None:
|
||||||
try:
|
return self.connection.rollback()
|
||||||
self.connection.rollback()
|
|
||||||
except Database.NotSupportedError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
if self.connection is not None:
|
if self.connection is not None:
|
||||||
@ -169,7 +168,7 @@ def get_max_name_length():
|
|||||||
return 30
|
return 30
|
||||||
|
|
||||||
def get_start_transaction_sql():
|
def get_start_transaction_sql():
|
||||||
return ""
|
return None
|
||||||
|
|
||||||
def get_autoinc_sql(table):
|
def get_autoinc_sql(table):
|
||||||
# To simulate auto-incrementing primary keys in Oracle, we have to
|
# To simulate auto-incrementing primary keys in Oracle, we have to
|
||||||
|
Loading…
x
Reference in New Issue
Block a user