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

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


The following commit(s) were added to refs/heads/main by this push:
     new d2b6fd65e8 [#8036] Improvement: quote table name in 
generateRenameTableSql (#8060)
d2b6fd65e8 is described below

commit d2b6fd65e8a78ddbc64d23a1c58196560362c417
Author: ankamde <[email protected]>
AuthorDate: Thu Aug 14 02:02:35 2025 +0200

    [#8036] Improvement: quote table name in generateRenameTableSql (#8060)
    
    ### What changes were proposed in this pull request?
    
    The SQL generated in generateRenameTableSql in
    
catalogs/catalog-jdbc-postgresql/src/main/java/org/apache/gravitino/catalog/postgresql/operation/PostgreSqlTableOperations.java
    doesn't quote the new table name.
    
    ### Why are the changes needed?
    
    Add quote to newTable variable.
    
    Fix: 8036
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    By running tests.
---
 .../catalog/postgresql/operation/PostgreSqlTableOperations.java  | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git 
a/catalogs/catalog-jdbc-postgresql/src/main/java/org/apache/gravitino/catalog/postgresql/operation/PostgreSqlTableOperations.java
 
b/catalogs/catalog-jdbc-postgresql/src/main/java/org/apache/gravitino/catalog/postgresql/operation/PostgreSqlTableOperations.java
index c2cae935f1..3b889ee673 100644
--- 
a/catalogs/catalog-jdbc-postgresql/src/main/java/org/apache/gravitino/catalog/postgresql/operation/PostgreSqlTableOperations.java
+++ 
b/catalogs/catalog-jdbc-postgresql/src/main/java/org/apache/gravitino/catalog/postgresql/operation/PostgreSqlTableOperations.java
@@ -291,7 +291,14 @@ public class PostgreSqlTableOperations extends 
JdbcTableOperations {
 
   @Override
   protected String generateRenameTableSql(String oldTableName, String 
newTableName) {
-    return ALTER_TABLE + PG_QUOTE + oldTableName + PG_QUOTE + " RENAME TO " + 
newTableName;
+    return ALTER_TABLE
+        + PG_QUOTE
+        + oldTableName
+        + PG_QUOTE
+        + " RENAME TO "
+        + PG_QUOTE
+        + newTableName
+        + PG_QUOTE;
   }
 
   @Override

Reply via email to