Commit eb5c16b
Fix RUN_GTEST/RUN_GBENCH leak into pax.so build
ADD_DEFINITIONS(-DRUN_GTEST) and ADD_DEFINITIONS(-DRUN_GBENCH)
are directory-scoped CMake commands that apply to ALL targets,
including the production pax shared library. This caused test-
only macros to be defined in production builds.
In pax_porc_adpater.cc, the leaked RUN_GTEST activates:
expect_hdr = rel_tuple_desc_->attrs[index].attlen == -1 &&
rel_tuple_desc_->attrs[index].attbyval == false;
#ifdef RUN_GTEST
expect_hdr = false;
#endif
This forces expect_hdr to false in production, skipping the
stripping of PostgreSQL varlena headers from dictionary
entries. As a result, dictionary-encoded string columns
return garbled data (varlena header bytes are included as
part of the string content).
Replace ADD_DEFINITIONS with target_compile_definitions
scoped to test_main and bench_main targets only, so
RUN_GTEST and RUN_GBENCH are no longer defined when
building pax.so.1 parent cce58a8 commit eb5c16b
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
227 | 226 | | |
228 | 227 | | |
229 | 228 | | |
230 | 229 | | |
231 | 230 | | |
232 | 231 | | |
233 | 232 | | |
| 233 | + | |
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
243 | | - | |
244 | 243 | | |
245 | 244 | | |
246 | 245 | | |
247 | 246 | | |
248 | 247 | | |
249 | 248 | | |
| 249 | + | |
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| |||
0 commit comments