Skip to content

Commit

Permalink
SNOW-979081: Fix windows binds
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-dprzybysz committed Jul 29, 2024
1 parent f650eb3 commit e748908
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions bindings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ void ExecuteQuery(const FunctionCallbackInfo<Value>& args) {
GENERIC_LOG_TRACE("Number of binds is %d", number_of_binds);
SF_BIND_INPUT* input_array = (SF_BIND_INPUT*) malloc(number_of_binds * sizeof (SF_BIND_INPUT));
int64 paramInteger;
char* paramString;
char paramString[1024];
for (int64 i = 0; i < number_of_binds; ++i){
GENERIC_LOG_TRACE("Creating bind param %d", i);
snowflake_bind_input_init(&input_array[i]);
Expand All @@ -303,7 +303,7 @@ void ExecuteQuery(const FunctionCallbackInfo<Value>& args) {
} else if (bindValue->IsString()) {
String::Utf8Value str(isolate, bindValue.As<String>());
string cppStr(*str);
paramString = (char*) cppStr.c_str(); // TODO how to allow to borrow value in a correct way?
strcpy(paramString, cppStr.c_str()); // TODO how to allow to borrow value in a correct way?
GENERIC_LOG_TRACE("Setting bind param[%d] as string to %s, length %d", i, paramString, strlen(paramString));
input_array[i].c_type = SF_C_TYPE_STRING;
input_array[i].value = paramString;
Expand Down
6 changes: 1 addition & 5 deletions test/integration/generic/generic_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ describe.only('test generic binding', () => {
};

before(() => {
if (process.platform === 'win32') {
generic.init('FATAL');
} else {
generic.init('FATAL');
}
generic.init('ERROR');
});

it('should get libsfclient version', () => {
Expand Down

0 comments on commit e748908

Please sign in to comment.