Skip to content

Commit 8d96a7c

Browse files
committed
Fixed problem with types of null values on execute
When a statement containing host variables was executed, null values could cause the execute to fail depending on the types of the columns. Change-Id: I83781f4419411abe4c2e8f39ee52e69ae2032b2c
1 parent 2eb9f88 commit 8d96a7c

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"author": "SQL ANYWHERE ",
2+
"author": "SQL ANYWHERE",
33
"name": "sqlanywhere",
44
"description": "SQL Anywhere JavaScript Driver.",
5-
"version": "1.0.19",
5+
"version": "1.0.20",
66
"repository": {
77
"url": "https://github.com/sqlanywhere/node-sqlanywhere"
88
},

src/sqlanywhere.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,11 @@ void executeWork( uv_work_t *req )
134134
return;
135135
}
136136

137-
param.value.type = baton->params[i].value.type;
137+
if( param.value.type == A_INVALID_TYPE &&
138+
( baton->params[i].value.is_null == NULL ||
139+
!(*(baton->params[i].value.is_null)) ) ) {
140+
param.value.type = baton->params[i].value.type;
141+
}
138142
param.value.buffer = baton->params[i].value.buffer;
139143
param.value.is_address = baton->params[i].value.is_address;
140144

src/sqlanywhere_v0_10.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,11 @@ void executeWork( uv_work_t *req )
126126
return;
127127
}
128128

129-
param.value.type = baton->params[i].value.type;
129+
if( param.value.type == A_INVALID_TYPE &&
130+
( baton->params[i].value.is_null == NULL ||
131+
!(*(baton->params[i].value.is_null)) ) ) {
132+
param.value.type = baton->params[i].value.type;
133+
}
130134
param.value.buffer = baton->params[i].value.buffer;
131135
param.value.is_address = baton->params[i].value.is_address;
132136

0 commit comments

Comments
 (0)