conn->errormsg="The buffer was too small for the result.";
conn->errormsg="The buffer was too small for tthe InfoValue.";
}
}
}
}
}
}
...
@@ -2441,6 +2441,7 @@ SQLPrimaryKeys(
...
@@ -2441,6 +2441,7 @@ SQLPrimaryKeys(
{
{
staticchar*func="SQLPrimaryKeys";
staticchar*func="SQLPrimaryKeys";
StatementClass*stmt=(StatementClass*)hstmt;
StatementClass*stmt=(StatementClass*)hstmt;
ConnectionClass*conn;
TupleNode*row;
TupleNode*row;
RETCODEresult;
RETCODEresult;
intseq=0;
intseq=0;
...
@@ -2451,6 +2452,7 @@ SQLPrimaryKeys(
...
@@ -2451,6 +2452,7 @@ SQLPrimaryKeys(
SDWORDattname_len;
SDWORDattname_len;
charpktab[MAX_TABLE_LEN+1];
charpktab[MAX_TABLE_LEN+1];
Int2result_cols;
Int2result_cols;
intqno,qstart,qend;
mylog("%s: entering...stmt=%u\n",func,stmt);
mylog("%s: entering...stmt=%u\n",func,stmt);
...
@@ -2511,37 +2513,6 @@ SQLPrimaryKeys(
...
@@ -2511,37 +2513,6 @@ SQLPrimaryKeys(
returnSQL_ERROR;
returnSQL_ERROR;
}
}
#if 0
sprintf(tables_query, "select distinct on (attnum) a2.attname, a2.attnum from pg_attribute a1, pg_attribute a2, pg_class c, pg_index i where c.relname = '%s_pkey' AND c.oid = i.indexrelid AND a1.attrelid = c.oid AND a2.attrelid = c.oid AND (i.indkey[0] = a1.attnum OR i.indkey[1] = a1.attnum OR i.indkey[2] = a1.attnum OR i.indkey[3] = a1.attnum OR i.indkey[4] = a1.attnum OR i.indkey[5] = a1.attnum OR i.indkey[6] = a1.attnum OR i.indkey[7] = a1.attnum) order by a2.attnum", pktab);
#else
/*
* Simplified query to remove assumptions about number of possible
* index columns. Courtesy of Tom Lane - thomas 2000-03-21