]> granicus.if.org Git - postgresql/commitdiff
1)Allow the access to indexes with up to 16 keys.
authorHiroshi Inoue <inoue@tpf.co.jp>
Sat, 10 Mar 2001 03:34:57 +0000 (03:34 +0000)
committerHiroshi Inoue <inoue@tpf.co.jp>
Sat, 10 Mar 2001 03:34:57 +0000 (03:34 +0000)
2)Fix some memory leaks.
3)Change some bogus error messages.

src/interfaces/odbc/convert.c
src/interfaces/odbc/info.c
src/interfaces/odbc/qresult.c
src/interfaces/odbc/results.c
src/interfaces/odbc/statement.c

index 47b1882dfb882c2eecf16237edca6b875400c0db..0d8ada325627582043fd2e11357e8b91a620c737 100644 (file)
@@ -273,14 +273,16 @@ copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2
                /* this is an array of eight integers */
                short *short_array = (short *) ( (char *) rgbValue + rgbValueOffset);
 
-               len = 16;
+               len = 32;
                vp = value;
                nval = 0;
-               for (i = 0; i < 8; i++)
+mylog("index=(");
+               for (i = 0; i < 16; i++)
                {
                        if (sscanf(vp, "%hd", &short_array[i]) != 1)
                                break;
 
+mylog(" %d", short_array[i]);
                        nval++;
 
                        /* skip the current token */
@@ -290,8 +292,9 @@ copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2
                        if (*vp == '\0')
                                break;
                }
+mylog(") nval = %d\n", nval);
 
-               for (i = nval; i < 8; i++)
+               for (i = nval; i < 16; i++)
                {
                        short_array[i] = 0;
                }
index bf43d6522b57b7e5b4f9558f67b9903021a59629..685248eeb7c8d10269b19165ad6191aaaef2a729 100644 (file)
@@ -1761,7 +1761,7 @@ HSTMT hindx_stmt;
 RETCODE result;
 char *table_name;
 char index_name[MAX_INFO_STRING];
-short fields_vector[8];
+short fields_vector[16];
 char isunique[10], isclustered[10];
 SDWORD index_name_len, fields_vector_len;
 TupleNode *row;
@@ -1924,7 +1924,7 @@ mylog("%s: entering...stmt=%u\n", func, stmt);
     }
     /* bind the vector column */
     result = SQLBindCol(hindx_stmt, 2, SQL_C_DEFAULT,
-                        fields_vector, 16, &fields_vector_len);
+                        fields_vector, 32, &fields_vector_len);
     if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) {
                stmt->errormsg = indx_stmt->errormsg;  /* "Couldn't bind column in SQLStatistics."; */
                stmt->errornumber = indx_stmt->errornumber;
@@ -2003,7 +2003,7 @@ mylog("%s: entering...stmt=%u\n", func, stmt);
                        (fUnique == SQL_INDEX_UNIQUE && atoi(isunique))) {
                        i = 0;
                        /* add a row in this table for each field in the index */
-                       while(i < 8 && fields_vector[i] != 0) {
+                       while(i < 16 && fields_vector[i] != 0) {
 
                                row = (TupleNode *)malloc(sizeof(TupleNode) + 
                                                          (13 - 1) * sizeof(TupleField));
index 56641d36b5c7078adf114686a99d7a88aee13416..2f17c64334449438b406f6557017fd2ddcf5f546 100644 (file)
@@ -311,6 +311,7 @@ QResultClass *res;
                        QR_set_message(self, "Error closing cursor.");
                        return FALSE;
                }
+               QR_Destructor(res);
 
                /*      End the transaction if there are no cursors left on this conn */
                if (CC_cursor_count(self->conn) == 0) {
@@ -325,6 +326,7 @@ QResultClass *res;
                                QR_set_message(self, "Error ending transaction.");
                                return FALSE;
                        }
+                       QR_Destructor(res);
                }
 
        }
index 8ef3936a8a62177407c541bf7c762ff134afac18..b4eedda79daece6fc8f7a598b85083a70f95ff4d 100644 (file)
@@ -405,7 +405,7 @@ int len = 0, value = 0;
 
                        if (icol >= cols) {
                                stmt->errornumber = STMT_INVALID_COLUMN_NUMBER_ERROR;
-                               stmt->errormsg = "Invalid column number in DescribeCol.";
+                               stmt->errormsg = "Invalid column number in ColAttributes.";
                                SC_log_error(func, "", stmt);
                                return SQL_ERROR;
                        }
@@ -442,7 +442,7 @@ int len = 0, value = 0;
 
                if (icol >= cols) {
                        stmt->errornumber = STMT_INVALID_COLUMN_NUMBER_ERROR;
-                       stmt->errormsg = "Invalid column number in DescribeCol.";
+                       stmt->errormsg = "Invalid column number in ColAttributes.";
                        SC_log_error(func, "", stmt);
                        return SQL_ERROR;
                }
index 8a8d5523ad6db2afdc4201665e94740a18d8f7d3..6c0d8552176b97889ea5d2aa79cc32256dee06b8 100644 (file)
@@ -404,7 +404,8 @@ mylog("recycle statement: self= %u\n", self);
                conn = SC_get_conn(self);
                if ( ! CC_is_in_autocommit(conn) && CC_is_in_trans(conn)) {
 
-                       CC_send_query(conn, "ABORT", NULL);
+                       QResultClass *res = CC_send_query(conn, "ABORT", NULL);
+                       QR_Destructor(res);
                        CC_set_no_trans(conn);
                }
                break;