@@ -287,8 +287,8 @@ static size_t write_callback(char *ptr, size_t size, size_t nmemb,
287287 avail = dbc -> alen - dbc -> apos ;
288288 have = size * nmemb ;
289289
290- DBGH (dbc , "libcurl: new data chunk of size [%zd ] x %zd arrived; "
291- "available buffer: %zd/%zd ." , nmemb , size , avail , dbc -> alen );
290+ DBGH (dbc , "libcurl: new data chunk of size [%zu ] x %zu arrived; "
291+ "available buffer: %zu/%zu ." , nmemb , size , avail , dbc -> alen );
292292
293293 /* do I need to grow the existing buffer? */
294294 if (avail < have ) {
@@ -298,14 +298,14 @@ static size_t write_callback(char *ptr, size_t size, size_t nmemb,
298298 while (need < dbc -> apos + have ) {
299299 need *= 2 ;
300300 }
301- DBGH (dbc , "libcurl: need to grow buffer for new chunk of %zd "
302- "from %zd to %zd bytes." , have , dbc -> alen , need );
301+ DBGH (dbc , "libcurl: need to grow buffer for new chunk of %zu "
302+ "from %zu to %zu bytes." , have , dbc -> alen , need );
303303 if (dbc -> amax && (dbc -> amax < need )) { /* do I need more than max? */
304304 if (dbc -> amax <= (size_t )dbc -> alen ) { /* am I at max already? */
305305 goto too_large ;
306306 } else { /* am not: alloc max possible (if that's enough) */
307307 need = dbc -> amax ;
308- WARNH (dbc , "libcurl: capped buffer to max: %zd " , need );
308+ WARNH (dbc , "libcurl: capped buffer to max: %zu " , need );
309309 /* re'eval what I have available... */
310310 avail = dbc -> amax - dbc -> apos ;
311311 if (avail < have ) {
@@ -321,7 +321,7 @@ static size_t write_callback(char *ptr, size_t size, size_t nmemb,
321321 * the chunk right past the indicated JSON length.) */
322322 wbuf = realloc (dbc -> abuff , need + /*\0*/ 1 );
323323 if (! wbuf ) {
324- ERRNH (dbc , "libcurl: failed to realloc to %zdB ." , need );
324+ ERRNH (dbc , "libcurl: failed to realloc to %zuB ." , need );
325325 return 0 ;
326326 }
327327 dbc -> abuff = wbuf ;
@@ -332,7 +332,7 @@ static size_t write_callback(char *ptr, size_t size, size_t nmemb,
332332 dbc -> apos += have ;
333333 /* Add the 0-term for UJSON4C (but don't count it - see above) */
334334 dbc -> abuff [dbc -> apos ] = '\0' ;
335- DBGH (dbc , "libcurl: copied %zdB : `%.*s`." , have , have , ptr );
335+ DBGH (dbc , "libcurl: copied %zuB : `%.*s`." , have , have , ptr );
336336
337337 /*
338338 * "Your callback should return the number of bytes actually taken care
@@ -347,8 +347,8 @@ static size_t write_callback(char *ptr, size_t size, size_t nmemb,
347347 return have ;
348348
349349too_large :
350- ERRH (dbc , "libcurl: at %zd and can't grow past max %zd for new chunk of "
351- "%zd bytes." , dbc -> apos , dbc -> amax , have );
350+ ERRH (dbc , "libcurl: at %zu and can't grow past max %zu for new chunk of "
351+ "%zu bytes." , dbc -> apos , dbc -> amax , have );
352352 return 0 ;
353353}
354354
@@ -750,6 +750,7 @@ SQLRETURN post_json(esodbc_stmt_st *stmt, int url_type, const cstr_st *u8body)
750750 ESODBC_MUX_UNLOCK (& dbc -> curl_mux );
751751 return (url_type == ESODBC_CURL_QUERY ) ?
752752 attach_answer (stmt , resp .str , resp .cnt ) :
753+ /* ESODBC_CURL_CLOSE */
753754 close_es_answ_handler (stmt , resp .str , resp .cnt );
754755 } else {
755756 ERRH (stmt , "received 200 response code with empty body." );
@@ -920,9 +921,8 @@ SQLRETURN config_dbc(esodbc_dbc_st *dbc, esodbc_dsn_attrs_st *attrs)
920921 ipv6 ? "[" : "" , LWSTR (& attrs -> server ), ipv6 ? "]" : "" ,
921922 LWSTR (& attrs -> port ));
922923 if (cnt <= 0 ) {
923- ERRNH (dbc , "failed to print SQL URL out of server: `" LWPDL "` [%zd], "
924- "port: `" LWPDL "` [%zd]." , LWSTR (& attrs -> server ),
925- LWSTR (& attrs -> port ));
924+ ERRNH (dbc , "failed to print SQL URL out of server: `" LWPDL "`, "
925+ "port: `" LWPDL "`." , LWSTR (& attrs -> server ), LWSTR (& attrs -> port ));
926926 SET_HDIAG (dbc , SQL_STATE_HY000 , "printing server's SQL URL failed" , 0 );
927927 goto err ;
928928 } else {
@@ -957,9 +957,8 @@ SQLRETURN config_dbc(esodbc_dbc_st *dbc, esodbc_dsn_attrs_st *attrs)
957957 ipv6 ? "[" : "" , LWSTR (& attrs -> server ), ipv6 ? "]" : "" ,
958958 LWSTR (& attrs -> port ));
959959 if (cnt <= 0 ) {
960- ERRNH (dbc , "failed to print root URL out of server: `" LWPDL "` [%zd],"
961- " port: `" LWPDL "` [%zd]." , LWSTR (& attrs -> server ),
962- LWSTR (& attrs -> port ));
960+ ERRNH (dbc , "failed to print root URL out of server: `" LWPDL "`,"
961+ " port: `" LWPDL "`." , LWSTR (& attrs -> server ), LWSTR (& attrs -> port ));
963962 SET_HDIAG (dbc , SQL_STATE_HY000 , "printing server's URL failed" , 0 );
964963 goto err ;
965964 } else {
@@ -978,16 +977,16 @@ SQLRETURN config_dbc(esodbc_dbc_st *dbc, esodbc_dsn_attrs_st *attrs)
978977 */
979978 if (attrs -> uid .cnt ) {
980979 if (! wstr_to_utf8 (& attrs -> uid , & dbc -> uid )) {
981- ERRH (dbc , "failed to convert username [%zd ] `" LWPDL "` to UTF8." ,
980+ ERRH (dbc , "failed to convert username [%zu ] `" LWPDL "` to UTF8." ,
982981 attrs -> uid .cnt , LWSTR (& attrs -> uid ));
983982 SET_HDIAG (dbc , SQL_STATE_HY000 , "username UTF8 conversion "
984983 "failed" , 0 );
985984 goto err ;
986985 }
987986 if (attrs -> pwd .cnt ) {
988987 if (! wstr_to_utf8 (& attrs -> pwd , & dbc -> pwd )) {
989- ERRH (dbc , "failed to convert password [%zd] (-not shown-) to "
990- "UTF8." , attrs -> pwd .cnt );
988+ ERRH (dbc , "failed to convert password [%zu] `%s` to "
989+ "UTF8." , attrs -> pwd .cnt , ESODBC_PWD_VAL_SUBST );
991990 SET_HDIAG (dbc , SQL_STATE_HY000 , "password UTF8 "
992991 "conversion failed" , 0 );
993992 goto err ;
@@ -1040,7 +1039,7 @@ SQLRETURN config_dbc(esodbc_dbc_st *dbc, esodbc_dsn_attrs_st *attrs)
10401039 WARNH (dbc , "no reply body limit set." );
10411040 }
10421041 }
1043- INFOH (dbc , "max body size: %zd ." , dbc -> amax );
1042+ INFOH (dbc , "max body size: %zu ." , dbc -> amax );
10441043
10451044 /*
10461045 * set max fetch size
@@ -1067,7 +1066,7 @@ SQLRETURN config_dbc(esodbc_dbc_st *dbc, esodbc_dsn_attrs_st *attrs)
10671066 dbc -> fetch .slen = (char )attrs -> max_fetch_size .cnt ;
10681067 dbc -> fetch .str = malloc (dbc -> fetch .slen + /*\0*/ 1 );
10691068 if (! dbc -> fetch .str ) {
1070- ERRNH (dbc , "failed to alloc %zdB ." , dbc -> fetch .slen );
1069+ ERRNH (dbc , "failed to alloc %cB ." , dbc -> fetch .slen );
10711070 RET_HDIAGS (dbc , SQL_STATE_HY001 );
10721071 }
10731072 dbc -> fetch .str [dbc -> fetch .slen ] = 0 ;
@@ -1524,8 +1523,8 @@ static BOOL elastic_intervals_name2types(wstr_st *type_name,
15241523 break ;
15251524 }
15261525
1527- ERR ("unrecognized Elastic type `" LWPDL "` (%zd) ." , LWSTR ( type_name ) ,
1528- type_name -> cnt );
1526+ ERR ("unrecognized Elastic type: [%zu] `" LWPDL "`." , type_name -> cnt ,
1527+ LWSTR ( type_name ) );
15291528 return FALSE;
15301529}
15311530
@@ -2170,7 +2169,7 @@ static BOOL load_es_types(esodbc_dbc_st *dbc)
21702169 ERRH (stmt , "Elasticsearch returned no type as supported." );
21712170 goto end ;
21722171 } else if (ESODBC_MAX_NO_TYPES < row_cnt ) {
2173- ERRH (stmt , "Elasticsearch returned too many types (%d vs limit %zd )." ,
2172+ ERRH (stmt , "Elasticsearch returned too many types (%ld vs limit %d )." ,
21742173 row_cnt , ESODBC_MAX_NO_TYPES );
21752174 goto end ;
21762175 } else {
@@ -2186,7 +2185,7 @@ static BOOL load_es_types(esodbc_dbc_st *dbc)
21862185 /* indicate rowset size */
21872186 if (! SQL_SUCCEEDED (EsSQLSetStmtAttrW (stmt , SQL_ATTR_ROW_ARRAY_SIZE ,
21882187 (SQLPOINTER )ESODBC_MAX_NO_TYPES , 0 ))) {
2189- ERRH (stmt , "failed to set rowset size (%zd )." ,
2188+ ERRH (stmt , "failed to set rowset size (%d )." ,
21902189 ESODBC_MAX_NO_TYPES );
21912190 goto end ;
21922191 }
@@ -2481,7 +2480,7 @@ SQLRETURN EsSQLDriverConnectW
24812480 cnt += attrs .server .cnt + /*\0*/ 1 ;
24822481 dbc -> dsn .str = malloc (cnt * sizeof (SQLWCHAR )); /* alloc for both */
24832482 if (! dbc -> dsn .str ) {
2484- ERRNH (dbc , "OOM for %zdB ." , (orig_dsn .cnt + 1 ) * sizeof (SQLWCHAR ));
2483+ ERRNH (dbc , "OOM for %zuB ." , (orig_dsn .cnt + 1 ) * sizeof (SQLWCHAR ));
24852484 RET_HDIAGS (dbc , SQL_STATE_HY001 );
24862485 }
24872486 /* copy DSN */
0 commit comments