Skip to content

Commit

Permalink
fix build/test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-ext-simba-hx committed Dec 19, 2024
1 parent d14c285 commit f57e7a1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
7 changes: 1 addition & 6 deletions lib/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1990,7 +1990,6 @@ cJSON* STDCALL _snowflake_get_binding_json(SF_STMT* sfstmt, int64 index)
const char* type;
char name_buf[SF_PARAM_NAME_BUF_LEN];
char* name = NULL;
char* value = NULL;
cJSON* bindings = NULL;

if (_snowflake_get_current_param_style(sfstmt) == INVALID_PARAM_TYPE)
Expand Down Expand Up @@ -2602,10 +2601,9 @@ SF_STATUS STDCALL snowflake_execute_with_capture(SF_STMT *sfstmt, SF_QUERY_RESUL

static SF_STATUS _snowflake_execute_with_binds_ex(SF_STMT* sfstmt,
sf_bool is_put_get_command,
sf_bool is_native_put_get,
SF_QUERY_RESULT_CAPTURE* result_capture,
sf_bool is_describe_only,
cJSON* bind_stage,
char* bind_stage,
cJSON* bindings)
{
SF_STATUS ret = SF_STATUS_ERROR_GENERAL;
Expand Down Expand Up @@ -2886,7 +2884,6 @@ static SF_STATUS _batch_dml_execute(SF_STMT* sfstmt,
{
bindings = _snowflake_get_binding_json(sfstmt, i);
ret = _snowflake_execute_with_binds_ex(sfstmt,
SF_BOOLEAN_FALSE,
SF_BOOLEAN_FALSE,
result_capture,
SF_BOOLEAN_FALSE,
Expand Down Expand Up @@ -2943,7 +2940,6 @@ SF_STATUS STDCALL _snowflake_execute_ex(SF_STMT *sfstmt,
{
ret = _snowflake_execute_with_binds_ex(sfstmt,
is_put_get_command,
is_native_put_get,
result_capture,
SF_BOOLEAN_TRUE,
NULL, NULL);
Expand Down Expand Up @@ -2976,7 +2972,6 @@ SF_STATUS STDCALL _snowflake_execute_ex(SF_STMT *sfstmt,

return _snowflake_execute_with_binds_ex(sfstmt,
is_put_get_command,
is_native_put_get,
result_capture,
is_describe_only,
bind_stage,
Expand Down
14 changes: 9 additions & 5 deletions tests/test_bind_params.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,16 +394,20 @@ void test_array_binding_supported_false(void** unused) {
dump_error(&(stmt->error));
}
assert_int_equal(status, SF_STATUS_SUCCESS);
const char* result = NULL;
char* result = NULL;
size_t value_len = 0;
size_t max_value_size = 0;

snowflake_column_as_const_str(stmt, 1, &result);
snowflake_column_as_str(stmt, 1, &result, &value_len, &max_value_size);
assert_string_equal(result, bind_data_a[i]);
snowflake_column_as_const_str(stmt, 2, &result);
snowflake_column_as_str(stmt, 2, &result, &value_len, &max_value_size);
assert_string_equal(result, bind_data_b[i]);
snowflake_column_as_const_str(stmt, 3, &result);
snowflake_column_as_str(stmt, 3, &result, &value_len, &max_value_size);
assert_string_equal(result, bind_data_c[i]);
snowflake_column_as_const_str(stmt, 4, &result);
snowflake_column_as_str(stmt, 4, &result, &value_len, &max_value_size);
assert_string_equal(result, bind_data_d[i]);

free(result);
}

snowflake_stmt_term(stmt);
Expand Down

0 comments on commit f57e7a1

Please sign in to comment.