|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.127 2002/08/04 19:48:09 momjian Exp $ |
| 11 | + * $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.128 2002/08/10 20:44:48 momjian Exp $ |
12 | 12 | *
|
13 | 13 | * NOTES
|
14 | 14 | * Most of the read functions for plan nodes are tested. (In fact, they
|
@@ -1465,6 +1465,80 @@ _readColumnRef(void)
|
1465 | 1465 | returnlocal_node;
|
1466 | 1466 | }
|
1467 | 1467 |
|
| 1468 | +staticColumnDef* |
| 1469 | +_readColumnDef(void) |
| 1470 | +{ |
| 1471 | +ColumnDef*local_node; |
| 1472 | +char*token; |
| 1473 | +intlength; |
| 1474 | + |
| 1475 | +local_node=makeNode(ColumnDef); |
| 1476 | + |
| 1477 | +token=pg_strtok(&length);/* eat :colname */ |
| 1478 | +token=pg_strtok(&length);/* now read it */ |
| 1479 | +local_node->colname=nullable_string(token,length); |
| 1480 | + |
| 1481 | +token=pg_strtok(&length);/* eat :typename */ |
| 1482 | +local_node->typename=nodeRead(true);/* now read it */ |
| 1483 | + |
| 1484 | +token=pg_strtok(&length);/* eat :is_not_null */ |
| 1485 | +token=pg_strtok(&length);/* get :is_not_null */ |
| 1486 | +local_node->is_not_null=strtobool(token); |
| 1487 | + |
| 1488 | +token=pg_strtok(&length);/* eat :raw_default */ |
| 1489 | +local_node->raw_default=nodeRead(true);/* now read it */ |
| 1490 | + |
| 1491 | +token=pg_strtok(&length);/* eat :cooked_default */ |
| 1492 | +token=pg_strtok(&length);/* now read it */ |
| 1493 | +local_node->cooked_default=nullable_string(token,length); |
| 1494 | + |
| 1495 | +token=pg_strtok(&length);/* eat :constraints */ |
| 1496 | +local_node->constraints=nodeRead(true);/* now read it */ |
| 1497 | + |
| 1498 | +token=pg_strtok(&length);/* eat :support */ |
| 1499 | +local_node->support=nodeRead(true);/* now read it */ |
| 1500 | + |
| 1501 | +returnlocal_node; |
| 1502 | +} |
| 1503 | + |
| 1504 | +staticTypeName* |
| 1505 | +_readTypeName(void) |
| 1506 | +{ |
| 1507 | +TypeName*local_node; |
| 1508 | +char*token; |
| 1509 | +intlength; |
| 1510 | + |
| 1511 | +local_node=makeNode(TypeName); |
| 1512 | + |
| 1513 | +token=pg_strtok(&length);/* eat :names */ |
| 1514 | +local_node->names=nodeRead(true);/* now read it */ |
| 1515 | + |
| 1516 | +token=pg_strtok(&length);/* eat :typeid */ |
| 1517 | +token=pg_strtok(&length);/* get typeid */ |
| 1518 | +local_node->typeid=atooid(token); |
| 1519 | + |
| 1520 | +token=pg_strtok(&length);/* eat :timezone */ |
| 1521 | +token=pg_strtok(&length);/* get timezone */ |
| 1522 | +local_node->timezone=strtobool(token); |
| 1523 | + |
| 1524 | +token=pg_strtok(&length);/* eat :setof */ |
| 1525 | +token=pg_strtok(&length);/* get setof */ |
| 1526 | +local_node->setof=strtobool(token); |
| 1527 | + |
| 1528 | +token=pg_strtok(&length);/* eat :pct_type */ |
| 1529 | +token=pg_strtok(&length);/* get pct_type */ |
| 1530 | +local_node->pct_type=strtobool(token); |
| 1531 | + |
| 1532 | +token=pg_strtok(&length);/* eat :typmod */ |
| 1533 | +token=pg_strtok(&length);/* get typmod */ |
| 1534 | +local_node->typmod=atoi(token); |
| 1535 | + |
| 1536 | +token=pg_strtok(&length);/* eat :arrayBounds */ |
| 1537 | +local_node->arrayBounds=nodeRead(true);/* now read it */ |
| 1538 | + |
| 1539 | +returnlocal_node; |
| 1540 | +} |
| 1541 | + |
1468 | 1542 | staticExprFieldSelect*
|
1469 | 1543 | _readExprFieldSelect(void)
|
1470 | 1544 | {
|
@@ -2092,6 +2166,10 @@ parsePlanString(void)
|
2092 | 2166 | return_value=_readRangeVar();
|
2093 | 2167 | elseif (length==9&&strncmp(token,"COLUMNREF",length)==0)
|
2094 | 2168 | return_value=_readColumnRef();
|
| 2169 | +elseif (length==9&&strncmp(token,"COLUMNDEF",length)==0) |
| 2170 | +return_value=_readColumnDef(); |
| 2171 | +elseif (length==8&&strncmp(token,"TYPENAME",length)==0) |
| 2172 | +return_value=_readTypeName(); |
2095 | 2173 | elseif (length==15&&strncmp(token,"EXPRFIELDSELECT",length)==0)
|
2096 | 2174 | return_value=_readExprFieldSelect();
|
2097 | 2175 | elseif (length==5&&strncmp(token,"ALIAS",length)==0)
|
|