File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import (
2222 "fmt"
2323 "strings"
2424 "time"
25+ "math"
2526
2627 "github.com/apache/arrow-adbc/go/adbc"
2728 "github.com/apache/arrow-adbc/go/adbc/driver/internal/driverbase"
@@ -59,7 +60,12 @@ func (c *connectionImpl) openSession(ctx context.Context) error {
5960
6061 // Add optional parameters
6162 if heartbeat , ok := sessionOpts ["heartbeatTimeoutInSecond" ].(int64 ); ok {
62- req .HeartbeatTimeoutSec = int (heartbeat )
63+ // Only assign if heartbeat fits in int32 and is positive
64+ if heartbeat > 0 && heartbeat <= math .MaxInt32 {
65+ req .HeartbeatTimeoutSec = int (heartbeat )
66+ } else {
67+ // Optionally log, fallback to default, or skip assignment
68+ }
6369 }
6470 if ttl , ok := sessionOpts ["ttl" ].(string ); ok {
6571 req .TTL = ttl
You can’t perform that action at this time.
0 commit comments