Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CBRD-25352] Revised test case for CBRD-25352 (11.4) #2025

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
===================================================

create test class with method (method name: set_cost)
create test class with method (method name: dummy_fn)

===================================================
0
Expand All @@ -12,82 +12,72 @@ dba.rectangle

===================================================

call set_cost(method)
ERROR: Method "dummy_fn_tmp" not found

===================================================
Error:-208
===================================================

nl-join
ERROR: Unresolved method "dummy_fn"

===================================================
set_cost(r, 'nl-join', '0')
nl-join

Error:-236
===================================================
11 set_cost(r, 'nl-join', '0') 'aaa'
11 nl-join aaa

Error:-236
===================================================
Error:-236
===================================================

ERROR: Function dba.set_cost is undefined
ERROR: Function dba.dummy_fn is undefined

===================================================
Error:-494
===================================================

create test function (sp name: set_cost)

Error:-494
===================================================
0
Error:-494
===================================================

call instance method (set_cost)
Create javaSP (dummy_fn)

===================================================

nl-join
0
===================================================
dummy_fn(1)
2

===================================================

ERROR: Unknown variable rr
if same name as method and javaSP then javaSP is first

===================================================
Error:-494
===================================================

ERROR: Stored procedure execute error: Argument count mismatch: expected 1, but 3
ERROR: Parameter count is invalid. expected: 1, actual: 2

===================================================
Error:-888
===================================================

call javasp (set_cost)
ERROR: Unresolved method "dummy_fn"

===================================================
set_cost(1)
2

Error:-236
===================================================

ERROR: Stored procedure execute error: Argument count mismatch: expected 1, but 3
Result: 2

===================================================
Error:-888
===================================================

call javasp (dba.set_cost)
dba.dummy_fn(1)
2

===================================================
dba.set_cost(1)
dba.dummy_fn(1)
2

===================================================

Test done

===================================================

null

===================================================
0
===================================================
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
-- Verified for CBRD-25352
-- check when same name method and javaSP

evaluate 'create test class with method (method name: dummy_fn)';
create class rectangle(height int) dont_reuse_oid
method dummy_fn(string) string function dummy_fn;
insert into rectangle values (10);

select rectangle into :r from rectangle where height=10 order by rectangle;

-- Test only instance method, it is not related CBRD-25352
evaluate 'ERROR: Method "dummy_fn_tmp" not found';
call dummy_fn_tmp(1) on :r;

evaluate 'ERROR: Unresolved method "dummy_fn"';
call dummy_fn(1) on :r;
call dummy_fn(:r, 1);
call dba.dummy_fn(:r, 1);

evaluate 'ERROR: Function dba.dummy_fn is undefined';
select dba.dummy_fn(1) on :r from rectangle;
select dba.dummy_fn(:r, 1) from rectangle;
select dba.dummy_fn(:r, 1) from dual;
-- Test Done


evaluate 'Create javaSP (dummy_fn)';
create or replace function dummy_fn(i in int) return int
as language java name 'SpTest.testInt(int) return int' comment 'this is the comment for function f';

select dummy_fn(1) from dual;

evaluate 'if same name as method and javaSP then javaSP is first';
evaluate 'ERROR: Parameter count is invalid. expected: 1, actual: 2';
call dummy_fn(:r, 1);

evaluate 'ERROR: Unresolved method "dummy_fn"';
call dummy_fn(1) on :r;

evaluate 'Result: 2';
select dba.dummy_fn(1) from dual;
select dba.dummy_fn(1) from rectangle;



evaluate 'Test done';
drop table rectangle;
drop function dummy_fn;

This file was deleted.