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,7 +1653,8 @@ def execute_from_command_line(action_mapping=DEFAULT_ACTION_MAPPING, argv=None):
|
||||
parser.print_usage_and_exit()
|
||||
if action not in NO_SQL_TRANSACTION:
|
||||
from django.db import backend
|
||||
print style.SQL_KEYWORD(backend.get_start_transaction_sql())
|
||||
if backend.get_start_transaction_sql():
|
||||
print style.SQL_KEYWORD(backend.get_start_transaction_sql())
|
||||
for mod in mod_list:
|
||||
if action == 'reset':
|
||||
output = action_mapping[action](mod, options.interactive)
|
||||
|
@ -49,18 +49,17 @@ class DatabaseWrapper(local):
|
||||
# set oracle date to ansi date format
|
||||
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'")
|
||||
if settings.DEBUG:
|
||||
return util.CursorDebugWrapper(cursor, self)
|
||||
return cursor
|
||||
|
||||
def _commit(self):
|
||||
if self.connection is not None:
|
||||
self.connection.commit()
|
||||
return self.connection.commit()
|
||||
|
||||
def _rollback(self):
|
||||
if self.connection is not None:
|
||||
try:
|
||||
self.connection.rollback()
|
||||
except Database.NotSupportedError:
|
||||
pass
|
||||
return self.connection.rollback()
|
||||
|
||||
def close(self):
|
||||
if self.connection is not None:
|
||||
@ -169,7 +168,7 @@ def get_max_name_length():
|
||||
return 30
|
||||
|
||||
def get_start_transaction_sql():
|
||||
return ""
|
||||
return None
|
||||
|
||||
def get_autoinc_sql(table):
|
||||
# To simulate auto-incrementing primary keys in Oracle, we have to
|
||||
|
Loading…
x
Reference in New Issue
Block a user