diff options
author | Hannes Ljungberg <hannes@5monkeys.se> | 2020-03-20 23:08:32 +0100 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-03-25 10:16:30 +0100 |
commit | f3da09df0f4147223ab76a00a841586ccf11005d (patch) | |
tree | e36e8116a5b7abaa453791545a65e3febe3adc87 /django/db/backends/mysql/operations.py | |
parent | 39e1c88de67ea2035d5ad89cfe00bcd892c0d163 (diff) | |
download | django-f3da09df0f4147223ab76a00a841586ccf11005d.tar.gz |
Fixed #31396 -- Added binary XOR operator to F expressions.
Diffstat (limited to 'django/db/backends/mysql/operations.py')
-rw-r--r-- | django/db/backends/mysql/operations.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/db/backends/mysql/operations.py b/django/db/backends/mysql/operations.py index 6aaf5c6295..e9306f03fc 100644 --- a/django/db/backends/mysql/operations.py +++ b/django/db/backends/mysql/operations.py @@ -240,7 +240,8 @@ class DatabaseOperations(BaseDatabaseOperations): return 'POW(%s)' % ','.join(sub_expressions) # Convert the result to a signed integer since MySQL's binary operators # return an unsigned integer. - elif connector in ('&', '|', '<<'): + elif connector in ('&', '|', '<<', '#'): + connector = '^' if connector == '#' else connector return 'CONVERT(%s, SIGNED)' % connector.join(sub_expressions) elif connector == '>>': lhs, rhs = sub_expressions |