Commit 1f1963d7 1f1963d748e8c25889fef7acdd027c801291d519 by Sergey Poznyakoff

Update

1 parent eb38b439
...@@ -261,7 +261,9 @@ static int ...@@ -261,7 +261,9 @@ static int
261 get_field_number (mu_sql_connection_t conn, const char *fname, size_t *fno) 261 get_field_number (mu_sql_connection_t conn, const char *fname, size_t *fno)
262 { 262 {
263 size_t count; 263 size_t count;
264 264 struct mu_odbc_data *dp = conn->data;
265 int i;
266
265 if (!dp->fnames) 267 if (!dp->fnames)
266 { 268 {
267 int rc; 269 int rc;
...@@ -274,7 +276,7 @@ get_field_number (mu_sql_connection_t conn, const char *fname, size_t *fno) ...@@ -274,7 +276,7 @@ get_field_number (mu_sql_connection_t conn, const char *fname, size_t *fno)
274 return ENOMEM; 276 return ENOMEM;
275 for (i = 0; i < count; i++) 277 for (i = 0; i < count; i++)
276 { 278 {
277 char *name 279 char *name;
278 SQLRETURN ret; 280 SQLRETURN ret;
279 SQLSMALLINT namelen; 281 SQLSMALLINT namelen;
280 282
...@@ -318,10 +320,10 @@ get_field_number (mu_sql_connection_t conn, const char *fname, size_t *fno) ...@@ -318,10 +320,10 @@ get_field_number (mu_sql_connection_t conn, const char *fname, size_t *fno)
318 dp->fnames[i] = NULL; 320 dp->fnames[i] = NULL;
319 } 321 }
320 else 322 else
321 count = df->fcount; 323 count = dp->fcount;
322 for (i = 0; i < count; i++) 324 for (i = 0; i < count; i++)
323 { 325 {
324 if (strcmp (fname, df->fnames) == 0) 326 if (strcmp (fname, dp->fnames[i]) == 0)
325 { 327 {
326 *fno = i; 328 *fno = i;
327 return 0; 329 return 0;
......