Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0da6cf5

Browse files
committed
The UNDEFOID later causes an assertion failure in heap_formtuple when
you try to use the tupdesc to build a tuple.Joe Conway
1 parent1bab464 commit0da6cf5

File tree

2 files changed

+47
-47
lines changed

2 files changed

+47
-47
lines changed

‎src/backend/executor/execQual.c

Lines changed: 45 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.103 2002/08/30 23:59:46 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.104 2002/08/31 19:09:27 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -69,8 +69,9 @@ static Datum ExecEvalNullTest(NullTest *ntest, ExprContext *econtext,
6969
bool*isNull,ExprDoneCond*isDone);
7070
staticDatumExecEvalBooleanTest(BooleanTest*btest,ExprContext*econtext,
7171
bool*isNull,ExprDoneCond*isDone);
72-
staticDatumExecEvalConstraint(Constraint*constraint,ExprContext*econtext,
73-
bool*isNull,ExprDoneCond*isDone);
72+
staticDatumExecEvalConstraintTest(ConstraintTest*constraint,
73+
ExprContext*econtext,
74+
bool*isNull,ExprDoneCond*isDone);
7475

7576

7677
/*----------
@@ -1465,43 +1466,6 @@ ExecEvalNullTest(NullTest *ntest,
14651466
}
14661467
}
14671468

1468-
/*
1469-
* ExecEvalConstraint
1470-
*
1471-
* Test the constraint against the data provided. If the data fits
1472-
* within the constraint specifications, pass it through (return the
1473-
* datum) otherwise throw an error.
1474-
*/
1475-
staticDatum
1476-
ExecEvalConstraint(Constraint*constraint,ExprContext*econtext,
1477-
bool*isNull,ExprDoneCond*isDone)
1478-
{
1479-
Datumresult;
1480-
1481-
result=ExecEvalExpr(constraint->raw_expr,econtext,isNull,isDone);
1482-
1483-
/* Test for the constraint type */
1484-
switch(constraint->contype)
1485-
{
1486-
caseCONSTR_NOTNULL:
1487-
if (*isNull)
1488-
{
1489-
elog(ERROR,"Domain %s does not allow NULL values",constraint->name);
1490-
}
1491-
break;
1492-
caseCONSTR_CHECK:
1493-
1494-
elog(ERROR,"ExecEvalConstraint: Domain CHECK Constraints not yet implemented");
1495-
break;
1496-
default:
1497-
elog(ERROR,"ExecEvalConstraint: Constraint type unknown");
1498-
break;
1499-
}
1500-
1501-
/* If all has gone well (constraint did not fail) return the datum */
1502-
returnresult;
1503-
}
1504-
15051469
/* ----------------------------------------------------------------
15061470
*ExecEvalBooleanTest
15071471
*
@@ -1582,6 +1546,41 @@ ExecEvalBooleanTest(BooleanTest *btest,
15821546
}
15831547
}
15841548

1549+
/*
1550+
* ExecEvalConstraintTest
1551+
*
1552+
* Test the constraint against the data provided. If the data fits
1553+
* within the constraint specifications, pass it through (return the
1554+
* datum) otherwise throw an error.
1555+
*/
1556+
staticDatum
1557+
ExecEvalConstraintTest(ConstraintTest*constraint,ExprContext*econtext,
1558+
bool*isNull,ExprDoneCond*isDone)
1559+
{
1560+
Datumresult;
1561+
1562+
result=ExecEvalExpr(constraint->arg,econtext,isNull,isDone);
1563+
1564+
switch (constraint->testtype)
1565+
{
1566+
caseCONSTR_TEST_NOTNULL:
1567+
if (*isNull)
1568+
elog(ERROR,"Domain %s does not allow NULL values",
1569+
constraint->name);
1570+
break;
1571+
caseCONSTR_TEST_CHECK:
1572+
/* TODO: Add CHECK Constraints to domains */
1573+
elog(ERROR,"Domain CHECK Constraints not yet implemented");
1574+
break;
1575+
default:
1576+
elog(ERROR,"ExecEvalConstraintTest: Constraint type unknown");
1577+
break;
1578+
}
1579+
1580+
/* If all has gone well (constraint did not fail) return the datum */
1581+
returnresult;
1582+
}
1583+
15851584
/* ----------------------------------------------------------------
15861585
*ExecEvalFieldSelect
15871586
*
@@ -1749,12 +1748,6 @@ ExecEvalExpr(Node *expression,
17491748
isNull,
17501749
isDone);
17511750
break;
1752-
caseT_Constraint:
1753-
retDatum=ExecEvalConstraint((Constraint*)expression,
1754-
econtext,
1755-
isNull,
1756-
isDone);
1757-
break;
17581751
caseT_CaseExpr:
17591752
retDatum=ExecEvalCase((CaseExpr*)expression,
17601753
econtext,
@@ -1773,6 +1766,12 @@ ExecEvalExpr(Node *expression,
17731766
isNull,
17741767
isDone);
17751768
break;
1769+
caseT_ConstraintTest:
1770+
retDatum=ExecEvalConstraintTest((ConstraintTest*)expression,
1771+
econtext,
1772+
isNull,
1773+
isDone);
1774+
break;
17761775

17771776
default:
17781777
elog(ERROR,"ExecEvalExpr: unknown expression type %d",

‎src/backend/executor/nodeFunctionscan.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/executor/nodeFunctionscan.c,v 1.9 2002/08/30 23:59:46 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/executor/nodeFunctionscan.c,v 1.10 2002/08/31 19:09:27 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -226,6 +226,7 @@ ExecInitFunctionScan(FunctionScan *node, EState *estate, Plan *parent)
226226
List*coldeflist=rte->coldeflist;
227227

228228
tupdesc=BuildDescForRelation(coldeflist);
229+
tupdesc->tdhasoid=WITHOUTOID;
229230
}
230231
else
231232
elog(ERROR,"Unknown kind of return type specified for function");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp