BUG #5072: User trying to drop an internally dependent object crashes server
| От | Amit Khandekar |
|---|---|
| Тема | BUG #5072: User trying to drop an internally dependent object crashes server |
| Дата | |
| Msg-id | 200909221216.n8MCGw0a010155@wwwmaster.postgresql.org обсуждение исходный текст |
| Ответы |
Re: BUG #5072: User trying to drop an internally dependent object crashes server
|
| Список | pgsql-bugs |
The following bug has been logged online:
Bug reference: 5072
Logged by: Amit Khandekar
Email address: amit.khandekar@enterprisedb.com
PostgreSQL version: 8.5devel
Operating system: All
Description: User trying to drop an internally dependent object
crashes server
Details:
If a DROP command is issued for an object that is actually a part of
internal implementation of another object, then the command crashes the
server.
For e.g. a rule with name "_RETURN" is internally created when a user
creates
a view. This object dependency is stored in pg_depend with deptype
DEPENDENCY_INTERNAL.
postgres=# CREATE VIEW fooview AS SELECT 'foo'::text;
CREATE VIEW
postgres=# DROP RULE "_RETURN" ON fooview;
server closed the connection unexpectedly
This probably means the server terminated abno
before or while processing the request.
The function object_address_present() in src/backend/catalog/dependency.c
assumes that the address list is always a non-NULL argument even though the
number of addresses can be zero. Whereas in the above scenario, the address
list is NULL. A simple address check such as below will fix this issue :
bool
object_address_present(const ObjectAddress *object,
const ObjectAddresses *addrs)
{
+ if (!addrs)
+ return false;
........
........
}
В списке pgsql-bugs по дате отправления: