Skip to content

Server crashes when executing several queries. Errors in "columnTypeOid" function. #39

@Gudwlin

Description

@Gudwlin

Describe the bug
Server crashes when executing the following psql commands. Error in "columnTypeOid" function.

What data setup do we need to do?
BemiDB(main) with PostgreSQL (REL_17_STABLE).

What is the necessary configuration info needed?
My PostgreSQL configuration:

./configure

What is the commands that caused the error?
1

psql postgres://localhost:54321/bemidb -c "SELECT now() FROM generate_series(1, 10);"

2

psql postgres://localhost:54321/bemidb -c "SELECT pg_indexes FROM pg_indexes WHERE tablename = 'tbl_gist' ORDER BY indexname;"

3

psql postgres://localhost:54321/bemidb -c "select pg_proc from pg_proc where proname ilike '00%foo' order by 1;"

4

psql postgres://localhost:54321/bemidb -c "SELECT array_agg(x) || array_agg(x) FROM (VALUES (ROW(1,2)), (ROW(3,4))) v(x);"

5

psql postgres://localhost:54321/bemidb -c "select array_agg(array[i, nullif(i, 3), i+1]) from generate_series(1,4) g(i);"

6

psql postgres://localhost:54321/bemidb -c "SELECT INTERVAL '01:00' AS "One hour";"

7

psql postgres://localhost:54321/bemidb -c "SELECT ARRAY[ARRAY[ARRAY[ARRAY[ARRAY[ARRAY['hello'], ARRAY['world']]]]]];"

8

psql postgres://localhost:54321/bemidb -c "SELECT x, 'txt' || x as y
FROM generate_series(1,3) AS x;"

backtrace:
1

panic: Unsupported column type: TIMESTAMPTZ

goroutine 674077 [running]:
main.(*QueryHandler).columnTypeOid(0xc000831c88?, 0xc0009e25a0)
 /app/query_handler.go:478 +0x665
main.(*QueryHandler).generateRowDescription(0xc00012dac0, {0xc000e2b2e8, 0x1, 0xc00081eba0?})
 /app/query_handler.go:391 +0xb7
main.(*QueryHandler).rowsToDescriptionMessages(0xc00012dac0, 0x2be3820?, {0xc00081eba0, 0x28})
 /app/query_handler.go:344 +0x51
main.(*QueryHandler).HandleQuery(0xc00012dac0, {0xc00081eb70, 0x29})
 /app/query_handler.go:196 +0x332
main.(*Postgres).handleSimpleQuery(0xc000b99530, 0xc00012dac0, 0xc000136b00)
 /app/postgres.go:95 +0xb6
main.(*Postgres).Run(0xc000b99530, 0xc00012dac0)
 /app/postgres.go:73 +0xd7
main.start.func1()
 /app/main.go:63 +0x45
created by main.start in goroutine 1
 /app/main.go:62 +0x1c5

2

panic: Unsupported column type: STRUCT("schemaname" VARCHAR, "tablename" VARCHAR, "indexname" VARCHAR, "tablespace" INTEGER, "indexdef" VARCHAR)

goroutine 30060 [running]:
main.(*QueryHandler).columnTypeOid(0xc0008c3c88?, 0xc000c12410)
 /app/query_handler.go:478 +0x665
main.(*QueryHandler).generateRowDescription(0xc0005684e0, {0xc00095a1e8, 0x1, 0xc00088c120?})
 /app/query_handler.go:391 +0xb7
main.(*QueryHandler).rowsToDescriptionMessages(0xc0005684e0, 0x2be3820?, {0xc00088c120, 0x51})
 /app/query_handler.go:344 +0x51
main.(*QueryHandler).HandleQuery(0xc0005684e0, {0xc00088c0c0, 0x52})
 /app/query_handler.go:196 +0x332
main.(*Postgres).handleSimpleQuery(0xc000a8ba88, 0xc0005684e0, 0xc0007941a0)
 /app/postgres.go:95 +0xb6
main.(*Postgres).Run(0xc000a8ba88, 0xc0005684e0)
 /app/postgres.go:73 +0xd7
main.start.func1()
 /app/main.go:63 +0x45
created by main.start in goroutine 1
 /app/main.go:62 +0x1c5

3

panic: Unsupported column type: STRUCT("oid" BIGINT, "proname" VARCHAR, "pronamespace" BIGINT, "proowner" INTEGER, "prolang" INTEGER, "procost" INTEGER, "prorows" INTEGER, "provariadic" VARCHAR, "prosupport" INTEGER, "prokind" VARCHAR, "prosecdef" BOOLEAN, "proleakproof" BOOLEAN, "proisstrict" BOOLEAN, "proretset" BOOLEAN, "provolatile" VARCHAR, "proparallel" VARCHAR, "pronargs" BIGINT, "pronargdefaults" INTEGER, "prorettype" VARCHAR, "proargtypes" VARCHAR[], "proallargtypes" INTEGER, "proargmodes" INTEGER, "proargnames" VARCHAR[], "proargdefaults" INTEGER, "protrftypes" INTEGER, "prosrc" INTEGER, "probin" INTEGER, "prosqlbody" VARCHAR, "proconfig" INTEGER, "proacl" INTEGER, "proisagg" BOOLEAN)

goroutine 149103 [running]:
main.(*QueryHandler).columnTypeOid(0xc00005bc88?, 0xc0007bda90)
 /app/query_handler.go:478 +0x665
main.(*QueryHandler).generateRowDescription(0xc0000a4ae0, {0xc000c8ff78, 0x1, 0xc000165680?})
 /app/query_handler.go:391 +0xb7
main.(*QueryHandler).rowsToDescriptionMessages(0xc0000a4ae0, 0xc000c1f220?, {0xc000165680, 0x43})
 /app/query_handler.go:344 +0x51
main.(*QueryHandler).HandleQuery(0xc0000a4ae0, {0xc000165630, 0x44})
 /app/query_handler.go:196 +0x332
main.(*Postgres).handleSimpleQuery(0xc0006cdc08, 0xc0000a4ae0, 0xc0006d81a0)
 /app/postgres.go:95 +0xb6
main.(*Postgres).Run(0xc0006cdc08, 0xc0000a4ae0)
 /app/postgres.go:73 +0xd7
main.start.func1()
 /app/main.go:63 +0x45
created by main.start in goroutine 1
 /app/main.go:62 +0x1c5

4

panic: Unsupported column type: STRUCT("" INTEGER, "" INTEGER)[]

goroutine 15984 [running]:
main.(*QueryHandler).columnTypeOid(0xc000b57c88?, 0xc000c33360)
 /app/query_handler.go:478 +0x665
main.(*QueryHandler).generateRowDescription(0xc000526340, {0xc001d721f8, 0x1, 0xc00004d540?})
 /app/query_handler.go:391 +0xb7
main.(*QueryHandler).rowsToDescriptionMessages(0xc000526340, 0x2be3820?, {0xc00004d540, 0x4f})
 /app/query_handler.go:344 +0x51
main.(*QueryHandler).HandleQuery(0xc000526340, {0xc00004d4f0, 0x4e})
 /app/query_handler.go:196 +0x332
main.(*Postgres).handleSimpleQuery(0xc000afc318, 0xc000526340, 0xc0005b50a0)
 /app/postgres.go:95 +0xb6
main.(*Postgres).Run(0xc000afc318, 0xc000526340)
 /app/postgres.go:73 +0xd7
main.start.func1()
 /app/main.go:63 +0x45
created by main.start in goroutine 1
 /app/main.go:62 +0x1c5

5

panic: Unsupported column type: BIGINT[][]

goroutine 15764 [running]:
main.(*QueryHandler).columnTypeOid(0xc000f3dc88?, 0xc0013be140)
 /app/query_handler.go:478 +0x665
main.(*QueryHandler).generateRowDescription(0xc0007040a0, {0xc001018f00, 0x1, 0xc000fb2a50?})
 /app/query_handler.go:391 +0xb7
main.(*QueryHandler).rowsToDescriptionMessages(0xc0007040a0, 0x2be3820?, {0xc000fb2a50, 0x4f})
 /app/query_handler.go:344 +0x51
main.(*QueryHandler).HandleQuery(0xc0007040a0, {0xc000fb2a00, 0x4d})
 /app/query_handler.go:196 +0x332
main.(*Postgres).handleSimpleQuery(0xc000eaab88, 0xc0007040a0, 0xc000916740)
 /app/postgres.go:95 +0xb6
main.(*Postgres).Run(0xc000eaab88, 0xc0007040a0)
 /app/postgres.go:73 +0xd7
main.start.func1()
 /app/main.go:63 +0x45
created by main.start in goroutine 1
 /app/main.go:62 +0x1c5

6

panic: Unsupported column type: INTERVAL

goroutine 2265 [running]:
main.(*QueryHandler).columnTypeOid(0xc000b91c88?, 0xc0007b0230)
 /app/query_handler.go:478 +0x665
main.(*QueryHandler).generateRowDescription(0xc0001370c0, {0xc000c981e8, 0x1, 0xc000e0c1b0?})
 /app/query_handler.go:391 +0xb7
main.(*QueryHandler).rowsToDescriptionMessages(0xc0001370c0, 0x2be3820?, {0xc000e0c1b0, 0x26})
 /app/query_handler.go:344 +0x51
main.(*QueryHandler).HandleQuery(0xc0001370c0, {0xc000e0c180, 0x26})
 /app/query_handler.go:196 +0x332
main.(*Postgres).handleSimpleQuery(0xc0005d03d8, 0xc0001370c0, 0xc00090c1a0)
 /app/postgres.go:95 +0xb6
main.(*Postgres).Run(0xc0005d03d8, 0xc0001370c0)
 /app/postgres.go:73 +0xd7
main.start.func1()
 /app/main.go:63 +0x45
created by main.start in goroutine 1
 /app/main.go:62 +0x1c5

7

panic: Unsupported column type: VARCHAR[][][][][][]

goroutine 2808 [running]:
main.(*QueryHandler).columnTypeOid(0xc00005bc88?, 0xc0007b2500)
 /app/query_handler.go:478 +0x665
main.(*QueryHandler).generateRowDescription(0xc00069ace0, {0xc000c19840, 0x1, 0xc000715ea0?})
 /app/query_handler.go:391 +0xb7
main.(*QueryHandler).rowsToDescriptionMessages(0xc00069ace0, 0x2be3820?, {0xc000715ea0, 0x48})
 /app/query_handler.go:344 +0x51
main.(*QueryHandler).HandleQuery(0xc00069ace0, {0xc0006b0f00, 0x2a})
 /app/query_handler.go:196 +0x332
main.(*Postgres).handleSimpleQuery(0xc000994cf0, 0xc00069ace0, 0xc0006a4b00)
 /app/postgres.go:95 +0xb6
main.(*Postgres).Run(0xc000994cf0, 0xc00069ace0)
 /app/postgres.go:73 +0xd7
main.start.func1()
 /app/main.go:63 +0x45
created by main.start in goroutine 1
 /app/main.go:62 +0x1c5

8

panic: Unsupported column type: STRUCT("generate_series" BIGINT)

goroutine 5597 [running]:
main.(*QueryHandler).columnTypeOid(0xc00005bc88?, 0xc0008420a0)
 /app/query_handler.go:478 +0x665
main.(*QueryHandler).generateRowDescription(0xc00059c0e0, {0xc000b01cd0, 0x2, 0xc000596dc0?})
 /app/query_handler.go:391 +0xb7
main.(*QueryHandler).rowsToDescriptionMessages(0xc00059c0e0, 0x2be3820?, {0xc000596dc0, 0x36})
 /app/query_handler.go:344 +0x51
main.(*QueryHandler).HandleQuery(0xc00059c0e0, {0xc000596d80, 0x39})
 /app/query_handler.go:196 +0x332
main.(*Postgres).handleSimpleQuery(0xc000c16048, 0xc00059c0e0, 0xc00096a1a0)
 /app/postgres.go:95 +0xb6
main.(*Postgres).Run(0xc000c16048, 0xc00059c0e0)
 /app/postgres.go:73 +0xd7
main.start.func1()
 /app/main.go:63 +0x45
created by main.start in goroutine 1
 /app/main.go:62 +0x1c5

Expected behavior
Expected ERROR to be shown or sql query to be successfully executed

Best regards,
Artyom Zarubin
Postgres Professional: https://postgrespro.com/

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