[wp-trac] [WordPress Trac] #32029: WP_Error( 'wpdb_get_table_charset_failure' ) thrown when doing "SHOW TABLES LIKE %s"

WordPress Trac noreply at wordpress.org
Tue Apr 21 04:01:17 UTC 2015


#32029: WP_Error( 'wpdb_get_table_charset_failure' ) thrown when doing "SHOW TABLES
LIKE %s"
---------------------------+--------------------
 Reporter:  datafeedr.com  |       Owner:
     Type:  defect (bug)   |      Status:  new
 Priority:  high           |   Milestone:  4.2
Component:  Database       |     Version:  trunk
 Severity:  normal         |  Resolution:
 Keywords:  has-patch      |     Focuses:
---------------------------+--------------------
Changes (by valendesigns):

 * keywords:  has-patch needs-testing => has-patch


Comment:

 I ran into this very same thing earlier today with one of my plugins. Even
 though this is definitely an issue that should be solved in Core, I also
 think there is a better way to see if a table exists. Try the following
 instead:

 {{{
 $table_name = $wpdb->prefix . 'dfrpswc_temp_post_ids_by_set_id';
 if ( ! in_array( $table_name, $wpdb->tables() ) ) {
         dfrpswc_create_table();
 }
 }}}

 @pento I tested the patch and can confirm it solves the issue.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32029#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list