1)Allow the access to indexes with up to 16 keys.

2)Fix some memory leaks.
3)Change some bogus error messages.
This commit is contained in:
Hiroshi Inoue 2001-03-10 03:34:57 +00:00
parent 5490195f04
commit e666422ebf
5 changed files with 15 additions and 9 deletions

View 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;
}

View 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));

View 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);
}
}

View 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;
}

View 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;