Re: [HACKERS] Another bug in pg_operator.h - Mailing list pgsql-hackers
From | Tom Lane |
---|---|
Subject | Re: [HACKERS] Another bug in pg_operator.h |
Date | |
Msg-id | 12405.909618688@sss.pgh.pa.us Whole thread Raw |
In response to | Another bug in pg_operator.h (Tom Lane <tgl@sss.pgh.pa.us>) |
Responses |
Re: [HACKERS] Another bug in pg_operator.h
Re: [HACKERS] Another bug in pg_operator.h |
List | pgsql-hackers |
Actually, the darn thing is *crawling* with bugs. Once I understood what the commute and negate links were all about, I applied a few simple sanity checks (like, if A says it commutes to B, does B say it commutes to A?). This was, um, fruitful. The comparison operators on booleans, tintervals, and lsegs are all pretty seriously busted --- they have incorrect commute and/or negate links. I am worried about what other similar bugs may be in there, but short of groveling over the entries by hand, I don't know what else to do to check the table further. BTW Bruce's fix of this morning wasn't right either --- he misspelled the name of the lseg_ne comparison routine. I am currently running a build and regression test for the attached diffs, which I propose to commit if the regress passes. I expect to find that this explains the tinterval regression differences I've been seeing. The tinterval expected file is clearly wrong, because it contains "sorted" lists of tintervals that are obviously not in order. I've been getting a different but just as wrong sort order on HPUX. With luck this fix will produce a correct sort order. BTW, is it sufficient to edit pg_operator.h, rebuild, reinstall, and initdb? Or is there some additional incantation that needs to be made when patching pg_operator.h? regards, tom lane PS: Stop the presses .... looks like int8 and int4-vs-int8 comparators are bogus too ... geez ... *** pg_operator.h.orig Wed Oct 28 12:10:48 1998 --- pg_operator.h Wed Oct 28 18:32:20 1998 *************** *** 95,102 **** DATA(insert OID = 80 ( "<=" PGUID 0 b t f 23 20 16 419 419 0 0 int48le intlesel intlejoinsel)); DATA(insert OID = 82 ( ">=" PGUID 0 b t f 23 20 16 418 418 0 0 int48ge intgesel intgejoinsel)); ! DATA(insert OID = 58 ( "<" PGUID 0 b t f 16 16 16 85 91 0 0 boollt intltsel intltjoinsel )); ! DATA(insert OID = 59 ( ">" PGUID 0 b t f 16 16 16 85 91 0 0 boolgt intltsel intltjoinsel )); DATA(insertOID = 85 ( "<>" PGUID 0 b t f 16 16 16 85 91 0 0 boolne neqsel neqjoinsel )); DATA(insert OID= 91 ( "=" PGUID 0 b t t 16 16 16 91 85 0 0 booleq eqsel eqjoinsel )); #define BooleanEqualOperator 91 --- 95,102 ---- DATA(insert OID = 80 ( "<=" PGUID 0 b t f 23 20 16 419 419 0 0 int48le intlesel intlejoinsel)); DATA(insert OID = 82 ( ">=" PGUID 0 b t f 23 20 16 418 418 0 0 int48ge intgesel intgejoinsel)); ! DATA(insert OID = 58 ( "<" PGUID 0 b t f 16 16 16 59 0 0 0 boollt intltsel intltjoinsel )); ! DATA(insert OID = 59 ( ">" PGUID 0 b t f 16 16 16 58 0 0 0 boolgt intltsel intltjoinsel )); DATA(insertOID = 85 ( "<>" PGUID 0 b t f 16 16 16 85 91 0 0 boolne neqsel neqjoinsel )); DATA(insert OID= 91 ( "=" PGUID 0 b t t 16 16 16 91 85 0 0 booleq eqsel eqjoinsel )); #define BooleanEqualOperator 91 *************** *** 191,198 **** DATA(insert OID = 517 ( "<->" PGUID 0 b t f 600 600 701 517 0 0 0 point_distance intltsel intltjoinsel)); DATA(insert OID = 518 ( "<>" PGUID 0 b t f 23 23 16 518 96 0 0 int4ne neqsel neqjoinsel ));DATA(insert OID = 519 ( "<>" PGUID 0 b t f 21 21 16 519 94 0 0 int2ne neqsel neqjoinsel )); ! DATA(insert OID = 520 ( ">" PGUID 0 b t f 21 21 16 95 0 0 0 int2gt intgtsel intgtjoinsel )); ! DATA(insert OID = 521 ( ">" PGUID 0 b t f 23 23 16 97 0 0 0 int4gt intgtsel intgtjoinsel )); DATA(insertOID = 522 ( "<=" PGUID 0 b t f 21 21 16 524 520 0 0 int2le intltsel intltjoinsel )); DATA(insert OID= 523 ( "<=" PGUID 0 b t f 23 23 16 525 521 0 0 int4le intltsel intltjoinsel )); DATA(insert OID = 524 ( ">=" PGUID 0 b t f 21 21 16 522 95 0 0 int2ge intgtsel intgtjoinsel )); --- 191,198 ---- DATA(insert OID = 517 ( "<->" PGUID 0 b t f 600 600 701 517 0 0 0 point_distance intltsel intltjoinsel)); DATA(insert OID = 518 ( "<>" PGUID 0 b t f 23 23 16 518 96 0 0 int4ne neqsel neqjoinsel ));DATA(insert OID = 519 ( "<>" PGUID 0 b t f 21 21 16 519 94 0 0 int2ne neqsel neqjoinsel )); ! DATA(insert OID = 520 ( ">" PGUID 0 b t f 21 21 16 95 522 0 0 int2gt intgtsel intgtjoinsel )); ! DATA(insert OID = 521 ( ">" PGUID 0 b t f 23 23 16 97 523 0 0 int4gt intgtsel intgtjoinsel )); DATA(insertOID = 522 ( "<=" PGUID 0 b t f 21 21 16 524 520 0 0 int2le intltsel intltjoinsel )); DATA(insert OID= 523 ( "<=" PGUID 0 b t f 23 23 16 525 521 0 0 int4le intltsel intltjoinsel )); DATA(insert OID = 524 ( ">=" PGUID 0 b t f 21 21 16 522 95 0 0 int2ge intgtsel intgtjoinsel )); *************** *** 298,305 **** DATA(insert OID = 617 ( "<->" PGUID 0 b t f 601 603 701 0 0 0 0 dist_sb - - )); DATA(insertOID = 618 ( "<->" PGUID 0 b t f 600 602 701 0 0 0 0 dist_ppath - - )); - DATA(insert OID = 619 ( "<" PGUID 0 b t f 704 704 16 0 0 0 0 intervalct - - )); - DATA(insert OID = 620 ( "=" PGUID 0 b t t 700 700 16 620 621 622 622 float4eq eqsel eqjoinsel )); DATA(insertOID = 621 ( "<>" PGUID 0 b t f 700 700 16 621 620 0 0 float4ne neqsel neqjoinsel )); DATA(insertOID = 622 ( "<" PGUID 0 b t f 700 700 16 623 625 0 0 float4lt intltsel intltjoinsel )); --- 298,303 ---- *************** *** 400,411 **** DATA(insert OID = 808 ( "?-" PGUID 0 b t f 600 600 16 808 0 0 0 point_horiz - - )); DATA(insertOID = 809 ( "?|" PGUID 0 b t f 600 600 16 809 0 0 0 point_vert - - )); ! DATA(insert OID = 811 ( "=" PGUID 0 b t t 704 704 16 811 0 0 0 intervaleq - - )); ! DATA(insert OID = 812 ( "<>" PGUID 0 b t f 704 704 16 812 0 0 0 intervalne - - )); ! DATA(insert OID = 813 ( "<" PGUID 0 b t f 704 704 16 813 0 0 0 intervallt - - )); ! DATA(insert OID = 814 ( ">" PGUID 0 b t f 704 704 16 814 0 0 0 intervalgt - - )); ! DATA(insert OID = 815 ( "<=" PGUID 0 b t f 704 704 16 815 0 0 0 intervalle - - )); ! DATA(insert OID = 816 ( ">=" PGUID 0 b t f 704 704 16 816 0 0 0 intervalge - - )); DATA(insert OID = 843( "*" PGUID 0 b t f 790 700 790 845 0 0 0 cash_mul_flt4 - - )); DATA(insert OID = 844 ( "/" PGUID0 b t f 790 700 790 0 0 0 0 cash_div_flt4 - - )); --- 398,409 ---- DATA(insert OID = 808 ( "?-" PGUID 0 b t f 600 600 16 808 0 0 0 point_horiz - - )); DATA(insertOID = 809 ( "?|" PGUID 0 b t f 600 600 16 809 0 0 0 point_vert - - )); ! DATA(insert OID = 811 ( "=" PGUID 0 b t t 704 704 16 811 812 0 0 intervaleq - - )); ! DATA(insert OID = 812 ( "<>" PGUID 0 b t f 704 704 16 812 811 0 0 intervalne - - )); ! DATA(insert OID = 813 ( "<" PGUID 0 b t f 704 704 16 814 816 0 0 intervallt - - )); ! DATA(insert OID = 814 ( ">" PGUID 0 b t f 704 704 16 813 815 0 0 intervalgt - - )); ! DATA(insert OID = 815 ( "<=" PGUID 0 b t f 704 704 16 816 814 0 0 intervalle - - )); ! DATA(insert OID = 816 ( ">=" PGUID 0 b t f 704 704 16 815 813 0 0 intervalge - - )); DATA(insert OID = 843( "*" PGUID 0 b t f 790 700 790 845 0 0 0 cash_mul_flt4 - - )); DATA(insert OID = 844 ( "/" PGUID0 b t f 790 700 790 0 0 0 0 cash_div_flt4 - - )); *************** *** 597,603 **** DATA(insert OID = 1527 ( "?-|" PGUID 0 b t f 601 601 16 1527 0 0 0 lseg_perp - - )); DATA(insertOID = 1528 ( "?-" PGUID 0 l t f 0 601 16 1528 0 0 0 lseg_horizontal - - )); DATA(insert OID = 1529( "?|" PGUID 0 l t f 0 601 16 1529 0 0 0 lseg_vertical - - )); ! DATA(insert OID = 1535 ( "=" PGUID 0 b t f 601 601 16 1535 0 0 0 lseg_eq intltsel - )); DATA(insert OID = 1536( "#" PGUID 0 b t f 601 601 600 1536 0 0 0 lseg_interpt - - )); DATA(insert OID = 1537 ( "?#" PGUID 0b t f 601 628 16 1537 0 0 0 inter_sl - - )); DATA(insert OID = 1538 ( "?#" PGUID 0 b t f 601 603 16 1538 0 0 0 inter_sb - - )); --- 595,601 ---- DATA(insert OID = 1527 ( "?-|" PGUID 0 b t f 601 601 16 1527 0 0 0 lseg_perp - - )); DATA(insertOID = 1528 ( "?-" PGUID 0 l t f 0 601 16 1528 0 0 0 lseg_horizontal - - )); DATA(insert OID = 1529( "?|" PGUID 0 l t f 0 601 16 1529 0 0 0 lseg_vertical - - )); ! DATA(insert OID = 1535 ( "=" PGUID 0 b t f 601 601 16 1535 1586 0 0 lseg_eq intltsel - )); DATA(insert OID =1536 ( "#" PGUID 0 b t f 601 601 600 1536 0 0 0 lseg_interpt - - )); DATA(insert OID = 1537 ( "?#" PGUID0 b t f 601 628 16 1537 0 0 0 inter_sl - - )); DATA(insert OID = 1538 ( "?#" PGUID 0 b t f 601 603 16 1538 0 0 0 inter_sb - - )); *************** *** 619,629 **** DATA(insert OID = 1578 ( "##" PGUID 0 b t f 601 601 600 0 0 0 0 close_lseg - - )); DATA(insertOID = 1585 ( "/" PGUID 0 b t f 1186 1186 1186 0 0 0 0 timespan_div - - )); ! DATA(insert OID = 1586 ( "<>" PGUID 0 b t f 601 601 16 1535 0 0 0 lseg_neq intltsel - )); ! DATA(insert OID = 1587 ( "<" PGUID 0 b t f 601 601 16 1590 0 0 0 lseg_lt intltsel - )); ! DATA(insert OID = 1588 ( "<=" PGUID 0 b t f 601 601 16 1589 0 0 0 lseg_le intltsel - )); ! DATA(insert OID = 1589 ( ">" PGUID 0 b t f 601 601 16 1588 0 0 0 lseg_gt intltsel - )); ! DATA(insert OID = 1590 ( ">=" PGUID 0 b t f 601 601 16 1587 0 0 0 lseg_ge intltsel - )); DATA(insert OID =1591 ( "@-@" PGUID 0 l t f 0 601 701 0 0 0 0 lseg_length - - )); --- 617,627 ---- DATA(insert OID = 1578 ( "##" PGUID 0 b t f 601 601 600 0 0 0 0 close_lseg - - )); DATA(insertOID = 1585 ( "/" PGUID 0 b t f 1186 1186 1186 0 0 0 0 timespan_div - - )); ! DATA(insert OID = 1586 ( "<>" PGUID 0 b t f 601 601 16 1586 1535 0 0 lseg_ne intltsel - )); ! DATA(insert OID = 1587 ( "<" PGUID 0 b t f 601 601 16 1589 1590 0 0 lseg_lt intltsel - )); ! DATA(insert OID = 1588 ( "<=" PGUID 0 b t f 601 601 16 1590 1589 0 0 lseg_le intltsel - )); ! DATA(insert OID = 1589 ( ">" PGUID 0 b t f 601 601 16 1587 1588 0 0 lseg_gt intltsel - )); ! DATA(insert OID = 1590 ( ">=" PGUID 0 b t f 601 601 16 1588 1587 0 0 lseg_ge intltsel - )); DATA(insert OID= 1591 ( "@-@" PGUID 0 l t f 0 601 701 0 0 0 0 lseg_length - - ));
pgsql-hackers by date: