Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
lgeissbauer-btig authored Feb 3, 2023
1 parent 6183a62 commit 27e02ab
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/API.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,35 @@ macro odbc(func,args,vals...)
ret = SQL_SUCCESS
@static if Sys.iswindows() # odbc_dm[] == odbc32
# This branch is guarded by `@static` to avoid issues on Apple Silicon
counter = -100
while true
ret = ccall( ($func, "odbc32"), stdcall, SQLRETURN, $args, $(vals...))
ret == SQL_STILL_EXECUTING || break
sleep(0.001)
if counter > 0
sleep(0.000_001*counter)
end
counter = 1.2*(1 + counter)
end
else
if odbc_dm[] == iODBC
counter = -100
while true
ret = ccall( ($func, iODBC_jll.libiodbc), SQLRETURN, $(swapsqlwchar(args)), $(vals...))
ret == SQL_STILL_EXECUTING || break
sleep(0.001)
if counter > 0
sleep(0.000_001*counter)
end
counter = 1.2*(1 + counter)
end
elseif odbc_dm[] == unixODBC
counter = -100
while true
ret = ccall( ($func, unixODBC_jll.libodbc), SQLRETURN, $args, $(vals...))
ret == SQL_STILL_EXECUTING || break
sleep(0.001)
if counter > 0
sleep(0.000_001*counter)
end
counter = 1.2*(1 + counter)
end
end
end
Expand Down

0 comments on commit 27e02ab

Please sign in to comment.