summaryrefslogtreecommitdiff
path: root/src/interfaces/odbc/columninfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/odbc/columninfo.c')
-rw-r--r--src/interfaces/odbc/columninfo.c66
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;
}