mirror of
https://github.com/postgres/postgres.git
synced 2025-07-11 10:01:57 +03:00
Add parse location fields to NullTest and BooleanTest structs.
We did not need a location tag on NullTest or BooleanTest before, because no error messages referred directly to their locations. That's planned to change though, so add these fields in a separate housekeeping commit. Catversion bump because stored rules may change.
This commit is contained in:
@ -11299,6 +11299,7 @@ a_expr: c_expr { $$ = $1; }
|
||||
NullTest *n = makeNode(NullTest);
|
||||
n->arg = (Expr *) $1;
|
||||
n->nulltesttype = IS_NULL;
|
||||
n->location = @2;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
| a_expr ISNULL
|
||||
@ -11306,6 +11307,7 @@ a_expr: c_expr { $$ = $1; }
|
||||
NullTest *n = makeNode(NullTest);
|
||||
n->arg = (Expr *) $1;
|
||||
n->nulltesttype = IS_NULL;
|
||||
n->location = @2;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
| a_expr IS NOT NULL_P %prec IS
|
||||
@ -11313,6 +11315,7 @@ a_expr: c_expr { $$ = $1; }
|
||||
NullTest *n = makeNode(NullTest);
|
||||
n->arg = (Expr *) $1;
|
||||
n->nulltesttype = IS_NOT_NULL;
|
||||
n->location = @2;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
| a_expr NOTNULL
|
||||
@ -11320,6 +11323,7 @@ a_expr: c_expr { $$ = $1; }
|
||||
NullTest *n = makeNode(NullTest);
|
||||
n->arg = (Expr *) $1;
|
||||
n->nulltesttype = IS_NOT_NULL;
|
||||
n->location = @2;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
| row OVERLAPS row
|
||||
@ -11343,6 +11347,7 @@ a_expr: c_expr { $$ = $1; }
|
||||
BooleanTest *b = makeNode(BooleanTest);
|
||||
b->arg = (Expr *) $1;
|
||||
b->booltesttype = IS_TRUE;
|
||||
b->location = @2;
|
||||
$$ = (Node *)b;
|
||||
}
|
||||
| a_expr IS NOT TRUE_P %prec IS
|
||||
@ -11350,6 +11355,7 @@ a_expr: c_expr { $$ = $1; }
|
||||
BooleanTest *b = makeNode(BooleanTest);
|
||||
b->arg = (Expr *) $1;
|
||||
b->booltesttype = IS_NOT_TRUE;
|
||||
b->location = @2;
|
||||
$$ = (Node *)b;
|
||||
}
|
||||
| a_expr IS FALSE_P %prec IS
|
||||
@ -11357,6 +11363,7 @@ a_expr: c_expr { $$ = $1; }
|
||||
BooleanTest *b = makeNode(BooleanTest);
|
||||
b->arg = (Expr *) $1;
|
||||
b->booltesttype = IS_FALSE;
|
||||
b->location = @2;
|
||||
$$ = (Node *)b;
|
||||
}
|
||||
| a_expr IS NOT FALSE_P %prec IS
|
||||
@ -11364,6 +11371,7 @@ a_expr: c_expr { $$ = $1; }
|
||||
BooleanTest *b = makeNode(BooleanTest);
|
||||
b->arg = (Expr *) $1;
|
||||
b->booltesttype = IS_NOT_FALSE;
|
||||
b->location = @2;
|
||||
$$ = (Node *)b;
|
||||
}
|
||||
| a_expr IS UNKNOWN %prec IS
|
||||
@ -11371,6 +11379,7 @@ a_expr: c_expr { $$ = $1; }
|
||||
BooleanTest *b = makeNode(BooleanTest);
|
||||
b->arg = (Expr *) $1;
|
||||
b->booltesttype = IS_UNKNOWN;
|
||||
b->location = @2;
|
||||
$$ = (Node *)b;
|
||||
}
|
||||
| a_expr IS NOT UNKNOWN %prec IS
|
||||
@ -11378,6 +11387,7 @@ a_expr: c_expr { $$ = $1; }
|
||||
BooleanTest *b = makeNode(BooleanTest);
|
||||
b->arg = (Expr *) $1;
|
||||
b->booltesttype = IS_NOT_UNKNOWN;
|
||||
b->location = @2;
|
||||
$$ = (Node *)b;
|
||||
}
|
||||
| a_expr IS DISTINCT FROM a_expr %prec IS
|
||||
|
@ -789,6 +789,7 @@ transformAExprOp(ParseState *pstate, A_Expr *a)
|
||||
NullTest *n = makeNode(NullTest);
|
||||
|
||||
n->nulltesttype = IS_NULL;
|
||||
n->location = a->location;
|
||||
|
||||
if (exprIsNullConstant(lexpr))
|
||||
n->arg = (Expr *) rexpr;
|
||||
|
Reference in New Issue
Block a user