Skip to content

Commit

Permalink
Fix?
Browse files Browse the repository at this point in the history
  • Loading branch information
lidavidm committed Aug 28, 2023
1 parent e265f17 commit 5472fd1
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 12 deletions.
8 changes: 6 additions & 2 deletions c/driver_manager/adbc_driver_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -642,8 +642,12 @@ const struct AdbcError* AdbcErrorFromArrayStream(struct ArrowArrayStream* stream
return nullptr;
}
auto* private_data = reinterpret_cast<struct ErrorArrayStream*>(stream->private_data);
return private_data->private_driver->ErrorFromArrayStream(&private_data->stream,
status);
auto* error =
private_data->private_driver->ErrorFromArrayStream(&private_data->stream, status);
if (error) {
const_cast<struct AdbcError*>(error)->private_driver = private_data->private_driver;
}
return error;
}

#define INIT_ERROR(ERROR, SOURCE) \
Expand Down
8 changes: 6 additions & 2 deletions go/adbc/drivermgr/adbc_driver_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -642,8 +642,12 @@ const struct AdbcError* AdbcErrorFromArrayStream(struct ArrowArrayStream* stream
return nullptr;
}
auto* private_data = reinterpret_cast<struct ErrorArrayStream*>(stream->private_data);
return private_data->private_driver->ErrorFromArrayStream(&private_data->stream,
status);
auto* error =
private_data->private_driver->ErrorFromArrayStream(&private_data->stream, status);
if (error) {
const_cast<struct AdbcError*>(error)->private_driver = private_data->private_driver;
}
return error;
}

#define INIT_ERROR(ERROR, SOURCE) \
Expand Down
2 changes: 1 addition & 1 deletion go/adbc/pkg/_tmpl/driver.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ func (cStream *cArrayStream) maybeError() C.int {
if cStream.adbcErr != nil {
C.{{.Prefix}}errRelease(cStream.adbcErr)
} else {
cStream.adbcErr = (*C.struct_AdbcError)(C.malloc(C.ADBC_ERROR_1_1_0_SIZE))
cStream.adbcErr = (*C.struct_AdbcError)(C.calloc(1, C.ADBC_ERROR_1_1_0_SIZE))
}
cStream.adbcErr.vendor_code = C.ADBC_ERROR_VENDOR_CODE_PRIVATE_DATA
cStream.status = C.AdbcStatusCode(errToAdbcErr(cStream.adbcErr, err))
Expand Down
5 changes: 4 additions & 1 deletion go/adbc/pkg/_tmpl/utils.h.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ AdbcStatusCode {{.Prefix}}StatementSetSubstraitPlan(struct AdbcStatement* stmt,
AdbcStatusCode {{.Prefix}}DriverInit(int version, void* rawDriver, struct AdbcError* err);

static inline void {{.Prefix}}errRelease(struct AdbcError* error) {
error->release(error);
if (error->release) {
error->release(error);
error->release = NULL;
}
}

void {{.Prefix}}_release_error(struct AdbcError* error);
Expand Down
2 changes: 1 addition & 1 deletion go/adbc/pkg/flightsql/driver.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion go/adbc/pkg/flightsql/utils.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go/adbc/pkg/panicdummy/driver.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion go/adbc/pkg/panicdummy/utils.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go/adbc/pkg/snowflake/driver.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion go/adbc/pkg/snowflake/utils.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5472fd1

Please sign in to comment.