diff options
| author | Andres Freund | 2018-01-24 07:20:02 +0000 |
|---|---|---|
| committer | Andres Freund | 2018-03-22 21:45:59 +0000 |
| commit | 7ced1d1247286399df53823eb76cacaf6d7fdb22 (patch) | |
| tree | f7a9116a7c47d3b2f729ed3602008199558c3b0b /src/include/executor/nodeAgg.h | |
| parent | fb46ac26fe493839d6cf3ab8d20bc62a285f7649 (diff) | |
Add FIELDNO_* macro designating offset into structs required for JIT.
For any interesting JIT target, fields inside structs need to be
accessed. b96d550e contains infrastructure for syncing the definition
of types between postgres C code and runtime code generation with
LLVM. But that doesn't sync the number or names of fields inside
structs, just the types (including padding etc).
One option would be to hardcode the offset numbers in the JIT code,
but that'd be hard to keep in sync. Instead add macros indicating the
field offset to the fields that need to be accessed. Not pretty, but
manageable.
Author: Andres Freund
Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/include/executor/nodeAgg.h')
| -rw-r--r-- | src/include/executor/nodeAgg.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/include/executor/nodeAgg.h b/src/include/executor/nodeAgg.h index aa6ebaaf97d..4650dc2c7e9 100644 --- a/src/include/executor/nodeAgg.h +++ b/src/include/executor/nodeAgg.h @@ -240,9 +240,12 @@ typedef struct AggStatePerAggData */ typedef struct AggStatePerGroupData { +#define FIELDNO_AGGSTATEPERGROUPDATA_TRANSVALUE 0 Datum transValue; /* current transition value */ +#define FIELDNO_AGGSTATEPERGROUPDATA_TRANSVALUEISNULL 1 bool transValueIsNull; +#define FIELDNO_AGGSTATEPERGROUPDATA_NOTRANSVALUE 2 bool noTransValue; /* true if transValue not set yet */ /* |
