Skip to content

Commit 2ed0f32

Browse files
committed
Implements sys package for the following ticket:
- MDEV-19635: System package SYS.DBMS_SQL This patch adds support for dynamic SQL to parse any data manipulation language (DML) or data definition language (DDL) statement using PL/SQL. Added the following functions: - OPEN_CURSOR - Open a new cursor - EXECUTE - Execute a given cursor Added the following procedures: - PARSE - Parse the given statement in the given cursor - CLOSE_CURSOR - Close the cursor when no longer needed for a session As of the moment, '1', corresponding to Oracle's NATIVE DBMS_SQL constant, as PARSE's procedure's (language_flag) 3rd argument, is the only one accepted.
1 parent 41bbbfa commit 2ed0f32

21 files changed

+2161
-8
lines changed

mysql-test/suite/compat/oracle/r/sp-package-i_s.result

Lines changed: 656 additions & 0 deletions
Large diffs are not rendered by default.

mysql-test/suite/compat/oracle/r/sp-package-mysqldump.result

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,50 @@ DROP PACKAGE pkg1;
189189
DROP PACKAGE pkg2;
190190
DROP PROCEDURE p1;
191191
SHOW PACKAGE STATUS;
192+
Db sys
193+
Name dbms_random
194+
Type PACKAGE
195+
Definer root@localhost
196+
Modified 0000-00-00 00:00:00
197+
Created 0000-00-00 00:00:00
198+
Security_type INVOKER
199+
Comment Collection of random routines
200+
character_set_client utf8mb3
201+
collation_connection utf8mb3_general_ci
202+
Database Collation utf8mb3_general_ci
203+
Db sys
204+
Name dbms_sql
205+
Type PACKAGE
206+
Definer root@localhost
207+
Modified 0000-00-00 00:00:00
208+
Created 0000-00-00 00:00:00
209+
Security_type INVOKER
210+
Comment Collection of sql routines
211+
character_set_client utf8mb3
212+
collation_connection utf8mb3_general_ci
213+
Database Collation utf8mb3_general_ci
214+
Db sys
215+
Name dbms_utility
216+
Type PACKAGE
217+
Definer root@localhost
218+
Modified 0000-00-00 00:00:00
219+
Created 0000-00-00 00:00:00
220+
Security_type INVOKER
221+
Comment Collection of utility routines
222+
character_set_client utf8mb3
223+
collation_connection utf8mb3_general_ci
224+
Database Collation utf8mb3_general_ci
225+
Db sys
226+
Name UTL_I18N
227+
Type PACKAGE
228+
Definer root@localhost
229+
Modified 0000-00-00 00:00:00
230+
Created 0000-00-00 00:00:00
231+
Security_type INVOKER
232+
Comment Collection of routines to manipulate RAW data
233+
character_set_client utf8mb3
234+
collation_connection utf8mb3_general_ci
235+
Database Collation utf8mb3_general_ci
192236
Db test
193237
Name pkg1
194238
Type PACKAGE
@@ -212,6 +256,50 @@ character_set_client latin1
212256
collation_connection latin1_swedish_ci
213257
Database Collation utf8mb4_uca1400_ai_ci
214258
SHOW PACKAGE BODY STATUS;
259+
Db sys
260+
Name dbms_random
261+
Type PACKAGE BODY
262+
Definer root@localhost
263+
Modified 0000-00-00 00:00:00
264+
Created 0000-00-00 00:00:00
265+
Security_type INVOKER
266+
Comment
267+
character_set_client utf8mb3
268+
collation_connection utf8mb3_general_ci
269+
Database Collation utf8mb3_general_ci
270+
Db sys
271+
Name dbms_sql
272+
Type PACKAGE BODY
273+
Definer root@localhost
274+
Modified 0000-00-00 00:00:00
275+
Created 0000-00-00 00:00:00
276+
Security_type INVOKER
277+
Comment
278+
character_set_client utf8mb3
279+
collation_connection utf8mb3_general_ci
280+
Database Collation utf8mb3_general_ci
281+
Db sys
282+
Name dbms_utility
283+
Type PACKAGE BODY
284+
Definer root@localhost
285+
Modified 0000-00-00 00:00:00
286+
Created 0000-00-00 00:00:00
287+
Security_type INVOKER
288+
Comment
289+
character_set_client utf8mb3
290+
collation_connection utf8mb3_general_ci
291+
Database Collation utf8mb3_general_ci
292+
Db sys
293+
Name UTL_I18N
294+
Type PACKAGE BODY
295+
Definer root@localhost
296+
Modified 0000-00-00 00:00:00
297+
Created 0000-00-00 00:00:00
298+
Security_type INVOKER
299+
Comment
300+
character_set_client utf8mb3
301+
collation_connection utf8mb3_general_ci
302+
Database Collation utf8mb3_general_ci
215303
Db test
216304
Name pkg1
217305
Type PACKAGE BODY

mysql-test/suite/compat/oracle/r/sp-package.result

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,17 @@ character_set_client utf8mb3
724724
collation_connection utf8mb3_general_ci
725725
Database Collation utf8mb3_general_ci
726726
Db sys
727+
Name dbms_sql
728+
Type PACKAGE
729+
Definer root@localhost
730+
Modified 0000-00-00 00:00:00
731+
Created 0000-00-00 00:00:00
732+
Security_type INVOKER
733+
Comment Collection of sql routines
734+
character_set_client utf8mb3
735+
collation_connection utf8mb3_general_ci
736+
Database Collation utf8mb3_general_ci
737+
Db sys
727738
Name dbms_utility
728739
Type PACKAGE
729740
Definer root@localhost
@@ -734,6 +745,17 @@ Comment Collection of utility routines
734745
character_set_client utf8mb3
735746
collation_connection utf8mb3_general_ci
736747
Database Collation utf8mb3_general_ci
748+
Db sys
749+
Name UTL_I18N
750+
Type PACKAGE
751+
Definer root@localhost
752+
Modified 0000-00-00 00:00:00
753+
Created 0000-00-00 00:00:00
754+
Security_type INVOKER
755+
Comment Collection of routines to manipulate RAW data
756+
character_set_client utf8mb3
757+
collation_connection utf8mb3_general_ci
758+
Database Collation utf8mb3_general_ci
737759
Db test
738760
Name test2
739761
Type PACKAGE
@@ -758,6 +780,17 @@ character_set_client utf8mb3
758780
collation_connection utf8mb3_general_ci
759781
Database Collation utf8mb3_general_ci
760782
Db sys
783+
Name dbms_sql
784+
Type PACKAGE BODY
785+
Definer root@localhost
786+
Modified 0000-00-00 00:00:00
787+
Created 0000-00-00 00:00:00
788+
Security_type INVOKER
789+
Comment
790+
character_set_client utf8mb3
791+
collation_connection utf8mb3_general_ci
792+
Database Collation utf8mb3_general_ci
793+
Db sys
761794
Name dbms_utility
762795
Type PACKAGE BODY
763796
Definer root@localhost
@@ -768,6 +801,17 @@ Comment
768801
character_set_client utf8mb3
769802
collation_connection utf8mb3_general_ci
770803
Database Collation utf8mb3_general_ci
804+
Db sys
805+
Name UTL_I18N
806+
Type PACKAGE BODY
807+
Definer root@localhost
808+
Modified 0000-00-00 00:00:00
809+
Created 0000-00-00 00:00:00
810+
Security_type INVOKER
811+
Comment
812+
character_set_client utf8mb3
813+
collation_connection utf8mb3_general_ci
814+
Database Collation utf8mb3_general_ci
771815
Db test
772816
Name test2
773817
Type PACKAGE BODY
@@ -861,6 +905,17 @@ character_set_client utf8mb3
861905
collation_connection utf8mb3_general_ci
862906
Database Collation utf8mb3_general_ci
863907
Db sys
908+
Name dbms_sql
909+
Type PACKAGE
910+
Definer root@localhost
911+
Modified 0000-00-00 00:00:00
912+
Created 0000-00-00 00:00:00
913+
Security_type INVOKER
914+
Comment Collection of sql routines
915+
character_set_client utf8mb3
916+
collation_connection utf8mb3_general_ci
917+
Database Collation utf8mb3_general_ci
918+
Db sys
864919
Name dbms_utility
865920
Type PACKAGE
866921
Definer root@localhost
@@ -871,6 +926,17 @@ Comment Collection of utility routines
871926
character_set_client utf8mb3
872927
collation_connection utf8mb3_general_ci
873928
Database Collation utf8mb3_general_ci
929+
Db sys
930+
Name UTL_I18N
931+
Type PACKAGE
932+
Definer root@localhost
933+
Modified 0000-00-00 00:00:00
934+
Created 0000-00-00 00:00:00
935+
Security_type INVOKER
936+
Comment Collection of routines to manipulate RAW data
937+
character_set_client utf8mb3
938+
collation_connection utf8mb3_general_ci
939+
Database Collation utf8mb3_general_ci
874940
Db test2
875941
Name test2
876942
Type PACKAGE
@@ -895,6 +961,17 @@ character_set_client utf8mb3
895961
collation_connection utf8mb3_general_ci
896962
Database Collation utf8mb3_general_ci
897963
Db sys
964+
Name dbms_sql
965+
Type PACKAGE BODY
966+
Definer root@localhost
967+
Modified 0000-00-00 00:00:00
968+
Created 0000-00-00 00:00:00
969+
Security_type INVOKER
970+
Comment
971+
character_set_client utf8mb3
972+
collation_connection utf8mb3_general_ci
973+
Database Collation utf8mb3_general_ci
974+
Db sys
898975
Name dbms_utility
899976
Type PACKAGE BODY
900977
Definer root@localhost
@@ -905,6 +982,17 @@ Comment
905982
character_set_client utf8mb3
906983
collation_connection utf8mb3_general_ci
907984
Database Collation utf8mb3_general_ci
985+
Db sys
986+
Name UTL_I18N
987+
Type PACKAGE BODY
988+
Definer root@localhost
989+
Modified 0000-00-00 00:00:00
990+
Created 0000-00-00 00:00:00
991+
Security_type INVOKER
992+
Comment
993+
character_set_client utf8mb3
994+
collation_connection utf8mb3_general_ci
995+
Database Collation utf8mb3_general_ci
908996
Db test2
909997
Name test2
910998
Type PACKAGE BODY

mysql-test/suite/sysschema/r/all_sys_objects_exist.result

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,14 @@ sys_get_config FUNCTION
127127
version_major FUNCTION
128128
version_minor FUNCTION
129129
version_patch FUNCTION
130+
dbms_random PACKAGE
131+
dbms_sql PACKAGE
132+
dbms_utility PACKAGE
133+
UTL_I18N PACKAGE
134+
dbms_random PACKAGE BODY
135+
dbms_sql PACKAGE BODY
136+
dbms_utility PACKAGE BODY
137+
UTL_I18N PACKAGE BODY
130138
create_synonym_db PROCEDURE
131139
diagnostics PROCEDURE
132140
execute_prepared_stmt PROCEDURE

0 commit comments

Comments
 (0)