|
150 | 150 | } |
151 | 151 | }, |
152 | 152 | "mysql": { |
153 | | - "options": ["-f", "--table"], |
| 153 | + "options": ["-f", "--table", "--default-character-set=utf8"], |
154 | 154 | "before": [], |
155 | 155 | "args": "-h{host} -P{port} -u\"{username}\" -D\"{database}\"", |
156 | 156 | "args_optional": ["--login-path=\"{login-path}\"", "--defaults-extra-file=\"{defaults-extra-file}\"", "-p\"{password}\""], |
157 | 157 | "queries": { |
158 | 158 | "desc" : { |
159 | 159 | "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"] |
161 | 161 | }, |
162 | 162 | "desc table": { |
163 | 163 | "query": "desc %s", |
164 | | - "options": ["-f", "--table"] |
| 164 | + "options": ["-f", "--table", "--default-character-set=utf8"] |
165 | 165 | }, |
166 | 166 | "show records": { |
167 | 167 | "query": "select * from {0} limit {1}", |
168 | | - "options": ["-f", "--table"] |
| 168 | + "options": ["-f", "--table", "--default-character-set=utf8"] |
169 | 169 | }, |
170 | 170 | "columns": { |
171 | 171 | "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"] |
173 | 173 | }, |
174 | 174 | "functions": { |
175 | 175 | "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"] |
177 | 177 | }, |
178 | 178 | "desc function": { |
179 | 179 | "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"] |
181 | 181 | }, |
182 | 182 | "explain plan": { |
183 | 183 | "query": "explain {0};", |
184 | | - "options": ["-f", "--table"] |
| 184 | + "options": ["-f", "--table", "--default-character-set=utf8"] |
185 | 185 | } |
186 | 186 | } |
187 | 187 | }, |
|
0 commit comments