84
84
(grant_option && !check_grant_db(thd, file_name)))
86
86
thd->packet.length(0);
87
net_store_data(&thd->packet, thd->convert_set, file_name);
87
net_store_data(&thd->packet, thd->variables.convert_set, file_name);
88
88
if (my_net_write(&thd->net, (char*) thd->packet.ptr(),
89
89
thd->packet.length()))
259
259
String *packet= &thd->packet;
260
CONVERT *convert=thd->convert_set;
260
CONVERT *convert=thd->variables.convert_set;
261
261
DBUG_ENTER("mysqld_extend_show_tables");
263
263
(void) sprintf(path,"%s/%s",mysql_data_home,db);
434
434
char tmp[MAX_FIELD_WIDTH];
436
CONVERT *convert=thd->convert_set;
436
CONVERT *convert=thd->variables.convert_set;
437
437
DBUG_ENTER("mysqld_show_fields");
438
438
DBUG_PRINT("enter",("db: %s table: %s",table_list->db,
439
439
table_list->real_name));
549
549
mysqld_show_create(THD *thd, TABLE_LIST *table_list)
552
CONVERT *convert=thd->convert_set;
552
CONVERT *convert=thd->variables.convert_set;
553
553
DBUG_ENTER("mysqld_show_create");
554
554
DBUG_PRINT("enter",("db: %s table: %s",table_list->db,
555
555
table_list->real_name));
769
769
mysqld_dump_create_info(THD *thd, TABLE *table, int fd)
771
CONVERT *convert=thd->convert_set;
771
CONVERT *convert=thd->variables.convert_set;
772
772
DBUG_ENTER("mysqld_dump_create_info");
773
773
DBUG_PRINT("enter",("table: %s",table->real_name));
1019
1019
List<Item> field_list;
1020
1020
I_List<thread_info> thread_infos;
1021
ulong max_query_length= verbose ? max_allowed_packet : PROCESS_LIST_WIDTH;
1022
CONVERT *convert=thd->convert_set;
1021
ulong max_query_length= (verbose ? thd->variables.max_allowed_packet :
1022
PROCESS_LIST_WIDTH);
1023
CONVERT *convert=thd->variables.convert_set;
1023
1024
DBUG_ENTER("mysqld_list_processes");
1025
1026
field_list.push_back(new Item_int("Id",0,7));
1145
1146
int mysqld_show(THD *thd, const char *wild, show_var_st *variables,
1146
struct system_variables *values)
1147
enum enum_var_type value_type)
1149
1149
char buff[8192];
1150
1150
String packet2(buff,sizeof(buff));
1151
1151
List<Item> field_list;
1152
CONVERT *convert=thd->convert_set;
1152
CONVERT *convert=thd->variables.convert_set;
1155
1155
DBUG_ENTER("mysqld_show");
1161
1161
/* pthread_mutex_lock(&THR_LOCK_keycache); */
1162
1162
pthread_mutex_lock(&LOCK_status);
1163
for (i=0; variables[i].name; i++)
1163
for (; variables->name; variables++)
1165
if (!(wild && wild[0] && wild_case_compare(variables[i].name,wild)))
1165
if (!(wild && wild[0] && wild_case_compare(variables->name,wild)))
1167
1167
packet2.length(0);
1168
net_store_data(&packet2,convert,variables[i].name);
1169
switch (variables[i].type){
1168
net_store_data(&packet2,convert,variables->name);
1169
SHOW_TYPE show_type=variables->type;
1170
char *value=variables->value;
1171
if (show_type == SHOW_SYS)
1173
show_type= ((sys_var*) value)->type();
1174
value= ((sys_var*) value)->value_ptr(thd, value_type);
1177
switch (show_type) {
1170
1178
case SHOW_LONG:
1171
1179
case SHOW_LONG_CONST:
1172
net_store_data(&packet2,(uint32) *(ulong*) variables[i].value);
1174
case SHOW_LONG_OFFSET:
1175
offset= (ulong) variables[i].value;
1176
net_store_data(&packet2,
1177
(uint32) *(ulong*) (((char*) values) + offset));
1180
net_store_data(&packet2,(uint32) *(ulong*) value);
1183
net_store_data(&packet2,(longlong) *(longlong*) value);
1179
1185
case SHOW_BOOL:
1180
net_store_data(&packet2,(ulong) *(bool*) variables[i].value ?
1186
net_store_data(&packet2,(ulong) *(bool*) value ? "ON" : "OFF");
1183
1188
case SHOW_MY_BOOL:
1184
net_store_data(&packet2,(ulong) *(my_bool*) variables[i].value ?
1187
case SHOW_MY_BOOL_OFFSET:
1188
offset= (ulong) variables[i].value;
1189
net_store_data(&packet2,
1190
((ulong) *(my_bool*) (((char*) values) + offset)) ?
1189
net_store_data(&packet2,(ulong) *(my_bool*) value ? "ON" : "OFF");
1193
1191
case SHOW_INT_CONST:
1195
net_store_data(&packet2,(uint32) *(int*) variables[i].value);
1197
case SHOW_INT_OFFSET:
1198
offset= (ulong) variables[i].value;
1199
net_store_data(&packet2,
1200
(uint32) *(int*) (((char*) values) + offset));
1193
net_store_data(&packet2,(uint32) *(int*) value);
1202
1195
case SHOW_HAVE:
1204
SHOW_COMP_OPTION tmp= *(SHOW_COMP_OPTION*) variables[i].value;
1197
SHOW_COMP_OPTION tmp= *(SHOW_COMP_OPTION*) value;
1205
1198
net_store_data(&packet2, (tmp == SHOW_OPTION_NO ? "NO" :
1206
1199
tmp == SHOW_OPTION_YES ? "YES" :
1210
1203
case SHOW_CHAR:
1211
net_store_data(&packet2,convert, variables[i].value);
1204
net_store_data(&packet2,convert, value);
1213
1206
case SHOW_STARTTIME:
1214
1207
net_store_data(&packet2,(uint32) (thd->query_start() - start_time));
1232
1225
net_store_data(&packet2,(uint32) cached_tables());
1234
1227
case SHOW_CHAR_PTR:
1236
char *value= *(char**) variables[i].value;
1237
net_store_data(&packet2,convert, value ? value : "");
1229
value= *(char**) value;
1230
net_store_data(&packet2,convert, value ? value : "");
1240
1233
#ifdef HAVE_OPENSSL
1241
1234
/* First group - functions relying on CTX */
1242
1235
case SHOW_SSL_CTX_SESS_ACCEPT:
1395
1388
#endif /* HAVE_OPENSSL */
1389
case SHOW_UNDEF: // Show never happen
1391
net_store_data(&packet2, ""); // Safety
1397
1394
if (my_net_write(&thd->net, (char*) packet2.ptr(),packet2.length()))
1398
1395
goto err; /* purecov: inspected */