Skip to content

PG 18 test not passed #58

@ioxgrey

Description

@ioxgrey

I try to build pg_variables for PG 18.1 Some tests are failed. The problem somewhere in default type conversion for row type interface. Minimal testcase below:
`
postgres@e0566661d5f8:~$ psql
psql (18.1 (Debian 18.1-1.pgdg13+2))
Type "help" for help.

postgres=# SELECT pgv_insert('vars', 'r2', row('text1')) ;
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Succeeded.
postgres=#
`
Backtrace for core

`
postgres@e0566661d5f8:~/18/main$ gdb /usr/lib/postgresql/18/bin/postgres /var/lib/postgresql/18/main/core
GNU gdb (Debian 16.3-1) 16.3

Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/lib/postgresql/18/bin/postgres '' '''.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 hash_bytes (k=, keylen=) at ./build/../src/common/hashfn.c:167

warning: 167 ./build/../src/common/hashfn.c: No such file or directory
(gdb) bt
#0 hash_bytes (k=, keylen=) at ./build/../src/common/hashfn.c:167
#1 0x00005570578cc98b in hash_any (k=, keylen=)
at ./build/../src/include/common/hashfn.h:33
#2 hashtext (fcinfo=0x7ffd92148690) at ./build/../src/backend/access/hash/hashfunc.c:284
#3 0x0000557057d9bdff in FunctionCall1Coll (flinfo=0x557094675d90, collation=collation@entry=100,
arg1=) at ./build/../src/backend/utils/fmgr/fmgr.c:1139
#4 0x00007f9eeb68a2f5 in record_hash (key=, keysize=)
at pg_variables_record.c:53
#5 0x0000557057da18c5 in hash_search (hashp=0x557094687de8, keyPtr=0x7ffd92148740, action=HASH_ENTER,
foundPtr=0x7ffd9214873f) at ./build/../src/backend/utils/hash/dynahash.c:961
#6 0x00007f9eeb68aaa7 in insert_record (variable=variable@entry=0x55709467d928,
tupleHeader=) at pg_variables_record.c:447
#7 0x00007f9eeb687e5a in variable_insert (fcinfo=0x55709466c480) at pg_variables.c:847
#8 0x0000557057a5d29a in ExecInterpExpr (state=0x55709466c338, econtext=0x55709466c008,
isnull=) at ./build/../src/backend/executor/execExprInterp.c:926
#9 0x0000557057a946a9 in ExecEvalExprNoReturn (state=0x55709466c338, econtext=0x55709466c008)
at ./build/../src/include/executor/executor.h:419
#10 ExecEvalExprNoReturnSwitchContext (state=0x55709466c338, econtext=0x55709466c008)
at ./build/../src/include/executor/executor.h:460
#11 ExecProject (projInfo=0x55709466c330) at ./build/../src/include/executor/executor.h:492
#12 ExecResult (pstate=) at ./build/../src/backend/executor/nodeResult.c:135
#13 0x0000557057a6105b in ExecProcNode (node=0x55709466bf00)
at ./build/../src/include/executor/executor.h:315
#14 ExecutePlan (queryDesc=0x55709459d308, operation=CMD_SELECT, sendTuples=true, numberTuples=0,
direction=, dest=0x5570945b5228) at ./build/../src/backend/executor/execMain.c:1707
#15 standard_ExecutorRun (queryDesc=0x55709459d308, direction=, count=0)
at ./build/../src/backend/executor/execMain.c:366
#16 0x0000557057c3bca7 in PortalRunSelect (portal=portal@entry=0x55709460abe8,
forward=forward@entry=true, count=0, count@entry=9223372036854775807,
dest=dest@entry=0x5570945b5228) at ./build/../src/backend/tcop/pquery.c:921
#17 0x0000557057c3d2a0 in PortalRun (portal=portal@entry=0x55709460abe8,
count=count@entry=9223372036854775807, isTopLevel=isTopLevel@entry=true,
dest=dest@entry=0x5570945b5228, altdest=altdest@entry=0x5570945b5228, qc=qc@entry=0x7ffd92148bf0)
at ./build/../src/backend/tcop/pquery.c:765
#18 0x0000557057c39068 in exec_simple_query (
query_string=0x55709453b438 "SELECT pgv_insert('vars', 'r2', row('text1')) ;")
at ./build/../src/backend/tcop/postgres.c:1273
#19 0x0000557057c3af6d in PostgresMain (dbname=, username=)
at ./build/../src/backend/tcop/postgres.c:4766
#20 0x0000557057c35433 in BackendMain (startup_data=, startup_data_len=)
at ./build/../src/backend/tcop/backend_startup.c:124
#21 0x0000557057b9347d in postmaster_child_launch (child_type=B_BACKEND, child_slot=1,
startup_data=startup_data@entry=0x7ffd921490f0, startup_data_len=startup_data_len@entry=24,
client_sock=client_sock@entry=0x7ffd92149110)
at ./build/../src/backend/postmaster/launch_backend.c:290
#22 0x0000557057b96f82 in BackendStartup (client_sock=0x7ffd92149110)
at ./build/../src/backend/postmaster/postmaster.c:3587
#23 ServerLoop () at ./build/../src/backend/postmaster/postmaster.c:1702
#24 0x0000557057b98890 in PostmasterMain (argc=argc@entry=3, argv=argv@entry=0x5570944e35a0)
at ./build/../src/backend/postmaster/postmaster.c:1400
#25 0x000055705788eab0 in main (argc=3, argv=0x5570944e35a0) at ./build/../src/backend/main/main.c:227
(gdb)

Explicit type declaration looks good
postgres@e0566661d5f8:~$ psql
psql (18.1 (Debian 18.1-1.pgdg13+2))
Type "help" for help.

postgres=# SELECT pgv_insert('vars', 'r2', row('text1'::text)) ;
pgv_insert

(1 row)

postgres=# select pgv_select('vars','r2');
pgv_select

(text1)
(1 row)

postgres=#
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions