Skip to content

Commit

Permalink
[CBRD-25097] PL/CSQL phase-0 internal release (#4825)
Browse files Browse the repository at this point in the history
http://jira.cubrid.org/browse/CBRD-25097

This PR includes PL/CSQL project's phase-0 implementations (feature/plcsql).
After this PR is merged in the develop branch, the internal release is considered completed once QA testing is completed for the following features that must be satisfied in phase-0.

The features are as follows:

- PL/CSQL program compiler: The PL/CSQL compiler parses the program according to the PL/CSQL grammar defined in the issue and then includes a module that communicates with the DB server for information needed in CUBRID SQL parts such as Static SQL.
- Support PL/CSQL in DDL (CREATE PROCEDURE/FUNCTION) statement: In CREATE PROCEDURE/FUNCTION statement, stored routine can be written between BEGIN ... END. The stored routine body is sent to the PL/CSQL compiler and it is registered if compiling succeed.
- Support TCL (COMMIT/ROLLBACK) in stored routine: COMMIT and ROLLBACK have been ignored in Java SP. In this change, they are supported if pl_transaction_control parameter is on, which is introduced for backward compatibility.
- Support DBMS_OUTPUT built-in functions: Yet package is not added in CUBRID. But, DBMS_OUTPUT is used frequently to debug or log when users write procedure/function.
  • Loading branch information
hgryoo authored Apr 17, 2024
1 parent edaf6ac commit 9abf046
Show file tree
Hide file tree
Showing 365 changed files with 31,102 additions and 1,810 deletions.
25 changes: 24 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@ test_defaults: &test_defaults
command: |
ulimit -c 1
/entrypoint.sh checkout
circleci tests glob cubrid-testcases/$TEST_SUITE/_* | circleci tests split | tee tc.list
if [ $TEST_SUITE = "plcsql" ]
then
# Hack way to run plcsql test without modifying CUBRID CI docker
TEST_SUITE="sql"
glob_path=cubrid-testcases/sql/{_05_plcsql,_35_fig_cake/plcsql}
elif [ $TEST_SUITE = "sql" ]
then
rm -rf cubrid-testcases/$TEST_SUITE/_05_plcsql
rm -rf cubrid-testcases/$TEST_SUITE/_35_fig_cake/plcsql
glob_path="cubrid-testcases/$TEST_SUITE/_*"
else
glob_path="cubrid-testcases/$TEST_SUITE/_*"
fi
circleci tests glob $glob_path | circleci tests split | tee tc.list
find cubrid-testcases/$TEST_SUITE/_* -maxdepth 0 -type d -print0 | grep -vzZ -f tc.list | xargs -0 rm -rf
/entrypoint.sh test
- run:
Expand Down Expand Up @@ -79,6 +92,13 @@ jobs:
parallelism: 8
<<: *test_defaults

test_plcsql:
<<: *defaults
environment:
TEST_SUITE: plcsql
resource_class: medium
<<: *test_defaults

build-windows:
machine:
image: 'windows-server-2019-vs2019:2022.08.1'
Expand Down Expand Up @@ -124,5 +144,8 @@ workflows:
- test_sql:
requires:
- build
- test_plcsql:
requires:
- build

- build-windows
18 changes: 18 additions & 0 deletions .github/workflows/license_headers/apache_bat3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@echo off

@rem
@rem
@rem Copyright 2016 CUBRID Corporation
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ cm_common/cub_jobsa
cm_common/cub_sainfo
.installed
/java/bin/
/java/jspserver.jar
/java/pl_server.jar
/java/src-jsp/
/java/src/
/msg/*/*.cat
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ add_subdirectory(demo)
add_subdirectory(contrib)
add_subdirectory(locales)
add_subdirectory(timezones)
add_subdirectory(jsp)
add_subdirectory(pl_engine)
if(AT_LEAST_ONE_UNIT_TEST)
add_subdirectory(unit_tests)
endif()
Expand Down
3 changes: 2 additions & 1 deletion cs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ set(JSP_SOURCES

set(METHOD_SOURCES
${METHOD_DIR}/method_connection_cl.cpp
${METHOD_DIR}/method_compile_def.cpp
${METHOD_DIR}/method_callback.cpp
${METHOD_DIR}/method_def.cpp
${METHOD_DIR}/method_error.cpp
Expand Down Expand Up @@ -513,7 +514,7 @@ add_library(cubridcs SHARED
)
set_target_properties(cubridcs PROPERTIES SOVERSION "${CUBRID_MAJOR_VERSION}.${CUBRID_MINOR_VERSION}")

target_compile_definitions(cubridcs PRIVATE CS_MODE ${COMMON_DEFS})
target_compile_definitions(cubridcs PRIVATE CS_MODE CUBRID_EXPORTING ${COMMON_DEFS})
if(NOT USE_CUBRID_ENV)
target_compile_definitions(cubridcs PRIVATE ${DIR_DEFS})
endif(NOT USE_CUBRID_ENV)
Expand Down
5 changes: 4 additions & 1 deletion cubrid/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,11 @@ set(JSP_SOURCES
)

set(METHOD_SOURCES
${METHOD_DIR}/method_connection_java.cpp
${METHOD_DIR}/method_connection_sr.cpp
${METHOD_DIR}/method_connection_pool.cpp
${METHOD_DIR}/method_compile_def.cpp
${METHOD_DIR}/method_compile.cpp
${METHOD_DIR}/method_def.cpp
${METHOD_DIR}/method_error.cpp
${METHOD_DIR}/method_invoke_builtin.cpp
Expand Down Expand Up @@ -518,7 +521,7 @@ if(WIN32)
set_target_properties(cubrid PROPERTIES OUTPUT_NAME libcubrid)
endif(WIN32)

target_compile_definitions(cubrid PRIVATE SERVER_MODE ${COMMON_DEFS})
target_compile_definitions(cubrid PRIVATE SERVER_MODE CUBRID_EXPORTING ${COMMON_DEFS})
if(NOT USE_CUBRID_ENV)
target_compile_definitions(cubrid PRIVATE ${DIR_DEFS})
endif(NOT USE_CUBRID_ENV)
Expand Down
7 changes: 6 additions & 1 deletion demo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@
install(FILES
${CMAKE_SOURCE_DIR}/demo/demodb_objects
${CMAKE_SOURCE_DIR}/demo/demodb_schema
DESTINATION ${CUBRID_DEMODIR})
DESTINATION ${CUBRID_DEMODIR})

install(DIRECTORY
${CMAKE_SOURCE_DIR}/demo/plcsql
DESTINATION ${CUBRID_DEMODIR}
)

if(UNIX)
set(DEMODB_SCRIPT make_cubrid_demo.sh)
Expand Down
Loading

0 comments on commit 9abf046

Please sign in to comment.