OSDN Git Service

Fix pg_operator entries for mergejoinable operators with different left and
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 28 Feb 1999 00:56:42 +0000 (00:56 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 28 Feb 1999 00:56:42 +0000 (00:56 +0000)
right side data types.  Correct the opr_sanity regress test to check these
entries properly.  NOTE that opr_sanity will now fail until you do an initdb!

src/include/catalog/pg_operator.h
src/test/regress/expected/opr_sanity.out
src/test/regress/sql/opr_sanity.sql

index 2477681..1773476 100644 (file)
@@ -7,7 +7,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: pg_operator.h,v 1.49 1999/02/13 23:21:11 momjian Exp $
+ * $Id: pg_operator.h,v 1.50 1999/02/28 00:56:40 tgl Exp $
  *
  * NOTES
  *       the genbki.sh script reads this file and generates .bki
@@ -88,7 +88,7 @@ typedef FormData_pg_operator *Form_pg_operator;
  * ----------------
  */
 
-DATA(insert OID =  15 ( "="               PGUID 0 b t t  23  20  16 416  36  37  37 int48eq eqsel eqjoinsel ));
+DATA(insert OID =  15 ( "="               PGUID 0 b t t  23  20  16 416  36  97 412 int48eq eqsel eqjoinsel ));
 DATA(insert OID =  36 ( "<>"      PGUID 0 b t t  23  20  16 417  15   0   0 int48ne neqsel neqjoinsel ));
 DATA(insert OID =  37 ( "<"               PGUID 0 b t f  23  20  16 419  82   0   0 int48lt intltsel intltjoinsel ));
 DATA(insert OID =  76 ( ">"               PGUID 0 b t f  23  20  16 418  80   0   0 int48gt intgtsel intgtjoinsel ));
@@ -148,7 +148,7 @@ DATA(insert OID = 413 ( ">"            PGUID 0 b t f  20  20  16 412 414 0 0 int8gt int
 DATA(insert OID = 414 ( "<="      PGUID 0 b t f  20  20  16 415 413 0 0 int8le intlesel intlejoinsel ));
 DATA(insert OID = 415 ( ">="      PGUID 0 b t f  20  20  16 414 412 0 0 int8ge intgesel intgejoinsel ));
 
-DATA(insert OID = 416 ( "="               PGUID 0 b t t  20  23  16  15 417 418 418 int84eq eqsel eqjoinsel ));
+DATA(insert OID = 416 ( "="               PGUID 0 b t t  20  23  16  15 417 412 97 int84eq eqsel eqjoinsel ));
 DATA(insert OID = 417 ( "<>"      PGUID 0 b t t  20  23  16  36 416 0 0 int84ne neqsel neqjoinsel ));
 DATA(insert OID = 418 ( "<"               PGUID 0 b t f  20  23  16  76 430 0 0 int84lt intltsel intltjoinsel ));
 DATA(insert OID = 419 ( ">"               PGUID 0 b t f  20  23  16  37 420 0 0 int84gt intgtsel intgtjoinsel ));
@@ -203,8 +203,8 @@ DATA(insert OID = 528 (  "/"           PGUID 0 b t f  23  23  23   0   0  0  0 int4div
 DATA(insert OID = 529 (  "%"      PGUID 0 b t f  21  21  21   0   0  0  0 int2mod intltsel intltjoinsel ));
 DATA(insert OID = 530 (  "%"      PGUID 0 b t f  23  23  23   0   0  0  0 int4mod intltsel intltjoinsel ));
 DATA(insert OID = 531 (  "<>"     PGUID 0 b t f  25  25  16 531  98    0   0 textne neqsel neqjoinsel ));
-DATA(insert OID = 532 (  "="      PGUID 0 b t t  21  23  16 533 538  534 534 int24eq eqsel eqjoinsel ));
-DATA(insert OID = 533 (  "="      PGUID 0 b t t  23  21  16 532 539  535 535 int42eq eqsel eqjoinsel ));
+DATA(insert OID = 532 (  "="      PGUID 0 b t t  21  23  16 533 538   95  97 int24eq eqsel eqjoinsel ));
+DATA(insert OID = 533 (  "="      PGUID 0 b t t  23  21  16 532 539   97  95 int42eq eqsel eqjoinsel ));
 DATA(insert OID = 534 (  "<"      PGUID 0 b t f  21  23  16 537 542  0  0 int24lt intltsel intltjoinsel ));
 DATA(insert OID = 535 (  "<"      PGUID 0 b t f  23  21  16 536 543  0  0 int42lt intltsel intltjoinsel ));
 DATA(insert OID = 536 (  ">"      PGUID 0 b t f  21  23  16 535 540  0  0 int24gt intgtsel intgtjoinsel ));
@@ -481,7 +481,7 @@ DATA(insert OID = 1116 (  "+"               PGUID 0 b t f 700 701 701 1126   0       0       0 float48pl
 DATA(insert OID = 1117 (  "-"          PGUID 0 b t f 700 701 701        0       0       0       0 float48mi - - ));
 DATA(insert OID = 1118 (  "/"          PGUID 0 b t f 700 701 701        0       0       0       0 float48div - - ));
 DATA(insert OID = 1119 (  "*"          PGUID 0 b t f 700 701 701 1129   0       0       0 float48mul - - ));
-DATA(insert OID = 1120 (  "="          PGUID 0 b t t  700      701  16 1130 1121  1122 1122 float48eq eqsel eqjoinsel ));
+DATA(insert OID = 1120 (  "="          PGUID 0 b t t  700      701  16 1130 1121  622  672 float48eq eqsel eqjoinsel ));
 DATA(insert OID = 1121 (  "<>"         PGUID 0 b t f  700      701  16 1131 1120  0 0 float48ne neqsel neqjoinsel ));
 DATA(insert OID = 1122 (  "<"          PGUID 0 b t f  700      701  16 1133 1125  0 0 float48lt intltsel intltjoinsel ));
 DATA(insert OID = 1123 (  ">"          PGUID 0 b t f  700      701  16 1132 1124  0 0 float48gt intgtsel intgtjoinsel ));
@@ -493,7 +493,7 @@ DATA(insert OID = 1126 (  "+"               PGUID 0 b t f 701 700 701 1116   0       0       0 float84pl
 DATA(insert OID = 1127 (  "-"          PGUID 0 b t f 701 700 701        0       0       0       0 float84mi - - ));
 DATA(insert OID = 1128 (  "/"          PGUID 0 b t f 701 700 701        0       0       0       0 float84div - - ));
 DATA(insert OID = 1129 (  "*"          PGUID 0 b t f 701 700 701 1119   0       0       0 float84mul - - ));
-DATA(insert OID = 1130 (  "="          PGUID 0 b t t  701      700  16 1120 1131  1132 1132 float84eq eqsel eqjoinsel ));
+DATA(insert OID = 1130 (  "="          PGUID 0 b t t  701      700  16 1120 1131  672 622 float84eq eqsel eqjoinsel ));
 DATA(insert OID = 1131 (  "<>"         PGUID 0 b t f  701      700  16 1121 1130  0 0 float84ne neqsel neqjoinsel ));
 DATA(insert OID = 1132 (  "<"          PGUID 0 b t f  701      700  16 1123 1135  0 0 float84lt intltsel intltjoinsel ));
 DATA(insert OID = 1133 (  ">"          PGUID 0 b t f  701      700  16 1122 1134  0 0 float84gt intgtsel intgtjoinsel ));
index 0dec718..92cb1be 100644 (file)
@@ -83,10 +83,10 @@ oid|oprcode|oid|oprcode
 QUERY: SELECT p1.oid, p1.oprcode, p2.oid, p2.oprcode
 FROM pg_operator AS p1, pg_operator AS p2
 WHERE p1.oprlsortop = p2.oid AND
-    (p1.oprname != '=' OR
+    (p1.oprname != '=' OR p2.oprname != '<' OR
      p1.oprkind != 'b' OR p2.oprkind != 'b' OR
      p1.oprleft != p2.oprleft OR
-     p1.oprright != p2.oprright OR
+     p1.oprleft != p2.oprright OR
      p1.oprresult != 16 OR
      p2.oprresult != 16 OR
      p1.oprrsortop = 0);
@@ -97,9 +97,9 @@ oid|oprcode|oid|oprcode
 QUERY: SELECT p1.oid, p1.oprcode, p2.oid, p2.oprcode
 FROM pg_operator AS p1, pg_operator AS p2
 WHERE p1.oprrsortop = p2.oid AND
-    (p1.oprname != '=' OR
+    (p1.oprname != '=' OR p2.oprname != '<' OR
      p1.oprkind != 'b' OR p2.oprkind != 'b' OR
-     p1.oprleft != p2.oprleft OR
+     p1.oprright != p2.oprleft OR
      p1.oprright != p2.oprright OR
      p1.oprresult != 16 OR
      p2.oprresult != 16 OR
index a4617cc..c2567d2 100644 (file)
@@ -81,18 +81,18 @@ WHERE p1.oprnegate = p2.oid AND
      p2.oprresult != 16 OR
      p1.oid != p2.oprnegate);
 
--- Look for sort operators that don't match.
--- A sort link normally leads from an '='
--- operator to the matching '<' operator.
--- Sort links are not commutative.
+-- Look for mergesort operators that don't match.
+-- A mergesort link leads from an '=' operator to the
+-- sort operator ('<' operator) that's appropriate for
+-- its left-side or right-side data type.
 
 SELECT p1.oid, p1.oprcode, p2.oid, p2.oprcode
 FROM pg_operator AS p1, pg_operator AS p2
 WHERE p1.oprlsortop = p2.oid AND
-    (p1.oprname != '=' OR
+    (p1.oprname != '=' OR p2.oprname != '<' OR
      p1.oprkind != 'b' OR p2.oprkind != 'b' OR
      p1.oprleft != p2.oprleft OR
-     p1.oprright != p2.oprright OR
+     p1.oprleft != p2.oprright OR
      p1.oprresult != 16 OR
      p2.oprresult != 16 OR
      p1.oprrsortop = 0);
@@ -100,9 +100,9 @@ WHERE p1.oprlsortop = p2.oid AND
 SELECT p1.oid, p1.oprcode, p2.oid, p2.oprcode
 FROM pg_operator AS p1, pg_operator AS p2
 WHERE p1.oprrsortop = p2.oid AND
-    (p1.oprname != '=' OR
+    (p1.oprname != '=' OR p2.oprname != '<' OR
      p1.oprkind != 'b' OR p2.oprkind != 'b' OR
-     p1.oprleft != p2.oprleft OR
+     p1.oprright != p2.oprleft OR
      p1.oprright != p2.oprright OR
      p1.oprresult != 16 OR
      p2.oprresult != 16 OR