diff options
| author | Byron Nikolaidis <byronn@insightdist.com> | 1998-06-03 20:33:45 +0000 |
|---|---|---|
| committer | Byron Nikolaidis <byronn@insightdist.com> | 1998-06-03 20:33:45 +0000 |
| commit | 99d21d5b62a54d64b95dc915a35fb35111bbc430 (patch) | |
| tree | 06f02f33d40f78fd3b73ad6d775b18fd34ffd7e4 /src/interfaces/odbc/columninfo.c | |
| parent | 85f91d0e8e2fa996a2c7ec629037387e1a9cfd88 (diff) | |
| download | postgresql-99d21d5b62a54d64b95dc915a35fb35111bbc430.tar.gz | |
Update odbc driver to current version V.0244
Diffstat (limited to 'src/interfaces/odbc/columninfo.c')
| -rw-r--r-- | src/interfaces/odbc/columninfo.c | 66 |
1 files changed, 21 insertions, 45 deletions
diff --git a/src/interfaces/odbc/columninfo.c b/src/interfaces/odbc/columninfo.c index 4f029e9c38..54fc06a1c3 100644 --- a/src/interfaces/odbc/columninfo.c +++ b/src/interfaces/odbc/columninfo.c @@ -1,18 +1,18 @@ -
-/* Module: columninfo.c
- *
- * Description: This module contains routines related to
- * reading and storing the field information from a query.
- *
- * Classes: ColumnInfoClass (Functions prefix: "CI_")
- *
- * API functions: none
- *
- * Comments: See "notice.txt" for copyright and license information.
- *
- */
- -#include "columninfo.h"
+ +/* Module: columninfo.c + * + * Description: This module contains routines related to + * reading and storing the field information from a query. + * + * Classes: ColumnInfoClass (Functions prefix: "CI_") + * + * API functions: none + * + * Comments: See "notice.txt" for copyright and license information. + * + */ + +#include "columninfo.h" #include "socket.h" #include <stdlib.h> #include <malloc.h> @@ -29,6 +29,7 @@ ColumnInfoClass *rv; rv->name = NULL; rv->adtid = NULL; rv->adtsize = NULL; + rv->display_size = NULL; } return rv; @@ -54,7 +55,7 @@ int new_num_fields; Oid new_adtid; Int2 new_adtsize; char new_field_name[MAX_MESSAGE_LEN+1]; -
+ /* at first read in the number of fields that are in the query */ new_num_fields = (Int2) SOCK_get_int(sock, sizeof(Int2)); @@ -93,11 +94,12 @@ int num_fields = self->num_fields; if( self->name[lf]) free (self->name[lf]); } -
+ /* Safe to call even if null */ free(self->name); free(self->adtid); free(self->adtsize); + free(self->display_size); } void @@ -110,6 +112,7 @@ CI_set_num_fields(ColumnInfoClass *self, int new_num_fields) self->name = (char **) malloc (sizeof(char *) * self->num_fields); self->adtid = (Oid *) malloc (sizeof(Oid) * self->num_fields); self->adtsize = (Int2 *) malloc (sizeof(Int2) * self->num_fields); + self->display_size = (Int2 *) malloc(sizeof(Int2) * self->num_fields); } void @@ -126,34 +129,7 @@ CI_set_field_info(ColumnInfoClass *self, int field_num, char *new_name, self->name[field_num] = strdup(new_name); self->adtid[field_num] = new_adtid; self->adtsize[field_num] = new_adtsize; -} -char * -CI_get_fieldname(ColumnInfoClass *self, Int2 which) -{ -char *rv = NULL; - - if ( ! self->name) - return NULL; - - if ((which >= 0) && (which < self->num_fields)) - rv = self->name[which]; - - return rv; -} - - -Int2 -CI_get_fieldsize(ColumnInfoClass *self, Int2 which) -{ -Int2 rv = 0; - - if ( ! self->adtsize) - return 0; - - if ((which >= 0) && (which < self->num_fields)) - rv = self->adtsize[which]; - - return rv; + self->display_size[field_num] = 0; } |
