diff --git a/wp-includes/class-wp-meta-query.php b/wp-includes/class-wp-meta-query.php index b1369a067d..ddafc6181b 100644 --- a/wp-includes/class-wp-meta-query.php +++ b/wp-includes/class-wp-meta-query.php @@ -632,7 +632,11 @@ class WP_Meta_Query { } if ( $where ) { - $sql_chunks['where'][] = "CAST($alias.meta_value AS {$meta_type}) {$meta_compare} {$where}"; + if ( 'CHAR' === $meta_type ) { + $sql_chunks['where'][] = "$alias.meta_value {$meta_compare} {$where}"; + } else { + $sql_chunks['where'][] = "CAST($alias.meta_value AS {$meta_type}) {$meta_compare} {$where}"; + } } } diff --git a/wp-includes/version.php b/wp-includes/version.php index a1d152035d..e5085e504b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.6-alpha-37593'; +$wp_version = '4.6-alpha-37594'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.