pltcl regression test needs to actually create an opclass, not just one operator.
authorTom Lane
Tue, 9 Jan 2007 03:13:38 +0000 (03:13 +0000)
committerTom Lane
Tue, 9 Jan 2007 03:13:38 +0000 (03:13 +0000)
src/pl/tcl/expected/pltcl_setup.out
src/pl/tcl/sql/pltcl_setup.sql

index 111d999af20e7daa7e5c4d2eab53c02778822581..ce45aec530ddf7e923f1d7e6c9863621a3857297 100644 (file)
@@ -434,8 +434,69 @@ create function tcl_int4lt(int4,int4) returns bool as '
     }
     return f
 ' language pltcl;
+create function tcl_int4le(int4,int4) returns bool as '
+    if {$1 <= $2} {
+        return t
+    }
+    return f
+' language pltcl;
+create function tcl_int4eq(int4,int4) returns bool as '
+    if {$1 == $2} {
+        return t
+    }
+    return f
+' language pltcl;
+create function tcl_int4ge(int4,int4) returns bool as '
+    if {$1 >= $2} {
+        return t
+    }
+    return f
+' language pltcl;
+create function tcl_int4gt(int4,int4) returns bool as '
+    if {$1 > $2} {
+        return t
+    }
+    return f
+' language pltcl;
 create operator @< (
        leftarg = int4,
        rightarg = int4,
        procedure = tcl_int4lt
    );
+create operator @<= (
+       leftarg = int4,
+       rightarg = int4,
+       procedure = tcl_int4le
+   );
+create operator @= (
+       leftarg = int4,
+       rightarg = int4,
+       procedure = tcl_int4eq
+   );
+create operator @>= (
+       leftarg = int4,
+       rightarg = int4,
+       procedure = tcl_int4ge
+   );
+create operator @> (
+       leftarg = int4,
+       rightarg = int4,
+       procedure = tcl_int4gt
+   );
+create function tcl_int4cmp(int4,int4) returns int4 as '
+    if {$1 < $2} {
+        return -1
+    }
+    if {$1 > $2} {
+        return 1
+    }
+    return 0
+' language pltcl;
+CREATE OPERATOR CLASS tcl_int4_ops
+   FOR TYPE int4 USING btree AS
+   OPERATOR 1  @<,
+   OPERATOR 2  @<=,
+   OPERATOR 3  @=,
+   OPERATOR 4  @>=,
+   OPERATOR 5  @>,
+   FUNCTION 1  tcl_int4cmp(int4,int4) ;
index 062c9f195726950a883bc0754b0342c5a56351b1..b88ebbcffe3f0b0daa44ba35c3affac6cabe840b 100644 (file)
@@ -472,9 +472,79 @@ create function tcl_int4lt(int4,int4) returns bool as '
     return f
 ' language pltcl;
 
+create function tcl_int4le(int4,int4) returns bool as '
+    if {$1 <= $2} {
+        return t
+    }
+    return f
+' language pltcl;
+
+create function tcl_int4eq(int4,int4) returns bool as '
+    if {$1 == $2} {
+        return t
+    }
+    return f
+' language pltcl;
+
+create function tcl_int4ge(int4,int4) returns bool as '
+    if {$1 >= $2} {
+        return t
+    }
+    return f
+' language pltcl;
+
+create function tcl_int4gt(int4,int4) returns bool as '
+    if {$1 > $2} {
+        return t
+    }
+    return f
+' language pltcl;
+
 create operator @< (
        leftarg = int4,
        rightarg = int4,
        procedure = tcl_int4lt
    );
 
+create operator @<= (
+       leftarg = int4,
+       rightarg = int4,
+       procedure = tcl_int4le
+   );
+
+create operator @= (
+       leftarg = int4,
+       rightarg = int4,
+       procedure = tcl_int4eq
+   );
+
+create operator @>= (
+       leftarg = int4,
+       rightarg = int4,
+       procedure = tcl_int4ge
+   );
+
+create operator @> (
+       leftarg = int4,
+       rightarg = int4,
+       procedure = tcl_int4gt
+   );
+
+create function tcl_int4cmp(int4,int4) returns int4 as '
+    if {$1 < $2} {
+        return -1
+    }
+    if {$1 > $2} {
+        return 1
+    }
+    return 0
+' language pltcl;
+
+CREATE OPERATOR CLASS tcl_int4_ops
+   FOR TYPE int4 USING btree AS
+   OPERATOR 1  @<,
+   OPERATOR 2  @<=,
+   OPERATOR 3  @=,
+   OPERATOR 4  @>=,
+   OPERATOR 5  @>,
+   FUNCTION 1  tcl_int4cmp(int4,int4) ;