Skip to content
This repository was archived by the owner on Mar 12, 2020. It is now read-only.

Commit d16e355

Browse files
authored
Merge pull request #164 from mtxr/fix-mysql-output-encoding
Use utf8 encoding in MySQL output. Merged manually because a codacy bug was blocking PR.
2 parents e6c727a + 06bdc12 commit d16e355

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

SQLTools.sublime-settings

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,38 +150,38 @@
150150
}
151151
},
152152
"mysql": {
153-
"options": ["-f", "--table"],
153+
"options": ["-f", "--table", "--default-character-set=utf8"],
154154
"before": [],
155155
"args": "-h{host} -P{port} -u\"{username}\" -D\"{database}\"",
156156
"args_optional": ["--login-path=\"{login-path}\"", "--defaults-extra-file=\"{defaults-extra-file}\"", "-p\"{password}\""],
157157
"queries": {
158158
"desc" : {
159159
"query": "select concat('|', case when table_schema REGEXP '[^0-9a-zA-Z$_]' then concat('`',table_schema,'`') else table_schema end, '.', case when table_name REGEXP '[^0-9a-zA-Z$_]' then concat('`',table_name,'`') else table_name end, '|') from information_schema.tables where table_schema = database() order by table_name;",
160-
"options": ["-f", "--silent", "--raw"]
160+
"options": ["-f", "--silent", "--raw", "--default-character-set=utf8"]
161161
},
162162
"desc table": {
163163
"query": "desc %s",
164-
"options": ["-f", "--table"]
164+
"options": ["-f", "--table", "--default-character-set=utf8"]
165165
},
166166
"show records": {
167167
"query": "select * from {0} limit {1}",
168-
"options": ["-f", "--table"]
168+
"options": ["-f", "--table", "--default-character-set=utf8"]
169169
},
170170
"columns": {
171171
"query": "select concat('|', case when table_name REGEXP '[^0-9a-zA-Z$_]' then concat('`',table_name,'`') else table_name end, '.', case when column_name REGEXP '[^0-9a-zA-Z$_]' then concat('`',column_name,'`') else column_name end, '|') from information_schema.columns where table_schema = database() order by table_name, ordinal_position;",
172-
"options": ["-f", "--silent", "--raw"]
172+
"options": ["-f", "--silent", "--raw", "--default-character-set=utf8"]
173173
},
174174
"functions": {
175175
"query": "select concat('|', case when routine_schema REGEXP '[^0-9a-zA-Z$_]' then concat('`',routine_schema,'`') else routine_schema end, '.', case when routine_name REGEXP '[^0-9a-zA-Z$_]' then concat('`',routine_name,'`') else routine_name end, '()', '|') from information_schema.routines where routine_schema = database();",
176-
"options": ["-f", "--silent", "--raw"]
176+
"options": ["-f", "--silent", "--raw", "--default-character-set=utf8"]
177177
},
178178
"desc function": {
179179
"query": "select routine_definition from information_schema.routines where concat(case when routine_schema REGEXP '[^0-9a-zA-Z$_]' then concat('`',routine_schema,'`') else routine_schema end, '.', case when routine_name REGEXP '[^0-9a-zA-Z$_]' then concat('`',routine_name,'`') else routine_name end) = '%s';",
180-
"options": ["-f", "--silent", "--raw"]
180+
"options": ["-f", "--silent", "--raw", "--default-character-set=utf8"]
181181
},
182182
"explain plan": {
183183
"query": "explain {0};",
184-
"options": ["-f", "--table"]
184+
"options": ["-f", "--table", "--default-character-set=utf8"]
185185
}
186186
}
187187
},

0 commit comments

Comments
 (0)