WordPress.org

Forums

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

  1. dimagsv
    Member
    Posted 1 year 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 1 year ago #

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

  3. dimagsv
    Member
    Posted 1 year 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 1 year 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 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Media Cleaner
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.