SET sql_mode=ORACLE; CREATE PROCEDURE p1 AS BEGIN SELECT pkg1.f1(); -- a standalone routine calls a package routine END; $$ CREATE PACKAGE pkg1 AS PROCEDURE p1; FUNCTION f1 RETURN INT; END; $$ CREATE PACKAGE BODY pkg1 AS PROCEDURE p1 AS BEGIN CALL test.p1; -- a package routine calls a standalone routine END; FUNCTION f1 RETURN INT AS BEGIN RETURN 10; END; END; $$ CALL p1; pkg1.f1() 10 CALL pkg1.p1; pkg1.f1() 10 SELECT pkg1.f1(); pkg1.f1() 10 CREATE PACKAGE pkg2 AS PROCEDURE p1; FUNCTION f1 RETURN INT; END; $$ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT' */ ; /*!50003 DROP PROCEDURE IF EXISTS `p1` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; /*!50003 SET character_set_client = latin1 */ ; /*!50003 SET character_set_results = latin1 */ ; /*!50003 SET collation_connection = latin1_swedish_ci */ ; DELIMITER ;; CREATE DEFINER="root"@"localhost" PROCEDURE "p1"() AS BEGIN SELECT pkg1.f1(); -- a standalone routine calls a package routine END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT' */ ; /*!50003 DROP PACKAGE IF EXISTS `pkg1` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; /*!50003 SET character_set_client = latin1 */ ; /*!50003 SET character_set_results = latin1 */ ; /*!50003 SET collation_connection = latin1_swedish_ci */ ; DELIMITER ;; CREATE DEFINER="root"@"localhost" PACKAGE "pkg1" AS PROCEDURE p1; FUNCTION f1 RETURN INT; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT' */ ; /*!50003 DROP PACKAGE IF EXISTS `pkg2` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; /*!50003 SET character_set_client = latin1 */ ; /*!50003 SET character_set_results = latin1 */ ; /*!50003 SET collation_connection = latin1_swedish_ci */ ; DELIMITER ;; CREATE DEFINER="root"@"localhost" PACKAGE "pkg2" AS PROCEDURE p1; FUNCTION f1 RETURN INT; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT' */ ; /*!50003 DROP PACKAGE BODY IF EXISTS `pkg1` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; /*!50003 SET character_set_client = latin1 */ ; /*!50003 SET character_set_results = latin1 */ ; /*!50003 SET collation_connection = latin1_swedish_ci */ ; DELIMITER ;; CREATE DEFINER="root"@"localhost" PACKAGE BODY "pkg1" AS PROCEDURE p1 AS BEGIN CALL test.p1; -- a package routine calls a standalone routine END; FUNCTION f1 RETURN INT AS BEGIN RETURN 10; END; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET character_set_client = @saved_cs_client */ ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; DROP PACKAGE pkg1; DROP PACKAGE pkg2; DROP PROCEDURE p1; SHOW PACKAGE STATUS; Db test Name pkg1 Type PACKAGE Definer root@localhost Modified 0000-00-00 00:00:00 Created 0000-00-00 00:00:00 Security_type DEFINER Comment character_set_client latin1 collation_connection latin1_swedish_ci Database Collation latin1_swedish_ci Db test Name pkg2 Type PACKAGE Definer root@localhost Modified 0000-00-00 00:00:00 Created 0000-00-00 00:00:00 Security_type DEFINER Comment character_set_client latin1 collation_connection latin1_swedish_ci Database Collation latin1_swedish_ci SHOW PACKAGE BODY STATUS; Db test Name pkg1 Type PACKAGE BODY Definer root@localhost Modified 0000-00-00 00:00:00 Created 0000-00-00 00:00:00 Security_type DEFINER Comment character_set_client latin1 collation_connection latin1_swedish_ci Database Collation latin1_swedish_ci SHOW CREATE PACKAGE pkg1; Package sql_mode Create Package character_set_client collation_connection Database Collation pkg1 PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" PACKAGE "pkg1" AS PROCEDURE p1; FUNCTION f1 RETURN INT; END latin1 latin1_swedish_ci latin1_swedish_ci SHOW CREATE PACKAGE pkg2; Package sql_mode Create Package character_set_client collation_connection Database Collation pkg2 PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" PACKAGE "pkg2" AS PROCEDURE p1; FUNCTION f1 RETURN INT; END latin1 latin1_swedish_ci latin1_swedish_ci SHOW CREATE PACKAGE BODY pkg1; Package body sql_mode Create Package Body character_set_client collation_connection Database Collation pkg1 PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" PACKAGE BODY "pkg1" AS PROCEDURE p1 AS BEGIN CALL test.p1; END; FUNCTION f1 RETURN INT AS BEGIN RETURN 10; END; END latin1 latin1_swedish_ci latin1_swedish_ci CALL p1; pkg1.f1() 10 CALL pkg1.p1; pkg1.f1() 10 SELECT pkg1.f1(); pkg1.f1() 10 DROP PACKAGE pkg1; DROP PACKAGE pkg2; DROP PROCEDURE p1; # removing the dump file