Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile error when building enc_float4_encrypt due to type mismatch #1

Closed
Kodp opened this issue May 27, 2024 · 1 comment
Closed

Comments

@Kodp
Copy link

Kodp commented May 27, 2024

Environment:

  • OS: Ubuntu 22.04.4 LTS in WSL2
  • PostgreSQL version: PostgreSQL 16.3 (Ubuntu 16.3-1.pgdg22.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit

Follow the quick-start, enter the HEDB directory and compile(make). The error is as follows:

[ 57%] Building CXX object integrity_zone/CMakeFiles/hedb.dir/udf/enc_float4.cpp.o
In file included from /home/syh/Reseach/HEDB/src/integrity_zone/include/stdafx.hpp:15,
                 from /home/syh/Reseach/HEDB/src/integrity_zone/include/extension.hpp:4,
                 from /home/syh/Reseach/HEDB/src/integrity_zone/udf/enc_float4.cpp:8:
/home/syh/Reseach/HEDB/src/integrity_zone/udf/enc_float4.cpp: In function ‘Datum enc_float4_encrypt(FunctionCallInfo)’:
/home/syh/Reseach/HEDB/src/integrity_zone/udf/enc_float4.cpp:73:22: error: cannot convert ‘EncFloat*’ to ‘float4’ {aka ‘float’}
   73 |     PG_RETURN_FLOAT4(f);
      |                      ^
      |                      |
      |                      EncFloat*
/usr/include/postgresql/16/server/fmgr.h:366:52: note: in definition of macro ‘PG_RETURN_FLOAT4’
  366 | #define PG_RETURN_FLOAT4(x)  return Float4GetDatum(x)
      |                                                    ^
In file included from /home/syh/Reseach/HEDB/src/integrity_zone/include/stdafx.hpp:14,
                 from /home/syh/Reseach/HEDB/src/integrity_zone/include/extension.hpp:4,
                 from /home/syh/Reseach/HEDB/src/integrity_zone/udf/enc_float4.cpp:8:
/usr/include/postgresql/16/server/postgres.h:475:23: note:   initializing argument 1 of ‘Datum Float4GetDatum(float4)’
  475 | Float4GetDatum(float4 X)
      |                ~~~~~~~^
gmake[3]: *** [integrity_zone/CMakeFiles/hedb.dir/build.make:258: integrity_zone/CMakeFiles/hedb.dir/udf/enc_float4.cpp.o] Error 1
gmake[3]: Leaving directory '/home/syh/Reseach/HEDB/build'
gmake[2]: *** [CMakeFiles/Makefile2:209: integrity_zone/CMakeFiles/hedb.dir/all] Error 2
gmake[2]: Leaving directory '/home/syh/Reseach/HEDB/build'
gmake[1]: *** [Makefile:136: all] Error 2
gmake[1]: Leaving directory '/home/syh/Reseach/HEDB/build'
make: *** [Makefile:7: build] Error 2

Error code fragment:

Datum enc_float4_encrypt(PG_FUNCTION_ARGS)
{
    float src = PG_GETARG_FLOAT4(0);
    EncFloat* f = (EncFloat*)palloc0(sizeof(EncFloat));
    int error = enc_float_encrypt(src, f);
    if (error) print_error("%s %d", __func__, error);
    PG_RETURN_FLOAT4(f);
}

No type conversion here? I don't know how to fix it.

@Kodp Kodp changed the title Error when building enc_float4_encrypt due to type mismatch make error when building enc_float4_encrypt due to type mismatch May 28, 2024
@Kodp Kodp changed the title make error when building enc_float4_encrypt due to type mismatch compile error when building enc_float4_encrypt due to type mismatch May 28, 2024
@Maxul
Copy link
Collaborator

Maxul commented Jun 4, 2024

You may downgrade your PostgreSQL to 14 and try again.

@Maxul Maxul closed this as completed Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants