Re: BUG #17909: CREATE SCHEMA AUTHORIZATION sch CREATE TABLE foo ( id INT ) will coredump

Поиск
Список
Период
Сортировка
От Richard Guo
Тема Re: BUG #17909: CREATE SCHEMA AUTHORIZATION sch CREATE TABLE foo ( id INT ) will coredump
Дата
Msg-id CAMbWs4-f5w+YCzqd90YAS-ogPxoahzfJ7C1QUUo8X+KE=0UC4w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #17909: CREATE SCHEMA AUTHORIZATION sch CREATE TABLE foo ( id INT ) will coredump  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: BUG #17909: CREATE SCHEMA AUTHORIZATION sch CREATE TABLE foo ( id INT ) will coredump  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-bugs

On Thu, Apr 27, 2023 at 3:34 PM Michael Paquier <michael@paquier.xyz> wrote:
It took me a couple of minutes to get what you meant here.  The point
is that schema-qualifying any of the object specified after the CREATE
SCHEMA with a schema name different than the rolname would cause a
crash, when no schema is directly given.  We should fail with the same
error than when a schema is specified, as of, except that the rolename
needs to be specified:
=# create schema popo authorization postgres create table lala.aa (a int);
ERROR:  42P15: CREATE specifies a schema (lala) different from the one being created (popo)

Aha, now I get the scenario that would crash.

# create schema authorization postgres create table lala.aa (a int);
server closed the connection unexpectedly

In this case the CreateSchemaStmtContext.schemaname is NULL since it is
not explicitly specified, while the schemaname in the schema element is
not NULL as it is specified, and setSchemaName cannot copy with such
situation.  Maybe we should check against RoleSpec.rolename in this case
since that is also the schema's name?
 
That seems quite old, at quick glance (v11 fails), so this needs to be
fixed all the way down.

Yes.  I can see this crash from master all back to v9.5.

Thanks
Richard

В списке pgsql-bugs по дате отправления:

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #17910: gcc-introduced load may cause concurrency bug
Следующее
От: Daniel Gustafsson
Дата:
Сообщение: Re: BUG #17910: gcc-introduced load may cause concurrency bug