Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-1545648: Fix PUT command error if file path contains spaces and single quotes #1066

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

sfc-gh-ext-simba-lf
Copy link
Collaborator

Description

Fix PUT command error if file path contains spaces and single quotes

Checklist

  • Code compiles correctly
  • Code is formatted according to Coding Conventions
  • Created tests which fail without the change (if possible)
  • All tests passing (dotnet test)
  • Extended the README / documentation, if necessary
  • Provide JIRA issue id (if possible) or GitHub issue id in PR name

Copy link

codecov bot commented Nov 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.30%. Comparing base (4c44f1f) to head (e7302a0).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1066      +/-   ##
==========================================
+ Coverage   86.23%   86.30%   +0.06%     
==========================================
  Files         121      121              
  Lines       11845    11849       +4     
  Branches     1212     1213       +1     
==========================================
+ Hits        10215    10226      +11     
+ Misses       1338     1334       -4     
+ Partials      292      289       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

{
// Extract file path from PUT command:
// E.g. "PUT file://C:<path-to-file> @DB.SCHEMA.%TABLE;"
int startIndex = query.IndexOf("file://") + "file://".Length;
int endIndex = query.Substring(startIndex).IndexOf('@') - 1;
string filePath = query.Substring(startIndex, endIndex);
string filePath = query.Substring(startIndex, endIndex).Trim();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe TrimEnd() would be better because we just want to trim trailing spaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants