Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit833f9cb

Browse files
committed
pltcl regression test needs to actually create an opclass, not just one operator.
1 parent4431758 commit833f9cb

File tree

2 files changed

+131
-0
lines changed

2 files changed

+131
-0
lines changed

‎src/pl/tcl/expected/pltcl_setup.out

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,69 @@ create function tcl_int4lt(int4,int4) returns bool as '
434434
}
435435
return f
436436
' language pltcl;
437+
create function tcl_int4le(int4,int4) returns bool as '
438+
if {$1 <= $2} {
439+
return t
440+
}
441+
return f
442+
' language pltcl;
443+
create function tcl_int4eq(int4,int4) returns bool as '
444+
if {$1 == $2} {
445+
return t
446+
}
447+
return f
448+
' language pltcl;
449+
create function tcl_int4ge(int4,int4) returns bool as '
450+
if {$1 >= $2} {
451+
return t
452+
}
453+
return f
454+
' language pltcl;
455+
create function tcl_int4gt(int4,int4) returns bool as '
456+
if {$1 > $2} {
457+
return t
458+
}
459+
return f
460+
' language pltcl;
437461
create operator @< (
438462
leftarg = int4,
439463
rightarg = int4,
440464
procedure = tcl_int4lt
441465
);
466+
create operator @<= (
467+
leftarg = int4,
468+
rightarg = int4,
469+
procedure = tcl_int4le
470+
);
471+
create operator @= (
472+
leftarg = int4,
473+
rightarg = int4,
474+
procedure = tcl_int4eq
475+
);
476+
create operator @>= (
477+
leftarg = int4,
478+
rightarg = int4,
479+
procedure = tcl_int4ge
480+
);
481+
create operator @> (
482+
leftarg = int4,
483+
rightarg = int4,
484+
procedure = tcl_int4gt
485+
);
486+
create function tcl_int4cmp(int4,int4) returns int4 as '
487+
if {$1 < $2} {
488+
return -1
489+
}
490+
if {$1 > $2} {
491+
return 1
492+
}
493+
return 0
494+
' language pltcl;
495+
CREATE OPERATOR CLASS tcl_int4_ops
496+
FOR TYPE int4 USING btree AS
497+
OPERATOR 1 @<,
498+
OPERATOR 2 @<=,
499+
OPERATOR 3 @=,
500+
OPERATOR 4 @>=,
501+
OPERATOR 5 @>,
502+
FUNCTION 1 tcl_int4cmp(int4,int4) ;

‎src/pl/tcl/sql/pltcl_setup.sql

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,9 +472,79 @@ create function tcl_int4lt(int4,int4) returns bool as '
472472
return f
473473
' language pltcl;
474474

475+
createfunctiontcl_int4le(int4,int4) returns boolas'
476+
if {$1 <= $2} {
477+
return t
478+
}
479+
return f
480+
' language pltcl;
481+
482+
createfunctiontcl_int4eq(int4,int4) returns boolas'
483+
if {$1 == $2} {
484+
return t
485+
}
486+
return f
487+
' language pltcl;
488+
489+
createfunctiontcl_int4ge(int4,int4) returns boolas'
490+
if {$1 >= $2} {
491+
return t
492+
}
493+
return f
494+
' language pltcl;
495+
496+
createfunctiontcl_int4gt(int4,int4) returns boolas'
497+
if {$1 > $2} {
498+
return t
499+
}
500+
return f
501+
' language pltcl;
502+
475503
create operator @< (
476504
leftarg= int4,
477505
rightarg= int4,
478506
procedure= tcl_int4lt
479507
);
480508

509+
create operator @<= (
510+
leftarg= int4,
511+
rightarg= int4,
512+
procedure= tcl_int4le
513+
);
514+
515+
create operator @= (
516+
leftarg= int4,
517+
rightarg= int4,
518+
procedure= tcl_int4eq
519+
);
520+
521+
create operator @>= (
522+
leftarg= int4,
523+
rightarg= int4,
524+
procedure= tcl_int4ge
525+
);
526+
527+
create operator @> (
528+
leftarg= int4,
529+
rightarg= int4,
530+
procedure= tcl_int4gt
531+
);
532+
533+
createfunctiontcl_int4cmp(int4,int4) returns int4as'
534+
if {$1 < $2} {
535+
return -1
536+
}
537+
if {$1 > $2} {
538+
return 1
539+
}
540+
return 0
541+
' language pltcl;
542+
543+
CREATEOPERATOR CLASStcl_int4_ops
544+
FOR TYPE int4 USING btreeAS
545+
OPERATOR1 @<,
546+
OPERATOR2 @<=,
547+
OPERATOR3 @=,
548+
OPERATOR4 @>=,
549+
OPERATOR5 @>,
550+
FUNCTION1 tcl_int4cmp(int4,int4) ;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp