Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 1 commit
  • 1 file changed
  • 0 comments
  • 1 contributor
Jul 07, 2012
Julie Pichon 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 1 changed file with 3 additions and 1 deletion. Show diff stats Hide diff stats

  1. 4  django/db/backends/mysql/client.py
4  django/db/backends/mysql/client.py
@@ -15,6 +15,7 @@ def runshell(self):
15 15
         host = settings_dict['OPTIONS'].get('host', settings_dict['HOST'])
16 16
         port = settings_dict['OPTIONS'].get('port', settings_dict['PORT'])
17 17
         defaults_file = settings_dict['OPTIONS'].get('read_default_file')
  18
+        charset = settings_dict['OPTIONS'].get('charset', '')
18 19
         # Seems to be no good way to set sql_mode with CLI.
19 20
 
20 21
         if defaults_file:
@@ -32,9 +33,10 @@ def runshell(self):
32 33
             args += ["--port=%s" % port]
33 34
         if db:
34 35
             args += [db]
  36
+        if charset:
  37
+            args += ["--default-character-set=%s" % charset]
35 38
 
36 39
         if os.name == 'nt':
37 40
             sys.exit(os.system(" ".join(args)))
38 41
         else:
39 42
             os.execvp(self.executable_name, args)
40  
-

No commit comments for this range

Something went wrong with that request. Please try again.