citus/src/backend/distributed/deparser
Nils Dijk 268ad741a9
Refactor the deparsing of a CREATE EXTENSION to prevent NULL POINTER dereferences (#3518)
DESCRIPTION: satisfy static analysis tool for a nullptr dereference

During the static analysis project on the codebase this code has been flagged as having the potential for a null pointer dereference. Funnily enough the author had already made a comment of it in the code this was not possible due to us setting the schema name before we pass in the statement. If we want to reuse this code in a later setting this comment might not always apply and we could actually run into null pointer dereference.

This patch changes a bit of the code around to first of all make sure there is no NULL pointer dereference in this code anymore.
Secondly we allow for better deparsing by setting and adhering to the `if_not_exists` flag on the statement.
And finally add support for all syntax described in the documentation of postgres (FROM was missing).
2020-03-04 16:47:07 +01:00
..
citus_ruleutils.c Semmle: Fix possible infite loops caused by overflow (#3503) 2020-02-17 14:35:10 +01:00
deparse.c Introduce GetDistributeObjectOps to organize dispatch of logic dependent on node/object type 2020-01-09 18:24:29 +00:00
deparse_attribute_stmts.c Introduce GetDistributeObjectOps to organize dispatch of logic dependent on node/object type 2020-01-09 18:24:29 +00:00
deparse_collation_stmts.c Introduce GetDistributeObjectOps to organize dispatch of logic dependent on node/object type 2020-01-09 18:24:29 +00:00
deparse_extension_stmts.c Refactor the deparsing of a CREATE EXTENSION to prevent NULL POINTER dereferences (#3518) 2020-03-04 16:47:07 +01:00
deparse_function_stmts.c Propagate DROP ROUTINE, ALTER ROUTINE 2020-01-13 15:37:46 +00:00
deparse_role_stmts.c Introduce GetDistributeObjectOps to organize dispatch of logic dependent on node/object type 2020-01-09 18:24:29 +00:00
deparse_schema_stmts.c Adds propagation for grant on schema commands 2020-01-20 14:51:28 +03:00
deparse_table_stmts.c Adds alter table schema propagation 2020-01-16 17:04:16 +03:00
deparse_type_stmts.c Semmle: Fix obvious issues (#3502) 2020-02-21 10:16:00 +01:00
format_collate.c remove copyright years (#3286) 2019-12-11 21:14:08 +03:00
objectaddress.c Introduce GetDistributeObjectOps to organize dispatch of logic dependent on node/object type 2020-01-09 18:24:29 +00:00
qualify.c Introduce GetDistributeObjectOps to organize dispatch of logic dependent on node/object type 2020-01-09 18:24:29 +00:00
qualify_collation_stmt.c Introduce GetDistributeObjectOps to organize dispatch of logic dependent on node/object type 2020-01-09 18:24:29 +00:00
qualify_function_stmt.c Propagate DROP ROUTINE, ALTER ROUTINE 2020-01-13 15:37:46 +00:00
qualify_table_stmt.c Adds alter table schema propagation 2020-01-16 17:04:16 +03:00
qualify_type_stmt.c Introduce GetDistributeObjectOps to organize dispatch of logic dependent on node/object type 2020-01-09 18:24:29 +00:00
ruleutils_11.c For composite types, add cast to the parameter to ease remote node detect 2020-03-04 11:27:45 +01:00
ruleutils_12.c For composite types, add cast to the parameter to ease remote node detect 2020-03-04 11:27:45 +01:00