mirror of https://github.com/citusdata/citus.git
Clarifies the code
parent
7bdeb2f866
commit
f2092d2f44
|
@ -393,8 +393,6 @@ citus_internal_database_command(PG_FUNCTION_ARGS)
|
||||||
|
|
||||||
if (OidIsValid(databaseOid))
|
if (OidIsValid(databaseOid))
|
||||||
{
|
{
|
||||||
/* / * remove database from database shards * / */
|
|
||||||
|
|
||||||
DropDatabase(NULL, (DropdbStmt *) parseTree);
|
DropDatabase(NULL, (DropdbStmt *) parseTree);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
#include "postgres.h"
|
#include "postgres.h"
|
||||||
#include "utils/builtins.h"
|
#include "utils/builtins.h"
|
||||||
#include "commands/defrem.h"
|
#include "commands/defrem.h"
|
||||||
|
@ -10,8 +11,17 @@
|
||||||
#include "distributed/pg_version_constants.h"
|
#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
|
void
|
||||||
handleOption(StringInfo buf, DefElem *option, const struct option_format *opt_formats, int
|
optionToStatement(StringInfo buf, DefElem *option, const struct
|
||||||
|
option_format *opt_formats, int
|
||||||
opt_formats_len)
|
opt_formats_len)
|
||||||
{
|
{
|
||||||
const char *name = option->defname;
|
const char *name = option->defname;
|
||||||
|
|
|
@ -237,7 +237,7 @@ AppendCreateDatabaseStmt(StringInfo buf, CreatedbStmt *stmt)
|
||||||
|
|
||||||
foreach_ptr(option, stmt->options)
|
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));
|
create_database_option_formats));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
option_format *opt_formats, int
|
||||||
opt_formats_len);
|
opt_formats_len);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue