@@ -69,7 +69,7 @@ extern GLOBAL_VALUES globals;
69
69
* How to map ODBC scalar functions {fn func(args)} to Postgres.
70
70
* This is just a simple substitution. List augmented from:
71
71
* http://www.merant.com/datadirect/download/docs/odbc16/Odbcref/rappc.htm
72
- * - thomas 2000-04-03
72
+ * - thomas 2000-04-03
73
73
*/
74
74
char * mapFuncs [][2 ] = {
75
75
/* { "ASCII", "ascii" }, */
@@ -199,9 +199,7 @@ copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2
199
199
*/
200
200
201
201
if (bind_size > 0 )
202
- {
203
202
pcbValueOffset = rgbValueOffset = (bind_size * bind_row );
204
- }
205
203
else
206
204
{
207
205
pcbValueOffset = bind_row * sizeof (SDWORD );
@@ -221,9 +219,10 @@ copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2
221
219
222
220
if (!value )
223
221
{
222
+
224
223
/*
225
- * handle a null just by returning SQL_NULL_DATA in pcbValue,
226
- * and doing nothing to the buffer.
224
+ * handle a null just by returning SQL_NULL_DATA in pcbValue, and
225
+ * doing nothing to the buffer.
227
226
*/
228
227
if (pcbValue )
229
228
* (SDWORD * ) ((char * ) pcbValue + pcbValueOffset ) = SQL_NULL_DATA ;
@@ -242,18 +241,18 @@ copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2
242
241
}
243
242
244
243
/*
245
- * First convert any specific postgres types into more
246
- * useable data.
244
+ * First convert any specific postgres types into more useable data.
247
245
*
248
- * NOTE: Conversions from PG char/varchar of a date/time/timestamp
249
- * value to SQL_C_DATE,SQL_C_TIME, SQL_C_TIMESTAMP not supported
246
+ * NOTE: Conversions from PG char/varchar of a date/time/timestamp value
247
+ * to SQL_C_DATE,SQL_C_TIME, SQL_C_TIMESTAMP not supported
250
248
*/
251
249
switch (field_type )
252
250
{
253
- /*
254
- * $$$ need to add parsing for date/time/timestamp strings in
255
- * PG_TYPE_CHAR,VARCHAR $$$
256
- */
251
+
252
+ /*
253
+ * $$$ need to add parsing for date/time/timestamp strings in
254
+ * PG_TYPE_CHAR,VARCHAR $$$
255
+ */
257
256
case PG_TYPE_DATE :
258
257
sscanf (value , "%4d-%2d-%2d" , & st .y , & st .m , & st .d );
259
258
break ;
@@ -269,9 +268,10 @@ copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2
269
268
sscanf (value , "%4d-%2d-%2d %2d:%2d:%2d" , & st .y , & st .m , & st .d , & st .hh , & st .mm , & st .ss );
270
269
else
271
270
{
271
+
272
272
/*
273
- * The timestamp is invalid so set
274
- * something conspicuous, like the epoch
273
+ * The timestamp is invalid so set something conspicuous,
274
+ * like the epoch
275
275
*/
276
276
t = 0 ;
277
277
tim = localtime (& t );
@@ -295,7 +295,7 @@ copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2
295
295
}
296
296
break ;
297
297
298
- /* This is for internal use by SQLStatistics() */
298
+ /* This is for internal use by SQLStatistics() */
299
299
case PG_TYPE_INT2VECTOR :
300
300
{
301
301
int nval ,
@@ -379,6 +379,7 @@ copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2
379
379
if (fCType == SQL_C_CHAR )
380
380
{
381
381
/* Special character formatting as required */
382
+
382
383
/*
383
384
* These really should return error if cbValueMax is not big
384
385
* enough.
@@ -483,6 +484,7 @@ copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2
483
484
}
484
485
else
485
486
{
487
+
486
488
/*
487
489
* for SQL_C_CHAR, it's probably ok to leave currency symbols in.
488
490
* But to convert to numeric types, it is necessary to get rid of
@@ -780,8 +782,10 @@ copy_statement_with_parameters(StatementClass *stmt)
780
782
781
783
#ifdef MULTIBYTE
782
784
char * end = multibyte_strchr (begin , '}' );
785
+
783
786
#else
784
787
char * end = strchr (begin , '}' );
788
+
785
789
#endif
786
790
787
791
if (!end )
@@ -806,6 +810,7 @@ copy_statement_with_parameters(StatementClass *stmt)
806
810
* end = '}' ;
807
811
continue ;
808
812
}
813
+
809
814
/*
810
815
* Can you have parameter markers inside of quotes? I dont think
811
816
* so. All the queries I've seen expect the driver to put quotes
@@ -1101,9 +1106,7 @@ copy_statement_with_parameters(StatementClass *stmt)
1101
1106
case SQL_LONGVARBINARY :
1102
1107
1103
1108
if (stmt -> parameters [param_number ].data_at_exec )
1104
- {
1105
1109
lobj_oid = stmt -> parameters [param_number ].lobj_oid ;
1106
- }
1107
1110
else
1108
1111
{
1109
1112
/* begin transaction if needed */
@@ -1308,14 +1311,16 @@ convert_escape(char *value)
1308
1311
1309
1312
if ((strcmp (key , "d" ) == 0 ) ||
1310
1313
(strcmp (key , "t" ) == 0 ) ||
1311
- (strcmp (key , "oj" ) == 0 ) || /* {oj syntax support for 7.1 servers */
1314
+ (strcmp (key , "oj" ) == 0 ) || /* {oj syntax support for 7.1
1315
+ * servers */
1312
1316
(strcmp (key , "ts" ) == 0 ))
1313
1317
{
1314
1318
/* Literal; return the escape part as-is */
1315
1319
strncpy (escape , value , sizeof (escape ) - 1 );
1316
1320
}
1317
1321
else if (strcmp (key , "fn" ) == 0 )
1318
1322
{
1323
+
1319
1324
/*
1320
1325
* Function invocation Separate off the func name, skipping
1321
1326
* trailing whitespace.
@@ -1722,7 +1727,7 @@ convert_lo(StatementClass *stmt, void *value, Int2 fCType, PTR rgbValue,
1722
1727
BindInfoClass * bindInfo = NULL ;
1723
1728
1724
1729
1725
- /* If using SQLGetData, then current_col will be set */
1730
+ /* If using SQLGetData, then current_col will be set */
1726
1731
if (stmt -> current_col >= 0 )
1727
1732
{
1728
1733
bindInfo = & stmt -> bindings [stmt -> current_col ];
0 commit comments