@@ -2997,6 +2997,10 @@ IvyreplaceParamTypeByOutParameter(IvyBindOutInfo *bindinfo, int nParams, Oid *pa
29972997static Ivylist *
29982998IvyaddValueToList (Ivylist * list , void * value )
29992999{
3000+ Ivylist * pre = NULL ;
3001+ Ivylist * tmp = NULL ;
3002+ int find = 0 ;
3003+
30003004 if (list == NULL )
30013005 {
30023006 Ivylist * new = (Ivylist * ) malloc (sizeof (Ivylist ));
@@ -3014,10 +3018,6 @@ IvyaddValueToList(Ivylist *list, void *value)
30143018 return new ;
30153019 }
30163020
3017- Ivylist * pre = NULL ;
3018- Ivylist * tmp = NULL ;
3019- int find = 0 ;
3020-
30213021 for (tmp = list , pre = list ; tmp != NULL ; pre = tmp , tmp = tmp -> next )
30223022 {
30233023 if (tmp -> value == value )
@@ -3763,7 +3763,7 @@ Ivyreplacenamebindtoposition(Ivyconn *tconn,
37633763 size_t size_error_buf ,
37643764 bool * iscallinto )
37653765{
3766- int i ;
3766+ int i = 0 ;
37673767 Ivyresult * res ;
37683768 IvyBindOutNameInfo * tmp ;
37693769
@@ -3787,7 +3787,7 @@ Ivyreplacenamebindtoposition(Ivyconn *tconn,
37873787 char * convertcall = NULL ;
37883788 char * newsql = NULL ;
37893789 char * ptr = NULL ;
3790- int i = 0 ;
3790+ int j = 0 ;
37913791
37923792 query_len = (stmtHandle -> query_len * 2 ) + strlen ("select * from get_parameter_description(" ) + 5 ;
37933793 query = (char * ) malloc (query_len );
@@ -3800,12 +3800,12 @@ Ivyreplacenamebindtoposition(Ivyconn *tconn,
38003800
38013801 newsql = malloc (stmtHandle -> query_len * 2 ); /* enough */
38023802 ptr = newsql ;
3803- while (stmtHandle -> query [i ] != '\0' )
3803+ while (stmtHandle -> query [j ] != '\0' )
38043804 {
3805- if (stmtHandle -> query [i ] == '\'' )
3806- * ptr ++ = stmtHandle -> query [i ];
3807- * ptr ++ = stmtHandle -> query [i ];
3808- i ++ ;
3805+ if (stmtHandle -> query [j ] == '\'' )
3806+ * ptr ++ = stmtHandle -> query [j ];
3807+ * ptr ++ = stmtHandle -> query [j ];
3808+ j ++ ;
38093809 }
38103810 * ptr = '\0' ;
38113811
@@ -3965,14 +3965,14 @@ Ivyreplacenamebindtoposition(Ivyconn *tconn,
39653965
39663966 stmtHandle -> paramNames = (char * * ) malloc (sizeof (char * ) * (n_tuples - 1 ));
39673967 memset (stmtHandle -> paramNames , 0x00 , sizeof (char * ) * (n_tuples - 1 ));
3968- for (i = 1 ; i < n_tuples ; i ++ )
3968+ for (j = 1 ; j < n_tuples ; j ++ )
39693969 {
39703970 int position ;
39713971 char * name ;
39723972 size_t name_len ;
39733973
3974- position = atoi (Ivygetvalue (res , i , 1 )) - 1 ;
3975- name = Ivygetvalue (res , i , 0 );
3974+ position = atoi (Ivygetvalue (res , j , 1 )) - 1 ;
3975+ name = Ivygetvalue (res , j , 0 );
39763976
39773977 if (stmtHandle -> paramNames [position ] != NULL )
39783978 goto error_handle ;
@@ -4055,9 +4055,9 @@ Ivyreplacenamebindtoposition2(Ivyconn *tconn,
40554055 IvyPreparedStatement * stmtHandle ,
40564056 IvyError * errhp )
40574057{
4058- int i ;
40594058 Ivyresult * res ;
40604059 IvyBindNameInfo * tmp ;
4060+ int i = 0 ;
40614061
40624062 if (stmtHandle -> paramNames == NULL )
40634063 {
@@ -4072,7 +4072,7 @@ Ivyreplacenamebindtoposition2(Ivyconn *tconn,
40724072 char * convertcall = NULL ;
40734073 char * newsql = NULL ;
40744074 char * ptr = NULL ;
4075- int i = 0 ;
4075+ int j = 0 ;
40764076
40774077 query_len = (strlen (stmtHandle -> query ) * 2 ) + strlen ("select * from get_parameter_description(" ) + 5 ;
40784078 query = (char * ) malloc (query_len );
@@ -4086,12 +4086,12 @@ Ivyreplacenamebindtoposition2(Ivyconn *tconn,
40864086
40874087 newsql = malloc (strlen (stmtHandle -> query ) * 2 ); /* enough */
40884088 ptr = newsql ;
4089- while (stmtHandle -> query [i ] != '\0' )
4089+ while (stmtHandle -> query [j ] != '\0' )
40904090 {
4091- if (stmtHandle -> query [i ] == '\'' )
4092- * ptr ++ = stmtHandle -> query [i ];
4093- * ptr ++ = stmtHandle -> query [i ];
4094- i ++ ;
4091+ if (stmtHandle -> query [j ] == '\'' )
4092+ * ptr ++ = stmtHandle -> query [j ];
4093+ * ptr ++ = stmtHandle -> query [j ];
4094+ j ++ ;
40954095 }
40964096 * ptr = '\0' ;
40974097
@@ -4233,14 +4233,14 @@ Ivyreplacenamebindtoposition2(Ivyconn *tconn,
42334233 stmtHandle -> paramNames = (char * * ) malloc (sizeof (char * ) * (n_tuples - 1 ));
42344234 stmtHandle -> nParams = n_tuples - 1 ;
42354235 memset (stmtHandle -> paramNames , 0x00 , sizeof (char * ) * (n_tuples - 1 ));
4236- for (i = 1 ; i < n_tuples ; i ++ )
4236+ for (j = 1 ; j < n_tuples ; j ++ )
42374237 {
42384238 int position ;
42394239 char * name ;
42404240 size_t name_len ;
42414241
4242- position = atoi (Ivygetvalue (res , i , 1 )) - 1 ;
4243- name = Ivygetvalue (res , i , 0 );
4242+ position = atoi (Ivygetvalue (res , j , 1 )) - 1 ;
4243+ name = Ivygetvalue (res , j , 0 );
42444244
42454245 if (stmtHandle -> paramNames [position ] != NULL )
42464246 goto error_handle ;
0 commit comments