~ubuntu-branches/ubuntu/natty/postgresql-8.4/natty-security

« back to all changes in this revision

Viewing changes to src/backend/catalog/pg_operator.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-11 16:59:35 UTC
  • mfrom: (5.1.1 karmic)
  • Revision ID: james.westby@ubuntu.com-20090711165935-jfwin6gfrxf0gfsi
Tags: 8.4.0-2
* debian/libpq-dev.install: Ship catalog/genbki.h. (Closes: #536139)
* debian/rules: Drop --enable-cassert for final release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 *
9
9
 *
10
10
 * IDENTIFICATION
11
 
 *        $PostgreSQL: pgsql/src/backend/catalog/pg_operator.c,v 1.108 2009/01/22 20:16:01 tgl Exp $
 
11
 *        $PostgreSQL: pgsql/src/backend/catalog/pg_operator.c,v 1.109 2009/06/11 14:48:55 momjian Exp $
12
12
 *
13
13
 * NOTES
14
14
 *        these routines moved here from commands/define.c and somewhat cleaned up.
391
391
                if (OidIsValid(restrictionId))
392
392
                        ereport(ERROR,
393
393
                                        (errcode(ERRCODE_INVALID_FUNCTION_DEFINITION),
394
 
                                 errmsg("only boolean operators can have restriction selectivity")));
 
394
                                         errmsg("only boolean operators can have restriction selectivity")));
395
395
                if (OidIsValid(joinId))
396
396
                        ereport(ERROR,
397
397
                                        (errcode(ERRCODE_INVALID_FUNCTION_DEFINITION),
398
 
                                 errmsg("only boolean operators can have join selectivity")));
 
398
                                errmsg("only boolean operators can have join selectivity")));
399
399
                if (canMerge)
400
400
                        ereport(ERROR,
401
401
                                        (errcode(ERRCODE_INVALID_FUNCTION_DEFINITION),
420
420
 
421
421
        /*
422
422
         * At this point, if operatorObjectId is not InvalidOid then we are
423
 
         * filling in a previously-created shell.  Insist that the user own
424
 
         * any such shell.
 
423
         * filling in a previously-created shell.  Insist that the user own any
 
424
         * such shell.
425
425
         */
426
426
        if (OidIsValid(operatorObjectId) &&
427
427
                !pg_oper_ownercheck(operatorObjectId, GetUserId()))
499
499
        values[i++] = ObjectIdGetDatum(rightTypeId);            /* oprright */
500
500
        values[i++] = ObjectIdGetDatum(operResultType);         /* oprresult */
501
501
        values[i++] = ObjectIdGetDatum(commutatorId);           /* oprcom */
502
 
        values[i++] = ObjectIdGetDatum(negatorId);              /* oprnegate */
503
 
        values[i++] = ObjectIdGetDatum(procedureId);    /* oprcode */
504
 
        values[i++] = ObjectIdGetDatum(restrictionId);  /* oprrest */
505
 
        values[i++] = ObjectIdGetDatum(joinId);                 /* oprjoin */
 
502
        values[i++] = ObjectIdGetDatum(negatorId);      /* oprnegate */
 
503
        values[i++] = ObjectIdGetDatum(procedureId);            /* oprcode */
 
504
        values[i++] = ObjectIdGetDatum(restrictionId);          /* oprrest */
 
505
        values[i++] = ObjectIdGetDatum(joinId);         /* oprjoin */
506
506
 
507
507
        pg_operator_desc = heap_open(OperatorRelationId, RowExclusiveLock);
508
508
 
519
519
                                 operatorObjectId);
520
520
 
521
521
                tup = heap_modify_tuple(tup,
522
 
                                                           RelationGetDescr(pg_operator_desc),
523
 
                                                           values,
524
 
                                                           nulls,
525
 
                                                           replaces);
 
522
                                                                RelationGetDescr(pg_operator_desc),
 
523
                                                                values,
 
524
                                                                nulls,
 
525
                                                                replaces);
526
526
 
527
527
                simple_heap_update(pg_operator_desc, &tup->t_self, tup);
528
528
        }
690
690
                                }
691
691
 
692
692
                                tup = heap_modify_tuple(tup,
693
 
                                                                           RelationGetDescr(pg_operator_desc),
694
 
                                                                           values,
695
 
                                                                           nulls,
696
 
                                                                           replaces);
 
693
                                                                                RelationGetDescr(pg_operator_desc),
 
694
                                                                                values,
 
695
                                                                                nulls,
 
696
                                                                                replaces);
697
697
 
698
698
                                simple_heap_update(pg_operator_desc, &tup->t_self, tup);
699
699
 
715
715
                replaces[Anum_pg_operator_oprcom - 1] = true;
716
716
 
717
717
                tup = heap_modify_tuple(tup,
718
 
                                                           RelationGetDescr(pg_operator_desc),
719
 
                                                           values,
720
 
                                                           nulls,
721
 
                                                           replaces);
 
718
                                                                RelationGetDescr(pg_operator_desc),
 
719
                                                                values,
 
720
                                                                nulls,
 
721
                                                                replaces);
722
722
 
723
723
                simple_heap_update(pg_operator_desc, &tup->t_self, tup);
724
724
 
741
741
                replaces[Anum_pg_operator_oprnegate - 1] = true;
742
742
 
743
743
                tup = heap_modify_tuple(tup,
744
 
                                                           RelationGetDescr(pg_operator_desc),
745
 
                                                           values,
746
 
                                                           nulls,
747
 
                                                           replaces);
 
744
                                                                RelationGetDescr(pg_operator_desc),
 
745
                                                                values,
 
746
                                                                nulls,
 
747
                                                                replaces);
748
748
 
749
749
                simple_heap_update(pg_operator_desc, &tup->t_self, tup);
750
750