| 1260 | ON_UPDATE(fix_log_state)); |
| 1261 | |
| 1262 | static bool fix_log_state(sys_var *self, THD *thd, enum_var_type type) |
| 1263 | { |
| 1264 | bool res; |
| 1265 | my_bool *UNINIT_VAR(newvalptr), newval, UNINIT_VAR(oldval); |
| 1266 | uint UNINIT_VAR(log_type); |
| 1267 | |
| 1268 | if (self == &Sys_general_log) |
| 1269 | { |
| 1270 | newvalptr= &opt_log; |
| 1271 | oldval= logger.get_log_file_handler()->is_open(); |
| 1272 | log_type= QUERY_LOG_GENERAL; |
| 1273 | } |
| 1274 | else |
| 1275 | DBUG_ASSERT(FALSE); |
| 1276 | |
| 1277 | newval= *newvalptr; |
| 1278 | if (oldval == newval) |
| 1279 | return false; |
| 1280 | |
| 1281 | *newvalptr= oldval; // [de]activate_log_handler works that way (sigh) |
| 1282 | |
| 1283 | mysql_mutex_unlock(&LOCK_global_system_variables); |
| 1284 | if (!newval) |
| 1285 | { |
| 1286 | logger.deactivate_log_handler(thd, log_type); |
| 1287 | res= false; |
| 1288 | } |
| 1289 | else |
| 1290 | res= logger.activate_log_handler(thd, log_type); |
| 1291 | mysql_mutex_lock(&LOCK_global_system_variables); |
| 1292 | return res; |
| 1293 | } |
| 1294 | |
| 1295 | static bool check_not_empty_set(sys_var *self, THD *thd, set_var *var) |
| 1296 | { |
nothing calls this directly
no test coverage detected