summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoulder Sprinters <boulder-sprinters@djangoproject.com>2007-03-20 20:11:04 +0000
committerBoulder Sprinters <boulder-sprinters@djangoproject.com>2007-03-20 20:11:04 +0000
commitc62feba2a34dfc3a5fc54d2c8aab77920a633a63 (patch)
treed6ccf3b8ca4502a6d6a1d6b8dcd96133ba55b215
parent815837c8af6cb917dabbb3638b2ccf182263866d (diff)
boulder-oracle-sprint: Call each backend for its version of "BEGIN;" to start
a transaction. Previously, Oracle saw the output of "./manage.py sqlall" as starting a PL/SQL function definition. git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@4758 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/core/management.py4
-rw-r--r--django/db/backends/ado_mssql/base.py3
-rw-r--r--django/db/backends/mysql/base.py3
-rw-r--r--django/db/backends/oracle/base.py3
-rw-r--r--django/db/backends/postgresql/base.py3
-rw-r--r--django/db/backends/postgresql_psycopg2/base.py3
-rw-r--r--django/db/backends/sqlite3/base.py3
7 files changed, 21 insertions, 1 deletions
diff --git a/django/core/management.py b/django/core/management.py
index 01739f6e1f..c2f56eb676 100644
--- a/django/core/management.py
+++ b/django/core/management.py
@@ -1542,6 +1542,8 @@ def print_error(msg, cmd):
sys.exit(1)
def execute_from_command_line(action_mapping=DEFAULT_ACTION_MAPPING, argv=None):
+ from django.db import backend
+
# Use sys.argv if we've not passed in a custom argv
if argv is None:
argv = sys.argv
@@ -1652,7 +1654,7 @@ def execute_from_command_line(action_mapping=DEFAULT_ACTION_MAPPING, argv=None):
if not mod_list:
parser.print_usage_and_exit()
if action not in NO_SQL_TRANSACTION:
- print style.SQL_KEYWORD("BEGIN;")
+ print style.SQL_KEYWORD(backend.get_start_transaction_sql())
for mod in mod_list:
if action == 'reset':
output = action_mapping[action](mod, options.interactive)
diff --git a/django/db/backends/ado_mssql/base.py b/django/db/backends/ado_mssql/base.py
index 220331480b..6c24912e22 100644
--- a/django/db/backends/ado_mssql/base.py
+++ b/django/db/backends/ado_mssql/base.py
@@ -149,6 +149,9 @@ def get_pk_default_value():
def get_max_name_length():
return None
+def get_start_transaction_sql():
+ return "BEGIN;"
+
def get_autoinc_sql(table):
return None
diff --git a/django/db/backends/mysql/base.py b/django/db/backends/mysql/base.py
index 5767eaed51..4af4cdb0d6 100644
--- a/django/db/backends/mysql/base.py
+++ b/django/db/backends/mysql/base.py
@@ -194,6 +194,9 @@ def get_pk_default_value():
def get_max_name_length():
return 64;
+def get_start_transaction_sql():
+ return "BEGIN;"
+
def get_autoinc_sql(table):
return None
diff --git a/django/db/backends/oracle/base.py b/django/db/backends/oracle/base.py
index fd8c8dde14..90a601ace7 100644
--- a/django/db/backends/oracle/base.py
+++ b/django/db/backends/oracle/base.py
@@ -168,6 +168,9 @@ def get_pk_default_value():
def get_max_name_length():
return 30
+def get_start_transaction_sql():
+ return ""
+
def get_autoinc_sql(table):
# To simulate auto-incrementing primary keys in Oracle, we have to
# create a sequence and a trigger.
diff --git a/django/db/backends/postgresql/base.py b/django/db/backends/postgresql/base.py
index 340fd54710..e5a7893cc7 100644
--- a/django/db/backends/postgresql/base.py
+++ b/django/db/backends/postgresql/base.py
@@ -169,6 +169,9 @@ def get_pk_default_value():
def get_max_name_length():
return None
+def get_start_transaction_sql():
+ return "BEGIN;"
+
def get_autoinc_sql(table):
return None
diff --git a/django/db/backends/postgresql_psycopg2/base.py b/django/db/backends/postgresql_psycopg2/base.py
index 654b31c6b8..cc67b306a9 100644
--- a/django/db/backends/postgresql_psycopg2/base.py
+++ b/django/db/backends/postgresql_psycopg2/base.py
@@ -129,6 +129,9 @@ def get_pk_default_value():
def get_max_name_length():
return None
+def get_start_transaction_sql():
+ return "BEGIN;"
+
def get_autoinc_sql(table):
return None
diff --git a/django/db/backends/sqlite3/base.py b/django/db/backends/sqlite3/base.py
index f2e602e17d..3f5c796843 100644
--- a/django/db/backends/sqlite3/base.py
+++ b/django/db/backends/sqlite3/base.py
@@ -163,6 +163,9 @@ def get_pk_default_value():
def get_max_name_length():
return None
+def get_start_transaction_sql():
+ return "BEGIN;"
+
def get_autoinc_sql(table):
return None