1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-02 09:41:40 +03:00

MDEV-11952 Oracle-style packages: stage#5

- CREATE PACKAGE [BODY] statements are now
  entirely written to mysql.proc with type='PACKAGE' and type='PACKAGE BODY'.
- CREATE PACKAGE BODY now supports IF NOT EXISTS
- DROP PACKAGE BODY now supports IF EXISTS
- CREATE OR REPLACE PACKAGE [BODY] is now supported
- CREATE PACKAGE [BODY] now support the DEFINER clause:

    CREATE DEFINER user@host PACKAGE pkg ... END;
    CREATE DEFINER user@host PACKAGE BODY pkg ... END;

- CREATE PACKAGE [BODY] now supports SQL SECURITY and COMMENT clauses, e.g.:

    CREATE PACKAGE p1 SQL SECURITY INVOKER COMMENT "comment" AS ... END;

- Package routines are now created from the package CREATE PACKAGE BODY
  statement and don't produce individual records in mysql.proc.

- CREATE PACKAGE BODY now supports package-wide variables.
  Package variables can be read and set inside package routines.
  Package variables are stored in a separate sp_rcontext,
  which is cached in THD on the first packate routine call.

- CREATE PACKAGE BODY now supports the initialization section.

- All public routines (i.e. declared in CREATE PACKAGE)
  must have implementations in CREATE PACKAGE BODY

- Only public package routines are available outside of the package

- {CREATE|DROP} PACKAGE [BODY] now respects CREATE ROUTINE and ALTER ROUTINE
  privileges

- "GRANT EXECUTE ON PACKAGE BODY pkg" is now supported

- SHOW CREATE PACKAGE [BODY] is now supported

- SHOW PACKAGE [BODY] STATUS is now supported

- CREATE and DROP for PACKAGE [BODY] now works for non-current databases

- mysqldump now supports packages

- "SHOW {PROCEDURE|FUNCTION) CODE pkg.routine" now works for package routines

- "SHOW PACKAGE BODY CODE pkg" now works (the package initialization section)

- A new package body level MDL was added

- Recursive calls for package procedures are now possible

- Routine forward declarations in CREATE PACKATE BODY are now supported.

- Package body variables now work as SP OUT parameters

- Package body variables now work as SELECT INTO targets

- Package body variables now support ROW, %ROWTYPE, %TYPE
This commit is contained in:
Alexander Barkov
2017-08-18 23:36:42 +04:00
parent 83ea839fb1
commit 583eb96c24
86 changed files with 11064 additions and 278 deletions

View File

@@ -90,7 +90,7 @@ ERROR HY000: Wrong partitions for `t1`: must have at least one HISTORY and exact
alter table t1 add partition (
partition p1 history);
Warnings:
Warning 4113 Maybe missing parameters: no rotation condition for multiple HISTORY partitions.
Warning 4115 Maybe missing parameters: no rotation condition for multiple HISTORY partitions.
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -244,11 +244,11 @@ x
6
insert into t1 values (7), (8);
Warnings:
Warning 4112 Versioned table `test`.`t1`: partition `p1` is full, add more HISTORY partitions
Warning 4114 Versioned table `test`.`t1`: partition `p1` is full, add more HISTORY partitions
### warn about full partition
delete from t1;
Warnings:
Warning 4112 Versioned table `test`.`t1`: partition `p1` is full, add more HISTORY partitions
Warning 4114 Versioned table `test`.`t1`: partition `p1` is full, add more HISTORY partitions
select * from t1 partition (p1) order by x;
x
4
@@ -303,7 +303,7 @@ x
delete from t1 where x < 3;
delete from t1;
Warnings:
Warning 4112 Versioned table `test`.`t1`: partition `p1` is full, add more HISTORY partitions
Warning 4114 Versioned table `test`.`t1`: partition `p1` is full, add more HISTORY partitions
select * from t1 partition (p0) order by x;
x
1
@@ -323,7 +323,7 @@ insert into t1 values (1);
update t1 set x= 2;
update t1 set x= 3;
Warnings:
Warning 4112 Versioned table `test`.`t1`: partition `p1` is full, add more HISTORY partitions
Warning 4114 Versioned table `test`.`t1`: partition `p1` is full, add more HISTORY partitions
select * from t1 partition (p0);
x
1
@@ -498,10 +498,10 @@ insert t1 values (1);
delete from t1;
insert t1 values (2);
Warnings:
Warning 4112 Versioned table `test`.`t1`: partition `p1` is full, add more HISTORY partitions
Warning 4114 Versioned table `test`.`t1`: partition `p1` is full, add more HISTORY partitions
delete from t1;
Warnings:
Warning 4112 Versioned table `test`.`t1`: partition `p1` is full, add more HISTORY partitions
Warning 4114 Versioned table `test`.`t1`: partition `p1` is full, add more HISTORY partitions
alter table t1 add partition (partition p0 history, partition p2 history);
select subpartition_name,table_rows from information_schema.partitions where table_schema='test' and table_name='t1';
subpartition_name table_rows