@@ -1061,7 +1061,6 @@ void Connection::Async_Execute (uv_work_t *req)
1061
1061
*/
1062
1062
void Connection::PrepareAndBind (eBaton* executeBaton)
1063
1063
{
1064
- DPI_SZ_TYPE maxSize = 0 ; // maxSize for out bind; add 1 for dml returning
1065
1064
executeBaton->dpistmt = executeBaton->dpiconn ->getStmt (executeBaton->sql );
1066
1065
executeBaton->st = executeBaton->dpistmt ->stmtType ();
1067
1066
executeBaton->stmtIsReturning = executeBaton->dpistmt ->isReturning ();
@@ -1110,26 +1109,15 @@ void Connection::PrepareAndBind (eBaton* executeBaton)
1110
1109
Connection::UpdateDateValue ( executeBaton, index ) ;
1111
1110
}
1112
1111
1113
- /*
1114
- * In case of DML Returning, add 1 extra byte, to check for
1115
- * more data
1116
- */
1117
- if ( ( executeBaton->binds [index]->type == dpi::DpiVarChar) &&
1118
- ( executeBaton->stmtIsReturning ) )
1119
- {
1120
- maxSize = executeBaton->binds [index]->maxSize + 1 ;
1121
- }
1122
- else
1123
- {
1124
- maxSize = executeBaton->binds [index]->maxSize ;
1125
- }
1126
1112
// Bind by name
1127
1113
executeBaton->dpistmt ->bind (
1128
1114
(const unsigned char *)executeBaton->binds [index]->key .c_str (),
1129
1115
(int ) executeBaton->binds [index]->key .length (), index,
1130
1116
executeBaton->binds [index]->type ,
1131
1117
executeBaton->binds [index]->value ,
1132
- (executeBaton->binds [index]->type == dpi::DpiVarChar ) ?
1118
+ (executeBaton->stmtIsReturning &&
1119
+ executeBaton->binds [index]->isOut &&
1120
+ (executeBaton->binds [index]->type == dpi::DpiVarChar))?
1133
1121
(executeBaton->binds [index]->maxSize + 1 ) :
1134
1122
executeBaton->binds [index]->maxSize ,
1135
1123
executeBaton->binds [index]->ind ,
@@ -1168,25 +1156,13 @@ void Connection::PrepareAndBind (eBaton* executeBaton)
1168
1156
Connection::UpdateDateValue ( executeBaton, index ) ;
1169
1157
}
1170
1158
1171
- /*
1172
- * In case of DML Returning, add 1 extra byte, to check for
1173
- * more data
1174
- */
1175
-
1176
- if ( ( executeBaton->binds [index]->type == dpi::DpiVarChar) &&
1177
- ( executeBaton->stmtIsReturning ) )
1178
- {
1179
- maxSize = executeBaton->binds [index]->maxSize + 1 ;
1180
- }
1181
- else
1182
- {
1183
- maxSize = executeBaton->binds [index]->maxSize ;
1184
- }
1185
1159
// Bind by position
1186
1160
executeBaton->dpistmt ->bind (
1187
1161
index+1 ,executeBaton->binds [index]->type ,
1188
1162
executeBaton->binds [index]->value ,
1189
- (executeBaton->binds [index]->type == dpi::DpiVarChar ) ?
1163
+ (executeBaton->stmtIsReturning &&
1164
+ executeBaton->binds [index]->isOut &&
1165
+ (executeBaton->binds [index]->type == dpi::DpiVarChar))?
1190
1166
(executeBaton->binds [index]->maxSize + 1 ) :
1191
1167
executeBaton->binds [index]->maxSize ,
1192
1168
executeBaton->binds [index]->ind ,
0 commit comments