MCPcopy Create free account
hub / github.com/apache/cloudberry / append_database_pattern

Function append_database_pattern

src/bin/pg_amcheck/pg_amcheck.c:1342–1361  ·  view source on GitHub ↗

* append_database_pattern * * Adds the given pattern interpreted as a database name pattern. * * pia: the pattern info array to be appended * pattern: the database name pattern * encoding: client encoding for parsing the pattern */

Source from the content-addressed store, hash-verified

1340 * encoding: client encoding for parsing the pattern
1341 */
1342static void
1343append_database_pattern(PatternInfoArray *pia, const char *pattern, int encoding)
1344{
1345 PQExpBufferData buf;
1346 int dotcnt;
1347 PatternInfo *info = extend_pattern_info_array(pia);
1348
1349 initPQExpBuffer(&buf);
1350 patternToSQLRegex(encoding, NULL, NULL, &buf, pattern, false, false,
1351 &dotcnt);
1352 if (dotcnt > 0)
1353 {
1354 pg_log_error("improper qualified name (too many dotted names): %s", pattern);
1355 exit(2);
1356 }
1357 info->pattern = pattern;
1358 info->db_regex = pstrdup(buf.data);
1359
1360 termPQExpBuffer(&buf);
1361}
1362
1363/*
1364 * append_schema_pattern

Callers 1

mainFunction · 0.85

Calls 5

initPQExpBufferFunction · 0.85
patternToSQLRegexFunction · 0.85
termPQExpBufferFunction · 0.85
pstrdupFunction · 0.50

Tested by

no test coverage detected