diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2014-05-07 21:50:09 +0200 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2014-05-08 22:11:15 +0200 |
| commit | c70a61eb49e4ed8f3b2a5011a7a5e6cda43c8598 (patch) | |
| tree | e59c24f409be666c224f986ce21c423d4ee0b2fe /django/db | |
| parent | 43a80f4812a762c2ea96b3de45662ace04404287 (diff) | |
Replaced vendor checks by three feature flags.
Diffstat (limited to 'django/db')
| -rw-r--r-- | django/db/backends/__init__.py | 6 | ||||
| -rw-r--r-- | django/db/backends/mysql/base.py | 2 | ||||
| -rw-r--r-- | django/db/backends/oracle/base.py | 2 |
3 files changed, 10 insertions, 0 deletions
diff --git a/django/db/backends/__init__.py b/django/db/backends/__init__.py index e9d644e506..a9bf3ea9cb 100644 --- a/django/db/backends/__init__.py +++ b/django/db/backends/__init__.py @@ -481,6 +481,7 @@ class BaseDatabaseFeatures(object): can_return_id_from_insert = False has_bulk_insert = False uses_savepoints = False + can_release_savepoints = True can_combine_inserts_with_and_without_auto_increment_pk = False # If True, don't use integer foreign keys referring to, e.g., positive @@ -512,6 +513,8 @@ class BaseDatabaseFeatures(object): supports_subqueries_in_group_by = True supports_bitwise_or = True + supports_binary_field = True + # Do time/datetime fields have microsecond precision? supports_microsecond_precision = True @@ -605,6 +608,9 @@ class BaseDatabaseFeatures(object): # statements before executing them? requires_sqlparse_for_splitting = True + # Suffix for backends that don't support "SELECT xxx;" queries. + bare_select_suffix = '' + def __init__(self, connection): self.connection = connection diff --git a/django/db/backends/mysql/base.py b/django/db/backends/mysql/base.py index 85bcd8f79b..70d9a29d56 100644 --- a/django/db/backends/mysql/base.py +++ b/django/db/backends/mysql/base.py @@ -172,6 +172,8 @@ class DatabaseFeatures(BaseDatabaseFeatures): has_select_for_update_nowait = False supports_forward_references = False supports_long_model_names = False + # XXX MySQL DB-API drivers currently fail on binary data on Python 3. + supports_binary_field = six.PY2 supports_microsecond_precision = False supports_regex_backreferencing = False supports_date_lookup_using_string = False diff --git a/django/db/backends/oracle/base.py b/django/db/backends/oracle/base.py index 1a4ff172e8..e46b4f2db8 100644 --- a/django/db/backends/oracle/base.py +++ b/django/db/backends/oracle/base.py @@ -96,6 +96,7 @@ class DatabaseFeatures(BaseDatabaseFeatures): needs_datetime_string_cast = False interprets_empty_strings_as_nulls = True uses_savepoints = True + can_release_savepoints = False has_select_for_update = True has_select_for_update_nowait = True can_return_id_from_insert = True @@ -116,6 +117,7 @@ class DatabaseFeatures(BaseDatabaseFeatures): requires_literal_defaults = True connection_persists_old_columns = True closed_cursor_error_class = InterfaceError + bare_select_suffix = " FROM DUAL" class DatabaseOperations(BaseDatabaseOperations): |
