mirror of
https://github.com/postgres/postgres.git
synced 2025-05-08 07:21:33 +03:00
Temporary varchar patch.
This commit is contained in:
parent
41a4f64dcf
commit
d7427e4802
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.14 1998/01/07 21:02:36 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.15 1998/01/16 05:03:45 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -42,6 +42,7 @@
|
|||||||
#include "access/genam.h"
|
#include "access/genam.h"
|
||||||
#include "access/heapam.h"
|
#include "access/heapam.h"
|
||||||
#include "catalog/heap.h"
|
#include "catalog/heap.h"
|
||||||
|
#include "catalog/pg_type.h"
|
||||||
|
|
||||||
static Pointer
|
static Pointer
|
||||||
ExecBeginScan(Relation relation, int nkeys, ScanKey skeys,
|
ExecBeginScan(Relation relation, int nkeys, ScanKey skeys,
|
||||||
@ -124,6 +125,31 @@ ExecOpenR(Oid relationOid, bool isindex)
|
|||||||
if (relation == NULL)
|
if (relation == NULL)
|
||||||
elog(DEBUG, "ExecOpenR: relation == NULL, heap_open failed.");
|
elog(DEBUG, "ExecOpenR: relation == NULL, heap_open failed.");
|
||||||
|
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
Relation trel = palloc(sizeof(RelationData));
|
||||||
|
TupleDesc tdesc = palloc(sizeof(struct tupleDesc));
|
||||||
|
AttributeTupleForm *tatt =
|
||||||
|
palloc(sizeof(AttributeTupleForm*)*relation->rd_att->natts);
|
||||||
|
|
||||||
|
memcpy(trel, relation, sizeof(RelationData));
|
||||||
|
memcpy(tdesc, relation->rd_att, sizeof(struct tupleDesc));
|
||||||
|
trel->rd_att = tdesc;
|
||||||
|
tdesc->attrs = tatt;
|
||||||
|
|
||||||
|
for (i = 0; i < relation->rd_att->natts; i++)
|
||||||
|
{
|
||||||
|
if (relation->rd_att->attrs[i]->atttypid != VARCHAROID)
|
||||||
|
tdesc->attrs[i] = relation->rd_att->attrs[i];
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tdesc->attrs[i] = palloc(sizeof(FormData_pg_attribute));
|
||||||
|
memcpy(tdesc->attrs[i], relation->rd_att->attrs[i],
|
||||||
|
sizeof(FormData_pg_attribute));
|
||||||
|
tdesc->attrs[i]->attlen = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return relation;
|
return relation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user