Details
-
Technical task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.3(EOL)
-
10.2.2-3, 10.2.2-1, 10.2.2-2, 10.2.2-4, 10.1.18
Description
This task is a part of MDEV-10591 Oracle-style packages.
In order for packages to reuse all routine features, such as:
- package-wide variables, exceptions, cursors, etc
- package executable initialization block
under terms ofMDEV-10591we'll introduce new classes (with proposed names Package and Package_body)
and derived these classes from sp_head.
To simplify initialization of the Package* instances, we need to move most the code from sp_head::init to sp_head::sp_head.
The relevant code:
sp_head::init(LEX *lex)
|
{
|
...
|
m_param_begin= NULL;
|
m_param_end= NULL;
|
|
m_body_begin= NULL ;
|
|
m_qname.str= NULL;
|
m_qname.length= 0;
|
|
m_explicit_name= false; |
|
m_db.str= NULL;
|
m_db.length= 0;
|
|
m_name.str= NULL;
|
m_name.length= 0;
|
|
m_params.str= NULL;
|
m_params.length= 0;
|
|
m_body.str= NULL;
|
m_body.length= 0;
|
|
m_defstr.str= NULL;
|
m_defstr.length= 0;
|
|
m_return_field_def.charset= NULL;
|
...
|
}
|
Currently new instances of sp_head are created by LEX::make_sp_head, in this code:
...
|
if ((sp= new sp_head(type))) |
{
|
sp->reset_thd_mem_root(thd);
|
sp->init(this);
|
...
|
Notice, the constructor call in new is immediately followed by init(this).
After this task, the above members will be initialized in the constructor rather than in init().
Attachments
Issue Links
- blocks
-
MDEV-10591 Oracle-style packages
- Closed
-
MDEV-13139 CREATE PACKAGE: package-wide declarations
- Stalled