mirror of
https://github.com/postgres/postgres.git
synced 2025-06-30 21:42:05 +03:00
Initial pgindent and pgperltidy run for v13.
Includes some manual cleanup of places that pgindent messed up,
most of which weren't per project style anyway.
Notably, it seems some people didn't absorb the style rules of
commit c9d297751
, because there were a bunch of new occurrences
of function calls with a newline just after the left paren, all
with faulty expectations about how the rest of the call would get
indented.
This commit is contained in:
@ -496,7 +496,7 @@ static void transform_string_values_scalar(void *state, char *token, JsonTokenTy
|
||||
void
|
||||
pg_parse_json_or_ereport(JsonLexContext *lex, JsonSemAction *sem)
|
||||
{
|
||||
JsonParseErrorType result;
|
||||
JsonParseErrorType result;
|
||||
|
||||
result = pg_parse_json(lex, sem);
|
||||
if (result != JSON_SUCCESS)
|
||||
@ -4524,8 +4524,8 @@ jsonb_set_lax(PG_FUNCTION_ARGS)
|
||||
/* ArrayType *path = PG_GETARG_ARRAYTYPE_P(1); */
|
||||
/* Jsonb *newval = PG_GETARG_JSONB_P(2); */
|
||||
/* bool create = PG_GETARG_BOOL(3); */
|
||||
text *handle_null;
|
||||
char *handle_val;
|
||||
text *handle_null;
|
||||
char *handle_val;
|
||||
|
||||
if (PG_ARGISNULL(0) || PG_ARGISNULL(1) || PG_ARGISNULL(3))
|
||||
PG_RETURN_NULL();
|
||||
@ -4537,13 +4537,13 @@ jsonb_set_lax(PG_FUNCTION_ARGS)
|
||||
errmsg("null_value_treatment must be \"delete_key\", \"return_target\", \"use_json_null\", or \"raise_exception\"")));
|
||||
|
||||
/* if the new value isn't an SQL NULL just call jsonb_set */
|
||||
if (! PG_ARGISNULL(2))
|
||||
if (!PG_ARGISNULL(2))
|
||||
return jsonb_set(fcinfo);
|
||||
|
||||
handle_null = PG_GETARG_TEXT_P(4);
|
||||
handle_val = text_to_cstring(handle_null);
|
||||
|
||||
if (strcmp(handle_val,"raise_exception") == 0)
|
||||
if (strcmp(handle_val, "raise_exception") == 0)
|
||||
{
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
|
||||
@ -4554,7 +4554,7 @@ jsonb_set_lax(PG_FUNCTION_ARGS)
|
||||
}
|
||||
else if (strcmp(handle_val, "use_json_null") == 0)
|
||||
{
|
||||
Datum newval;
|
||||
Datum newval;
|
||||
|
||||
newval = DirectFunctionCall1(jsonb_in, CStringGetDatum("null"));
|
||||
|
||||
@ -4569,6 +4569,7 @@ jsonb_set_lax(PG_FUNCTION_ARGS)
|
||||
else if (strcmp(handle_val, "return_target") == 0)
|
||||
{
|
||||
Jsonb *in = PG_GETARG_JSONB_P(0);
|
||||
|
||||
PG_RETURN_JSONB_P(in);
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user