This is an automated email from the ASF dual-hosted git repository.

yjhjstz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit e91712dbced16a20094557f0e3fa43f7dafbfc16
Author: Jianghua Yang <[email protected]>
AuthorDate: Wed Mar 18 03:14:39 2026 +0800

    Fix SIGSEGV on segments when creating in-place tablespace
    
    When CREATE TABLESPACE ... LOCATION '' is dispatched from QD to QE,
    the serialization converts the empty string to NULL. On the segment,
    pstrdup(stmt->location) crashes with SIGSEGV because stmt->location
    is NULL.
    
    Add a NULL guard to treat NULL the same as empty string, preserving
    in-place tablespace semantics.
    
    Fixes https://github.com/apache/cloudberry/issues/1627
---
 src/backend/commands/tablespace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/commands/tablespace.c 
b/src/backend/commands/tablespace.c
index 2416522d016..00fa8bcfb2a 100644
--- a/src/backend/commands/tablespace.c
+++ b/src/backend/commands/tablespace.c
@@ -328,7 +328,7 @@ CreateTableSpace(CreateTableSpaceStmt *stmt)
        }
 
        if (!location)
-               location = pstrdup(stmt->location);
+               location = pstrdup(stmt->location ? stmt->location : "");
 
        if (stmt->filehandler)
                fileHandler = pstrdup(stmt->filehandler);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to