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] Add a user schema to your stored procedures for consistency with other objects #5258

Merged

Conversation

jongmin-won
Copy link
Contributor

@jongmin-won jongmin-won commented Jun 14, 2024

http://jira.cubrid.org/browse/CBRD-25352

Purpose
We will implement a feature to create a User Schema in Java Stored Procedure to ensure consistency with other objects such as tables, triggers, serial, servers, and synonyms.

Implementation
N/A

Remarks
AS-IS

  • Procedures and functions can be used by other users, independent of the owner.

CALL login ('test_user1', '') ON CLASS db_user;
CREATE FUNCTION function_hello() RETURN STRING AS LANGUAGE JAVA NAME 'SpCubrid.HelloCubrid() return java.lang.String';

CALL login ('dba', '') ON CLASS db_user;
SELECT function_hello() FROM db_root;

TO-BE

  • When a user other than the owner uses a procedure or function, they must specify the owner_name.

CALL login ('test_user1', '') ON CLASS db_user;
CREATE FUNCTION function_hello() RETURN STRING AS LANGUAGE JAVA NAME 'SpCubrid.HelloCubrid() return java.lang.String';

CALL login ('dba', '') ON CLASS db_user;
SELECT test_user1.function_hello() FROM db_root;

… feature/plcsql-p1n branch to add a user schema to a stored procedure.
@jongmin-won jongmin-won self-assigned this Jun 14, 2024
jongmin-won added 8 commits June 18, 2024 09:04
…ditionally, class methods are system tables and do not require user_schema. ex) 'add_user', 'drop_user', 'find_user'
…Additionally, Resolves an error where the CALL PROCEDURE/FUNCTION statement does not work correctly.
…ocedure object, 2) select hello(); Modified so that [user_name.]hello is displayed when an error message occurs because the corresponding sp cannot be found during execution.
…ion user when executing a CREATE OR REPLACE PROCEDURE/FUNCTION, 2) Add user_schema to SP when performing a schema unload
…d within an if-else-statement when the CALL statement is executed. 2) Added a part to remove the owner and user_schema when the unloaddb utility is executed as a general user, provided that the owner and user_schema are the same.
@jongmin-won jongmin-won force-pushed the feature/plcsql-CBRD-25352 branch from 8140d1b to 4fabc96 Compare July 3, 2024 04:56
@jongmin-won jongmin-won requested review from hgryoo, hyunikn and ctshim July 5, 2024 02:05
@jongmin-won jongmin-won marked this pull request as ready for review July 5, 2024 02:10
@jongmin-won jongmin-won requested a review from beyondykk9 as a code owner July 5, 2024 02:10
jongmin-won added 8 commits July 9, 2024 22:10
…stem method 와 user method (Function& Stored_procedure) 구분을 grammar.y에서 확인하도록 수정
…st에 세션 변수가 있는 경우, csql_grammar.y에서는 세션 변수에 클래스, 객체 또는 상수 중 어떤 값이 포함되어 있는지 알 수 없습니다. 따라서, pt_bind_names()에서 java_stored_procedure가 아니고 on_call_target 값이 있으면 method로 간주하여 [user_schema]를 제거합니다.
…y value 로 잘 못 수정되는 부분 수정, 2) PT_FUNCTION 노드를 수행시 generic_name 값을 항상 downcase 하도록 수정
…evelop과 같이 data_type 토큰을 sp_param_type 토큰으로 변경했습니다.
src/parser/csql_grammar.y Outdated Show resolved Hide resolved
src/sp/sp_catalog.cpp Outdated Show resolved Hide resolved
jongmin-won added 2 commits July 23, 2024 16:51
…value in System pl/csql has been modified as follows. [public].[dbms_output].[System_pl_csql_name] 3) We have decided to integrate the unload_schema code modification into another issue (separated for unload integration testing).
…ma specified in the manual is 222 bytes, but the actual error message is displayed as 223 bytes. Therefore, I have modified the error message.
src/parser/semantic_check.c Outdated Show resolved Hide resolved
src/sp/jsp_cl.cpp Outdated Show resolved Hide resolved
jongmin-won added 5 commits July 29, 2024 13:01
…trdup to generate the sp_info.unique_name value, but failed to release the memory. To rectify this, we have added code to free the memory.
…on character ('\0') when performing downcase.
@jongmin-won jongmin-won merged commit a5d6f28 into CUBRID:feature/plcsql-p1n Aug 5, 2024
8 of 9 checks passed
@jongmin-won jongmin-won deleted the feature/plcsql-CBRD-25352 branch August 5, 2024 06:59
jongmin-won added a commit to CUBRID/cubrid-testcases that referenced this pull request Nov 18, 2024
…DBC, the SQL syntax included in the error message no longer displays [user_schema]. (#1967)

http://jira.cubrid.org/browse/CBRD-25416

In a past PR (CUBRID/cubrid#5258), functionality was added to allow the use of [user_schema] in SPs, and the TC was modified accordingly. However, in PR (CUBRID/cubrid#5615), the logic was updated so that [user_schema] is removed from SPs in JDBC error messages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants