Skip to content

Commit

Permalink
RediPress now properly forwards queries with NOT EXISTS to MySQL if i…
Browse files Browse the repository at this point in the history
…t cannot handle them. (#142)

* RediPress now properly forwards queries with NOT EXISTS to MySQL if it cannot handle them.
* CR fixes.
  • Loading branch information
vloy authored Sep 6, 2024
1 parent cc7e7a5 commit 63e0965
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [2.0.11] - 2024-09-06

### Fixed
- RediPress now properly forwards queries with NOT EXISTS to MySQL if it cannot handle them.

## [2.0.10] - 2024-08-16

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: RediPress
* Plugin URI: https://github.com/devgeniem/redipress
* Description: A WordPress plugin that provides a blazing fast search engine and WP Query performance enhancements.
* Version: 2.0.10
* Version: 2.0.11
* Author: Geniem
* Author URI: http://www.geniem.fi/
* License: GPL3
Expand Down
8 changes: 4 additions & 4 deletions src/Search/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -539,9 +539,9 @@ public function get_groupby() : array {
/**
* WP_Query meta_query parameter.
*
* @return string|null
* @return string
*/
protected function meta_query() : ?string {
protected function meta_query() : string {
if ( ! empty( $this->meta_query ) ) {
return $this->meta_query;
}
Expand All @@ -559,7 +559,7 @@ protected function meta_query() : ?string {
return $query;
}
else {
return null;
return '';
}
}

Expand Down Expand Up @@ -1046,7 +1046,7 @@ protected function create_meta_clause( array $clause ) : ?string {
'NOT IN' => 'not_in',
];

// Escape dashes from the values. To prevent numeric values from being escaped,
// Escape dashes from the values. To prevent numeric values from being escaped,
// meta_query's type attribute must be set to numeric data type.
$clause['value'] = Utility::escape_value_by_meta_type( $clause['value'], $type );

Expand Down

0 comments on commit 63e0965

Please sign in to comment.