Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #7407 -- in Oracle, made sure table names are properly quoted w…

…hen resetting sequences. Thanks, erny.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7833 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 3b6487130ae2b8f3bbd4c18a44403ccdedd24f05 1 parent 0650bab
@ikelly ikelly authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 django/db/backends/oracle/base.py
View
11 django/db/backends/oracle/base.py
@@ -146,11 +146,11 @@ def sql_flush(self, style, tables, sequences):
# Since we've just deleted all the rows, running our sequence
# ALTER code will reset the sequence to 0.
for sequence_info in sequences:
- table_name = sequence_info['table']
- seq_name = get_sequence_name(table_name)
+ sequence_name = get_sequence_name(sequence_info['table'])
+ table_name = self.quote_name(sequence_info['table'])
column_name = self.quote_name(sequence_info['column'] or 'id')
- query = _get_sequence_reset_sql() % {'sequence': seq_name,
- 'table': self.quote_name(table_name),
+ query = _get_sequence_reset_sql() % {'sequence': sequence_name,
+ 'table': table_name,
'column': column_name}
sql.append(query)
return sql
@@ -174,9 +174,10 @@ def sequence_reset_sql(self, style, model_list):
for f in model._meta.many_to_many:
table_name = self.quote_name(f.m2m_db_table())
sequence_name = get_sequence_name(f.m2m_db_table())
+ column_name = self.quote_name('id')
output.append(query % {'sequence': sequence_name,
'table': table_name,
- 'column': self.quote_name('id')})
+ 'column': column_name})
return output
def start_transaction_sql(self):
Please sign in to comment.
Something went wrong with that request. Please try again.