Commit f7a3051
committed
Migrate PLtsql node serialization to extension side
Move PLtsql outfuncs/readfuncs code generation entirely to the extension,
eliminating the need for PLtsql-specific headers in the engine's
gen_node_support.pl input files.
Key changes:
- gen_pltsql_node_support.pl now generates pltsql_nodetags.h with
extension-owned T_PLtsql_* NodeTag values (offset from 1000 to avoid
collision with engine's NodeTag enum). Includes ABI stability check
that fails the build if node types are added without updating
$last_nodetag/$last_nodetag_no.
- Wrapper files pltsql_outfuncs.c and pltsql_readfuncs.c mirror the
engine's pattern: #include the generated static functions and switch
fragments, expose public pltsql_outNode() and pltsql_parseNodeString()
dispatch functions.
- pltsql_serialize_macros.h provides WRITE_*/READ_* macros replicated
from engine internals (not exposed in any PG header).
- pl_handler.c registers outNode_hook and parseNodeString_hook in
_PG_init() so the engine's outNode()/parseNodeString() delegate to
extension code for PLtsql node types.
- pltsql.h includes generated pltsql_nodetags.h for T_PLtsql_* defines.
- Makefile updated: compiles wrapper .o files (not gen .o directly),
with proper dependency rules for generated files.
Files changed:
src/pltsql_serialize/gen_pltsql_node_support.pl - nodetags generation + ABI check
src/pltsql_serialize/pltsql_outfuncs.c - new wrapper
src/pltsql_serialize/pltsql_readfuncs.c - new wrapper
src/pltsql_serialize/pltsql_serialize_macros.h - shared macros
src/pltsql_serialize/pltsql_node_stubs.c - custom read/write nodes
src/pltsql.h - include pltsql_nodetags.h
src/pl_handler.c - register hooks
Makefile - build rules
Task: BABEL-6037
Signed-off-by: Manisha Deshpande <mmdeshp@amazon.com>1 parent 1a30c79 commit f7a3051
File tree
11 files changed
+3612
-2
lines changed- contrib/babelfishpg_tsql
- src
- pltsql_serialize
11 files changed
+3612
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
89 | 112 | | |
90 | 113 | | |
91 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
101 | 106 | | |
102 | 107 | | |
103 | 108 | | |
| |||
6149 | 6154 | | |
6150 | 6155 | | |
6151 | 6156 | | |
| 6157 | + | |
| 6158 | + | |
| 6159 | + | |
| 6160 | + | |
6152 | 6161 | | |
6153 | 6162 | | |
6154 | 6163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| |||
0 commit comments