From dfaf0d524529ce75c1b722cef1f44e9d035bd958 Mon Sep 17 00:00:00 2001 From: Javier Goizueta Date: Mon, 25 Feb 2019 16:32:01 +0100 Subject: [PATCH] Prevent use of quota for bogus configurations This is a stop-gap measure for the hypothetical case of a service configuration that yields NULL quota values. --- client/sql/21_bulk_geocoding_functions.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/sql/21_bulk_geocoding_functions.sql b/client/sql/21_bulk_geocoding_functions.sql index 38a0ded..6e7828a 100644 --- a/client/sql/21_bulk_geocoding_functions.sql +++ b/client/sql/21_bulk_geocoding_functions.sql @@ -49,7 +49,7 @@ BEGIN RAISE DEBUG 'cdb_bulk_geocode_street_point --> query_row_count: %; query: %; country: %; state: %; city: %; street: %', query_row_count, query, country_column, state_column, city_column, street_column; SELECT cdb_dataservices_client.cdb_enough_quota('hires_geocoder', query_row_count) INTO enough_quota; - IF NOT enough_quota THEN + IF enough_quota IS NULL OR NOT enough_quota THEN RAISE EXCEPTION 'Remaining quota: %. Estimated cost: %', remaining_quota, query_row_count; END IF;