Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: django/django
...
head fork: jpichon/django
  • 1 commit
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Commits on Jul 07, 2012
Julie Pichon jpichon Fixed #6517. ./manage.py dbshell doesn't get charset db option (MySQL)
Thanks tvrg for report and patch. (Slightly updated to match current
codebase)
72a7144
Showing with 3 additions and 1 deletion.
  1. +3 −1 django/db/backends/mysql/client.py
4 django/db/backends/mysql/client.py
View
@@ -15,6 +15,7 @@ def runshell(self):
host = settings_dict['OPTIONS'].get('host', settings_dict['HOST'])
port = settings_dict['OPTIONS'].get('port', settings_dict['PORT'])
defaults_file = settings_dict['OPTIONS'].get('read_default_file')
+ charset = settings_dict['OPTIONS'].get('charset', '')
# Seems to be no good way to set sql_mode with CLI.
if defaults_file:
@@ -32,9 +33,10 @@ def runshell(self):
args += ["--port=%s" % port]
if db:
args += [db]
+ if charset:
+ args += ["--default-character-set=%s" % charset]
if os.name == 'nt':
sys.exit(os.system(" ".join(args)))
else:
os.execvp(self.executable_name, args)
-

No commit comments for this range

Something went wrong with that request. Please try again.