Clarifies the code

pull/7270/head
gindibay 2023-10-09 20:24:34 +03:00
parent 7bdeb2f866
commit f2092d2f44
4 changed files with 14 additions and 6 deletions

View File

@ -393,8 +393,6 @@ citus_internal_database_command(PG_FUNCTION_ARGS)
if (OidIsValid(databaseOid))
{
/* / * remove database from database shards * / */
DropDatabase(NULL, (DropdbStmt *) parseTree);
}
}

View File

@ -1,3 +1,4 @@
#include "postgres.h"
#include "utils/builtins.h"
#include "commands/defrem.h"
@ -10,9 +11,18 @@
#include "distributed/pg_version_constants.h"
/**
* Convert a DefElem option to a SQL statement and append it to the given StringInfo buffer.
*
* @param buf The StringInfo buffer to append the SQL statement to.
* @param option The DefElem option to convert to a SQL statement.
* @param opt_formats The option format specification to use for the conversion.
* @param num_opt_formats The number of option formats in the opt_formats array.
*/
void
handleOption(StringInfo buf, DefElem *option, const struct option_format *opt_formats, int
opt_formats_len)
optionToStatement(StringInfo buf, DefElem *option, const struct
option_format *opt_formats, int
opt_formats_len)
{
const char *name = option->defname;
int i;

View File

@ -237,7 +237,7 @@ AppendCreateDatabaseStmt(StringInfo buf, CreatedbStmt *stmt)
foreach_ptr(option, stmt->options)
{
handleOption(buf, option, create_database_option_formats, lengthof(
optionToStatement(buf, option, create_database_option_formats, lengthof(
create_database_option_formats));
}
}

View File

@ -131,7 +131,7 @@ struct option_format
};
extern void handleOption(StringInfo buf, DefElem *option, const struct
extern void optionToStatement(StringInfo buf, DefElem *option, const struct
option_format *opt_formats, int
opt_formats_len);