[Bps-public-commit] dbix-searchbuilder branch log-once-unsupported-combine-search-and-count created. 1.74-1-g6fc55bb

BPS Git Server git at git.bestpractical.com
Fri Mar 31 13:58:55 UTC 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "dbix-searchbuilder".

The branch, log-once-unsupported-combine-search-and-count has been created
        at  6fc55bb2e91345ef66177e8e2b33d7446166e11d (commit)

- Log -----------------------------------------------------------------
commit 6fc55bb2e91345ef66177e8e2b33d7446166e11d
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Mar 31 21:52:50 2023 +0800

    Log unsupported CombineSearchAndCount warning only once
    
    It's noisy to warn every time we call it.

diff --git a/lib/DBIx/SearchBuilder.pm b/lib/DBIx/SearchBuilder.pm
index 782a9aa..1784734 100755
--- a/lib/DBIx/SearchBuilder.pm
+++ b/lib/DBIx/SearchBuilder.pm
@@ -806,6 +806,7 @@ in a single query.
 
 =cut
 
+my $unsupported_combine_search_and_count_logged;
 sub CombineSearchAndCount {
     my $self = shift;
     if ( @_ ) {
@@ -813,7 +814,8 @@ sub CombineSearchAndCount {
             $self->{'_combine_search_and_count'} = shift;
         }
         else {
-            warn "Current database version " . $self->_Handle->DatabaseVersion . " does not support CombineSearchAndCount. Consider upgrading to a newer version with support for windowing functions.";
+            warn "Current database version " . $self->_Handle->DatabaseVersion . " does not support CombineSearchAndCount. Consider upgrading to a newer version with support for windowing functions." unless $unsupported_combine_search_and_count_logged;
+            $unsupported_combine_search_and_count_logged ||= 1;
             return undef;
         }
     }

-----------------------------------------------------------------------


hooks/post-receive
-- 
dbix-searchbuilder


More information about the Bps-public-commit mailing list