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

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


The following commit(s) were added to refs/heads/main by this push:
     new 312426e2a7 Fix null when executing SQL in SQLFileOutputDialog (#6893)
312426e2a7 is described below

commit 312426e2a7ef807be27cbf877be437e1489d2111
Author: Lance <[email protected]>
AuthorDate: Mon Mar 30 13:46:40 2026 +0800

    Fix null when executing SQL in SQLFileOutputDialog (#6893)
    
    * Fix SQLFileOutputMeta.getFile()=null
    
    Signed-off-by: lance <[email protected]>
    
    * Fix test log channel
    
    Signed-off-by: lance <[email protected]>
    
    ---------
    
    Signed-off-by: lance <[email protected]>
---
 .../transforms/sqlfileoutput/SQLFileOutputDialog.java     | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git 
a/plugins/transforms/sqlfileoutput/src/main/java/org/apache/hop/pipeline/transforms/sqlfileoutput/SQLFileOutputDialog.java
 
b/plugins/transforms/sqlfileoutput/src/main/java/org/apache/hop/pipeline/transforms/sqlfileoutput/SQLFileOutputDialog.java
index a6d8e3d575..83307c2cee 100644
--- 
a/plugins/transforms/sqlfileoutput/src/main/java/org/apache/hop/pipeline/transforms/sqlfileoutput/SQLFileOutputDialog.java
+++ 
b/plugins/transforms/sqlfileoutput/src/main/java/org/apache/hop/pipeline/transforms/sqlfileoutput/SQLFileOutputDialog.java
@@ -694,13 +694,7 @@ public class SQLFileOutputDialog extends 
BaseTransformDialog {
           }
         });
 
-    FormData fdContentComp = new FormData();
-    fdContentComp.left = new FormAttachment(0, 0);
-    fdContentComp.top = new FormAttachment(0, 0);
-    fdContentComp.right = new FormAttachment(100, 0);
-    fdContentComp.bottom = new FormAttachment(100, 0);
     wContentComp.setLayoutData(wContentComp);
-
     wContentComp.layout();
     wContentTab.setControl(wContentComp);
 
@@ -898,20 +892,23 @@ public class SQLFileOutputDialog extends 
BaseTransformDialog {
   private void sql() {
     try {
       SQLFileOutputMeta info = new SQLFileOutputMeta();
+      // set default value
+      info.setDefault();
+
       getInfo(info);
       IRowMeta prev = pipelineMeta.getPrevTransformFields(variables, 
transformName);
 
       TransformMeta transformMeta = pipelineMeta.findTransform(transformName);
-      DatabaseMeta databaseMeta = 
pipelineMeta.findDatabase(transformMeta.getName(), variables);
+      DatabaseMeta databaseMeta = 
pipelineMeta.findDatabase(info.getConnection(), variables);
 
       SqlStatement sql =
           info.getSqlStatements(variables, pipelineMeta, transformMeta, prev, 
metadataProvider);
       if (!sql.hasError()) {
         if (sql.hasSql()) {
-          SqlEditor sqledit =
+          SqlEditor editor =
               new SqlEditor(
                   shell, SWT.NONE, variables, databaseMeta, 
DbCache.getInstance(), sql.getSql());
-          sqledit.open();
+          editor.open();
         } else {
           MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_INFORMATION);
           mb.setMessage(BaseMessages.getString(PKG, 
"SQLFileOutputDialog.NoSQL.DialogMessage"));

Reply via email to