Uploaded image for project: 'MariaDB Connector/node.js'
  1. MariaDB Connector/node.js
  2. CONJS-234

Result seems to have an extra blank row

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • None
    • N/A
    • other
    • None
    • Windows and Linux : 10.6.5 / 10.6.7
      nodejs driver 3.0.2

    Description

      I do a select statement and loop through it, there always seems to be an extra blank row. So I have to check for the "key" to see if it is undefined, so my loop ignores the last row.

      I hope I have my code right and you don't mean to have a blank row at the bottom.

      dlog is a console.log thingy that runs (!production)

       
          const resultEmailAttachments = await mdbConn.query(
            "SELECT * FROM EM_EmailAttachments WHERE EmailID = ? ;", [data.EmailId]
          );
       
          // Build the array of attachments.
          const aAttachList = [];
          const emailAttchData = resultEmailAttachments;
          dlog("AttchData.length", emailAttchData.length);
          if (emailAttchData.length > 0) {
            for (var k in emailAttchData) {
             *{color:red} if (emailAttchData[k].AttachmentFileName) {{color}*
                let aFilePath = path.normalize(emailAttchData[k].AttachmentFileName);
                dlog("emailAttchData.aFilePath", aFilePath);
                let aFileName = path.basename(aFilePath);
                dlog("emailAttchData.aFileName", aFileName);
                let aAttachment = emailAttchData[k].Attachment;
                aAttachList.push({
                  filename: aFileName,
                  content: aAttachment,
                  encoding: "base64",
                });
              }  
            }  dlog("Trace", "leave loop");
          }
      }
      

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            1222tmiller Tom Miller
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.