Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter DanielTulp

    (@danieltulp)

    I’m getting all kinds of errors because of this, hope it helps:

    [Thu May 23 16:32:12 2013] [warn] [client 213.132.202.20] mod_fcgid: stderr: WordPress databaseerror This version of MySQL doesn’t yet support ‘LIMIT & IN/ALL/ANY/SOME subquery’ bij query DELETE FROMqrfaf4v8_9_crony_logsWHEREcrony_idIN ( SELECTcrony_idFROMqrfaf4v8_9_crony_logsORDER BYcrony_id LIMIT 80, 1000 ) gemaakt door do_action_ref_array, call_user_func_array, crony, crony_add_log

    [Thu May 23 16:32:12 2013] [warn] [client 213.132.202.20] mod_fcgid: stderr: WordPress databaseerror Query was empty bij query gemaakt door do_action_ref_array, call_user_func_array, crony, crony_add_log

    running MySQL v5.1.69

    Thread Starter DanielTulp

    (@danieltulp)

    I fixed the second error:

    change:
    /wp-content/plugins/crony/crony.php line 581
    return $wpdb->query($wpdb->prepare("INSERT INTO” . CRONY_TBL . “logs(crony_id,output,real_time,start,end) VALUES (%d, %s, %s, %s, %s)", array($id, $end)));

    to
    return $wpdb->query($wpdb->prepare("INSERT INTO” . CRONY_TBL . “logs(crony_id,output,real_time,start,end) VALUES (%d, %s, %s, %s, %s)", array($id, $output, $real, $start, $end)));

    note the additional parameters in the array at the end of the query

    the first error might be solved by using JOIN or my host updating the MySQL db to a higher version, but I doubt that will happen soon
    possible solution with JOIN:
    https://stackoverflow.com/questions/12434525/this-version-of-mysql-doesnt-yet-support-limit-in-all-any-some-subquery

    Thread Starter DanielTulp

    (@danieltulp)

    I have managed to also solve the first issue

    in the same file and function, around line 578 change the sql query to:

    // Drop any older logs
    $max_records = 100;
    $crony_ids = $wpdb->get_results(“SELECT id FROM " . CRONY_TBL . "logs ORDER BY id“);
    if(count($crony_ids)>$max_records){
    foreach($crony_ids as $index => $crony_id){
    if($index<count($crony_ids)-$max_records){
    $wpdb->query($wpdb->prepare(“DELETE FROM " . CRONY_TBL . "logs WHERE id = %d”, $crony_id->id));
    }
    }
    }

    uses $max_records to set the maximum amount of records to save in the log (create a setting for this?)

    hope this helps someone!

    Plugin Author Scott Kingsley Clark

    (@sc0ttkclark)

    I’ve fixed these issues in Crony 0.4.2, thanks for the heads up!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Logs not recorded’ is closed to new replies.