@@ -249,46 +249,38 @@ bool launch_agent(void)
249249 return true;
250250}
251251
252- /* PGPRO 10-13 check to be "(certified)", with exceptional case PGPRO_11 conforming to "(standard certified)" */
252+ #ifdef PGPRO_EDITION
253+ /* PGPRO 10-13 checks to be "(certified)", with exceptional case PGPRO_11 conforming to "(standard certified)" */
253254static bool check_certified ()
254255{
255- #ifdef PGPRO_VERSION_STR
256256 return strstr (PGPRO_VERSION_STR , "(certified)" ) ||
257257 strstr (PGPRO_VERSION_STR , ("(standard certified)" ));
258- #endif
259- return false;
260258}
259+ #endif
261260
262- //TODO REVIEW review coding standard https://jira.postgrespro.ru/browse/PBCKP-251 with @funny_falcon, newlines, braces etc
263261static char * extract_pg_edition_str ()
264262{
263+ static char * _1C = "1C" ;
265264 static char * vanilla = "vanilla" ;
266265 static char * std = "standard" ;
267266 static char * ent = "enterprise" ;
268267 static char * std_cert = "standard-certified" ;
269268 static char * ent_cert = "enterprise-certified" ;
270269
271270#ifdef PGPRO_EDITION
272- if (strcasecmp (PGPRO_EDITION , "1C" ) == 0 )
271+ if (strcmp (PGPRO_EDITION , _1C ) == 0 )
273272 return vanilla ;
274273
275- /* these "certified" checks are applicable to PGPRO from 9.6 up to 12 versions.
276- * 13+ certified versions are compatible to non-certified ones */
277274 if (PG_VERSION_NUM < 100000 )
278- {
279- if (strcmp (PGPRO_EDITION , "standard-certified" ) == 0 )
280- return std_cert ;
281- else if (strcmp (PGPRO_EDITION , "enterprise-certified" ))
282- return ent_cert ;
283- else
284- Assert ("Bad #define PGPRO_EDITION value" == 0 );
285- }
275+ return PGPRO_EDITION ;
286276
287- if (check_certified ())
277+ /* these "certified" checks are applicable to PGPRO from 10 up to 12 versions.
278+ * 13+ certified versions are compatible to non-certified ones */
279+ if (PG_VERSION_NUM < 130000 && check_certified ())
288280 {
289- if (strcmp (PGPRO_EDITION , "standard" ) )
281+ if (strcmp (PGPRO_EDITION , std ) == 0 )
290282 return std_cert ;
291- else if (strcmp (PGPRO_EDITION , "enterprise" ) == 0 )
283+ else if (strcmp (PGPRO_EDITION , ent ) == 0 )
292284 return ent_cert ;
293285 else
294286 Assert ("Bad #define PGPRO_EDITION value" == 0 );
@@ -374,7 +366,7 @@ void check_remote_agent_compatibility(int agent_version, char *compatibility_str
374366 prepare_compatibility_str (buf , sizeof buf );
375367 if (strcmp (compatibility_str , buf ))
376368 {
377- elog (ERROR , "Incompatible remote agent params, expected:\n%s" , buf );
369+ elog (ERROR , "Incompatible remote agent params, expected:\n%s, actual:\n:%s " , buf , compatibility_str );
378370 }
379371 }
380372}
0 commit comments