WordPress.org

Ready to get started?Download WordPress

Forums

WP Media Cleaner
[resolved] Not null fields without default values (5 posts)

  1. dimagsv
    Member
    Posted 11 months ago #

    Ignored, deleted fields in wpmcleaner table must have default values.

    http://wordpress.org/plugins/wp-media-cleaner/

  2. Jordy Meow
    Member
    Plugin Author

    Posted 6 months ago #

    Sorry, I just came across this thread now. Can you elaborate?

  3. dimagsv
    Member
    Posted 6 months ago #

    Fields 'ignored' and 'deleted' in table wp_wpmcleaner do not have default values.
    I've got many errors like this:
    [09-Jan-2014 09:44:22 UTC] База данных WordPress возвратила ошибку Field 'ignored' doesn't have a default value в ответ на запрос INSERT INTO wp_wpmcleaner (time,type,path,size,issue) VALUES ('2014-01-09 12:44:22','0','dreamwork/1_uploadfolder/thumb/v28-resized.jpg','2615','NO_MEDIA'), выполненный do_action('wp_ajax_wpmc_scan_do'), call_user_func_array, wpmc_wp_ajax_wpmc_scan_do, wpmc_check_file

  4. fbtrcm
    Member
    Posted 5 months ago #

    Hi,

    I seem to have the same issue : http://wordpress.org/support/topic/erreur-dans-la-base-de-donnees?replies=3

    In my version of MySQL (5.5.24 - MySQL Community Server (GPL)), if you have a field/column set to NOT NULL you should set a default value to the field/column in case a tuple is inserted with no value for that field/column.

    I read the table create script in function wpmc_activate().
    It shows no default value set for the following fields/columns:

    • type TINYINT(1) NOT NULL,
    • ignored BIT NOT NULL,
    • deleted BIT NOT NULL,
    • issue TINYTEXT NOT NULL,

    So, when I want to add an image to the table, it generates an error such as shown in this post or the other.

    You've got two solutions in this case.
    First, you can mend the faultive table. Or the other, you change the INSERT query in adding default values to these fields.

    For my part, i added a default value 0 to the BIT columns and all worked fine.

  5. Jordy Meow
    Member
    Plugin Author

    Posted 4 months ago #

    Thanks! I will update my code in the next release.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.