File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -248,6 +248,12 @@ static int PythonFloatToOracleNumber(
248
248
sword status ;
249
249
250
250
doubleValue = PyFloat_AS_DOUBLE (pythonValue );
251
+ if (isnan (doubleValue )) {
252
+ PyErr_SetString (g_DatabaseErrorException ,
253
+ "value is not a number (NaN) and cannot be used in Oracle "
254
+ "numbers" );
255
+ return -1 ;
256
+ }
251
257
status = OCINumberFromReal (environment -> errorHandle , & doubleValue ,
252
258
sizeof (double ), oracleValue );
253
259
return Environment_CheckForError (environment , status ,
Original file line number Diff line number Diff line change 18
18
#include <datetime.h>
19
19
#include <structmember.h>
20
20
#include <time.h>
21
+ #include <math.h>
21
22
#include <oci.h>
22
23
#include <orid.h>
23
24
#include <xa.h>
24
25
26
+ // define isnan for older versions of Visual Studio which only define _isnan
27
+ #ifdef _WIN32
28
+ #ifndef isnan
29
+ #define isnan _isnan
30
+ #endif
31
+ #endif
32
+
25
33
// validate OCI library
26
34
#if !defined(OCI_MAJOR_VERSION ) || (OCI_MAJOR_VERSION < 11 ) || \
27
35
((OCI_MAJOR_VERSION == 11 ) && (OCI_MINOR_VERSION < 2 ))
You can’t perform that action at this time.
0 commit comments