Simplistic, experimental framework for Stored Procedures (SPs).
Implements creation and dropping of PROCEDUREs, IN, OUT, and INOUT parameters,
single-statement procedures, rudimentary multi-statement (begin-end) prodedures
(when the client can handle it), and local variables.
Missing most of the embedded SQL language, all attributes, FUNCTIONs, error handling,
reparses procedures at each call (no caching), etc, etc.
Certainly buggy too, but procedures can actually be created and called....
2002-12-08 19:59:22 +01:00
|
|
|
/* -*- C++ -*- */
|
|
|
|
/* Copyright (C) 2002 MySQL AB
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
|
|
|
|
|
|
|
#ifndef _SP_PCONTEXT_H_
|
|
|
|
#define _SP_PCONTEXT_H_
|
|
|
|
|
|
|
|
#ifdef __GNUC__
|
|
|
|
#pragma interface /* gcc class implementation */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
sp_param_in,
|
|
|
|
sp_param_out,
|
|
|
|
sp_param_inout
|
|
|
|
} sp_param_mode_t;
|
|
|
|
|
2003-10-10 16:57:21 +02:00
|
|
|
typedef struct sp_pvar
|
Simplistic, experimental framework for Stored Procedures (SPs).
Implements creation and dropping of PROCEDUREs, IN, OUT, and INOUT parameters,
single-statement procedures, rudimentary multi-statement (begin-end) prodedures
(when the client can handle it), and local variables.
Missing most of the embedded SQL language, all attributes, FUNCTIONs, error handling,
reparses procedures at each call (no caching), etc, etc.
Certainly buggy too, but procedures can actually be created and called....
2002-12-08 19:59:22 +01:00
|
|
|
{
|
2003-03-26 12:29:58 +01:00
|
|
|
LEX_STRING name;
|
Simplistic, experimental framework for Stored Procedures (SPs).
Implements creation and dropping of PROCEDUREs, IN, OUT, and INOUT parameters,
single-statement procedures, rudimentary multi-statement (begin-end) prodedures
(when the client can handle it), and local variables.
Missing most of the embedded SQL language, all attributes, FUNCTIONs, error handling,
reparses procedures at each call (no caching), etc, etc.
Certainly buggy too, but procedures can actually be created and called....
2002-12-08 19:59:22 +01:00
|
|
|
enum enum_field_types type;
|
|
|
|
sp_param_mode_t mode;
|
|
|
|
uint offset; // Offset in current frame
|
|
|
|
my_bool isset;
|
2004-04-06 15:48:58 +02:00
|
|
|
Item *dflt;
|
Simplistic, experimental framework for Stored Procedures (SPs).
Implements creation and dropping of PROCEDUREs, IN, OUT, and INOUT parameters,
single-statement procedures, rudimentary multi-statement (begin-end) prodedures
(when the client can handle it), and local variables.
Missing most of the embedded SQL language, all attributes, FUNCTIONs, error handling,
reparses procedures at each call (no caching), etc, etc.
Certainly buggy too, but procedures can actually be created and called....
2002-12-08 19:59:22 +01:00
|
|
|
} sp_pvar_t;
|
|
|
|
|
2004-08-17 20:20:58 +02:00
|
|
|
|
|
|
|
#define SP_LAB_REF 0 // Unresolved reference (for goto)
|
|
|
|
#define SP_LAB_GOTO 1 // Free goto label
|
|
|
|
#define SP_LAB_BEGIN 2 // Label at BEGIN
|
|
|
|
#define SP_LAB_ITER 3 // Label at iteration control
|
|
|
|
|
2002-12-16 15:40:44 +01:00
|
|
|
typedef struct sp_label
|
2002-12-11 14:24:29 +01:00
|
|
|
{
|
|
|
|
char *name;
|
|
|
|
uint ip; // Instruction index
|
2004-08-17 20:20:58 +02:00
|
|
|
int type; // begin/iter or ref/free
|
2004-08-26 12:54:30 +02:00
|
|
|
struct sp_pcontext *ctx; // The label's context
|
2002-12-11 14:24:29 +01:00
|
|
|
} sp_label_t;
|
|
|
|
|
2003-09-16 14:26:08 +02:00
|
|
|
typedef struct sp_cond_type
|
|
|
|
{
|
|
|
|
enum { number, state, warning, notfound, exception } type;
|
|
|
|
char sqlstate[6];
|
|
|
|
uint mysqlerr;
|
|
|
|
} sp_cond_type_t;
|
|
|
|
|
|
|
|
typedef struct sp_cond
|
|
|
|
{
|
|
|
|
LEX_STRING name;
|
|
|
|
sp_cond_type_t *val;
|
|
|
|
} sp_cond_t;
|
|
|
|
|
Simplistic, experimental framework for Stored Procedures (SPs).
Implements creation and dropping of PROCEDUREs, IN, OUT, and INOUT parameters,
single-statement procedures, rudimentary multi-statement (begin-end) prodedures
(when the client can handle it), and local variables.
Missing most of the embedded SQL language, all attributes, FUNCTIONs, error handling,
reparses procedures at each call (no caching), etc, etc.
Certainly buggy too, but procedures can actually be created and called....
2002-12-08 19:59:22 +01:00
|
|
|
class sp_pcontext : public Sql_alloc
|
|
|
|
{
|
|
|
|
sp_pcontext(const sp_pcontext &); /* Prevent use of these */
|
|
|
|
void operator=(sp_pcontext &);
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2004-08-26 12:54:30 +02:00
|
|
|
sp_pcontext(sp_pcontext *prev);
|
Simplistic, experimental framework for Stored Procedures (SPs).
Implements creation and dropping of PROCEDUREs, IN, OUT, and INOUT parameters,
single-statement procedures, rudimentary multi-statement (begin-end) prodedures
(when the client can handle it), and local variables.
Missing most of the embedded SQL language, all attributes, FUNCTIONs, error handling,
reparses procedures at each call (no caching), etc, etc.
Certainly buggy too, but procedures can actually be created and called....
2002-12-08 19:59:22 +01:00
|
|
|
|
2003-04-02 20:42:28 +02:00
|
|
|
// Free memory
|
|
|
|
void
|
|
|
|
destroy();
|
|
|
|
|
2004-08-26 12:54:30 +02:00
|
|
|
sp_pcontext *
|
|
|
|
push_context();
|
2003-11-13 19:34:56 +01:00
|
|
|
|
2004-08-26 12:54:30 +02:00
|
|
|
// Returns the previous context, not the one we pop
|
|
|
|
sp_pcontext *
|
|
|
|
pop_context();
|
2004-08-17 20:20:58 +02:00
|
|
|
|
2004-08-26 12:54:30 +02:00
|
|
|
sp_pcontext *
|
|
|
|
parent_context()
|
2004-08-17 20:20:58 +02:00
|
|
|
{
|
2004-08-26 12:54:30 +02:00
|
|
|
return m_parent;
|
2004-08-17 20:20:58 +02:00
|
|
|
}
|
|
|
|
|
2004-08-26 12:54:30 +02:00
|
|
|
uint
|
|
|
|
diff_handlers(sp_pcontext *ctx);
|
|
|
|
|
|
|
|
uint
|
|
|
|
diff_cursors(sp_pcontext *ctx);
|
2004-08-17 20:20:58 +02:00
|
|
|
|
2003-11-13 19:34:56 +01:00
|
|
|
|
2003-09-16 14:26:08 +02:00
|
|
|
//
|
|
|
|
// Parameters and variables
|
|
|
|
//
|
|
|
|
|
Simplistic, experimental framework for Stored Procedures (SPs).
Implements creation and dropping of PROCEDUREs, IN, OUT, and INOUT parameters,
single-statement procedures, rudimentary multi-statement (begin-end) prodedures
(when the client can handle it), and local variables.
Missing most of the embedded SQL language, all attributes, FUNCTIONs, error handling,
reparses procedures at each call (no caching), etc, etc.
Certainly buggy too, but procedures can actually be created and called....
2002-12-08 19:59:22 +01:00
|
|
|
inline uint
|
2004-08-26 12:54:30 +02:00
|
|
|
max_pvars()
|
Simplistic, experimental framework for Stored Procedures (SPs).
Implements creation and dropping of PROCEDUREs, IN, OUT, and INOUT parameters,
single-statement procedures, rudimentary multi-statement (begin-end) prodedures
(when the client can handle it), and local variables.
Missing most of the embedded SQL language, all attributes, FUNCTIONs, error handling,
reparses procedures at each call (no caching), etc, etc.
Certainly buggy too, but procedures can actually be created and called....
2002-12-08 19:59:22 +01:00
|
|
|
{
|
2004-08-26 12:54:30 +02:00
|
|
|
return m_psubsize + m_pvar.elements;
|
Simplistic, experimental framework for Stored Procedures (SPs).
Implements creation and dropping of PROCEDUREs, IN, OUT, and INOUT parameters,
single-statement procedures, rudimentary multi-statement (begin-end) prodedures
(when the client can handle it), and local variables.
Missing most of the embedded SQL language, all attributes, FUNCTIONs, error handling,
reparses procedures at each call (no caching), etc, etc.
Certainly buggy too, but procedures can actually be created and called....
2002-12-08 19:59:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
inline uint
|
2004-08-26 12:54:30 +02:00
|
|
|
current_pvars()
|
Simplistic, experimental framework for Stored Procedures (SPs).
Implements creation and dropping of PROCEDUREs, IN, OUT, and INOUT parameters,
single-statement procedures, rudimentary multi-statement (begin-end) prodedures
(when the client can handle it), and local variables.
Missing most of the embedded SQL language, all attributes, FUNCTIONs, error handling,
reparses procedures at each call (no caching), etc, etc.
Certainly buggy too, but procedures can actually be created and called....
2002-12-08 19:59:22 +01:00
|
|
|
{
|
2004-08-26 12:54:30 +02:00
|
|
|
return m_poffset + m_pvar.elements;
|
Simplistic, experimental framework for Stored Procedures (SPs).
Implements creation and dropping of PROCEDUREs, IN, OUT, and INOUT parameters,
single-statement procedures, rudimentary multi-statement (begin-end) prodedures
(when the client can handle it), and local variables.
Missing most of the embedded SQL language, all attributes, FUNCTIONs, error handling,
reparses procedures at each call (no caching), etc, etc.
Certainly buggy too, but procedures can actually be created and called....
2002-12-08 19:59:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
inline uint
|
2004-08-26 12:54:30 +02:00
|
|
|
context_pvars()
|
Simplistic, experimental framework for Stored Procedures (SPs).
Implements creation and dropping of PROCEDUREs, IN, OUT, and INOUT parameters,
single-statement procedures, rudimentary multi-statement (begin-end) prodedures
(when the client can handle it), and local variables.
Missing most of the embedded SQL language, all attributes, FUNCTIONs, error handling,
reparses procedures at each call (no caching), etc, etc.
Certainly buggy too, but procedures can actually be created and called....
2002-12-08 19:59:22 +01:00
|
|
|
{
|
2004-08-26 12:54:30 +02:00
|
|
|
return m_pvar.elements;
|
Simplistic, experimental framework for Stored Procedures (SPs).
Implements creation and dropping of PROCEDUREs, IN, OUT, and INOUT parameters,
single-statement procedures, rudimentary multi-statement (begin-end) prodedures
(when the client can handle it), and local variables.
Missing most of the embedded SQL language, all attributes, FUNCTIONs, error handling,
reparses procedures at each call (no caching), etc, etc.
Certainly buggy too, but procedures can actually be created and called....
2002-12-08 19:59:22 +01:00
|
|
|
}
|
|
|
|
|
2004-08-26 12:54:30 +02:00
|
|
|
inline uint
|
|
|
|
pvar_context2index(uint i)
|
Simplistic, experimental framework for Stored Procedures (SPs).
Implements creation and dropping of PROCEDUREs, IN, OUT, and INOUT parameters,
single-statement procedures, rudimentary multi-statement (begin-end) prodedures
(when the client can handle it), and local variables.
Missing most of the embedded SQL language, all attributes, FUNCTIONs, error handling,
reparses procedures at each call (no caching), etc, etc.
Certainly buggy too, but procedures can actually be created and called....
2002-12-08 19:59:22 +01:00
|
|
|
{
|
2004-08-26 12:54:30 +02:00
|
|
|
return m_poffset + i;
|
Simplistic, experimental framework for Stored Procedures (SPs).
Implements creation and dropping of PROCEDUREs, IN, OUT, and INOUT parameters,
single-statement procedures, rudimentary multi-statement (begin-end) prodedures
(when the client can handle it), and local variables.
Missing most of the embedded SQL language, all attributes, FUNCTIONs, error handling,
reparses procedures at each call (no caching), etc, etc.
Certainly buggy too, but procedures can actually be created and called....
2002-12-08 19:59:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
inline void
|
|
|
|
set_type(uint i, enum enum_field_types type)
|
|
|
|
{
|
2003-04-02 20:42:28 +02:00
|
|
|
sp_pvar_t *p= find_pvar(i);
|
|
|
|
|
|
|
|
if (p)
|
|
|
|
p->type= type;
|
Simplistic, experimental framework for Stored Procedures (SPs).
Implements creation and dropping of PROCEDUREs, IN, OUT, and INOUT parameters,
single-statement procedures, rudimentary multi-statement (begin-end) prodedures
(when the client can handle it), and local variables.
Missing most of the embedded SQL language, all attributes, FUNCTIONs, error handling,
reparses procedures at each call (no caching), etc, etc.
Certainly buggy too, but procedures can actually be created and called....
2002-12-08 19:59:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
inline void
|
|
|
|
set_isset(uint i, my_bool val)
|
|
|
|
{
|
2003-04-02 20:42:28 +02:00
|
|
|
sp_pvar_t *p= find_pvar(i);
|
|
|
|
|
|
|
|
if (p)
|
|
|
|
p->isset= val;
|
Simplistic, experimental framework for Stored Procedures (SPs).
Implements creation and dropping of PROCEDUREs, IN, OUT, and INOUT parameters,
single-statement procedures, rudimentary multi-statement (begin-end) prodedures
(when the client can handle it), and local variables.
Missing most of the embedded SQL language, all attributes, FUNCTIONs, error handling,
reparses procedures at each call (no caching), etc, etc.
Certainly buggy too, but procedures can actually be created and called....
2002-12-08 19:59:22 +01:00
|
|
|
}
|
|
|
|
|
2004-04-06 15:48:58 +02:00
|
|
|
inline void
|
|
|
|
set_default(uint i, Item *it)
|
|
|
|
{
|
|
|
|
sp_pvar_t *p= find_pvar(i);
|
|
|
|
|
|
|
|
if (p)
|
|
|
|
p->dflt= it;
|
|
|
|
}
|
|
|
|
|
Simplistic, experimental framework for Stored Procedures (SPs).
Implements creation and dropping of PROCEDUREs, IN, OUT, and INOUT parameters,
single-statement procedures, rudimentary multi-statement (begin-end) prodedures
(when the client can handle it), and local variables.
Missing most of the embedded SQL language, all attributes, FUNCTIONs, error handling,
reparses procedures at each call (no caching), etc, etc.
Certainly buggy too, but procedures can actually be created and called....
2002-12-08 19:59:22 +01:00
|
|
|
void
|
2003-09-16 14:26:08 +02:00
|
|
|
push_pvar(LEX_STRING *name, enum enum_field_types type, sp_param_mode_t mode);
|
Simplistic, experimental framework for Stored Procedures (SPs).
Implements creation and dropping of PROCEDUREs, IN, OUT, and INOUT parameters,
single-statement procedures, rudimentary multi-statement (begin-end) prodedures
(when the client can handle it), and local variables.
Missing most of the embedded SQL language, all attributes, FUNCTIONs, error handling,
reparses procedures at each call (no caching), etc, etc.
Certainly buggy too, but procedures can actually be created and called....
2002-12-08 19:59:22 +01:00
|
|
|
|
2002-12-11 14:24:29 +01:00
|
|
|
// Pop the last 'num' slots of the frame
|
Simplistic, experimental framework for Stored Procedures (SPs).
Implements creation and dropping of PROCEDUREs, IN, OUT, and INOUT parameters,
single-statement procedures, rudimentary multi-statement (begin-end) prodedures
(when the client can handle it), and local variables.
Missing most of the embedded SQL language, all attributes, FUNCTIONs, error handling,
reparses procedures at each call (no caching), etc, etc.
Certainly buggy too, but procedures can actually be created and called....
2002-12-08 19:59:22 +01:00
|
|
|
inline void
|
2003-09-16 14:26:08 +02:00
|
|
|
pop_pvar(uint num = 1)
|
Simplistic, experimental framework for Stored Procedures (SPs).
Implements creation and dropping of PROCEDUREs, IN, OUT, and INOUT parameters,
single-statement procedures, rudimentary multi-statement (begin-end) prodedures
(when the client can handle it), and local variables.
Missing most of the embedded SQL language, all attributes, FUNCTIONs, error handling,
reparses procedures at each call (no caching), etc, etc.
Certainly buggy too, but procedures can actually be created and called....
2002-12-08 19:59:22 +01:00
|
|
|
{
|
2003-04-02 20:42:28 +02:00
|
|
|
while (num--)
|
|
|
|
pop_dynamic(&m_pvar);
|
Simplistic, experimental framework for Stored Procedures (SPs).
Implements creation and dropping of PROCEDUREs, IN, OUT, and INOUT parameters,
single-statement procedures, rudimentary multi-statement (begin-end) prodedures
(when the client can handle it), and local variables.
Missing most of the embedded SQL language, all attributes, FUNCTIONs, error handling,
reparses procedures at each call (no caching), etc, etc.
Certainly buggy too, but procedures can actually be created and called....
2002-12-08 19:59:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Find by name
|
|
|
|
sp_pvar_t *
|
2003-11-13 19:34:56 +01:00
|
|
|
find_pvar(LEX_STRING *name, my_bool scoped=0);
|
Simplistic, experimental framework for Stored Procedures (SPs).
Implements creation and dropping of PROCEDUREs, IN, OUT, and INOUT parameters,
single-statement procedures, rudimentary multi-statement (begin-end) prodedures
(when the client can handle it), and local variables.
Missing most of the embedded SQL language, all attributes, FUNCTIONs, error handling,
reparses procedures at each call (no caching), etc, etc.
Certainly buggy too, but procedures can actually be created and called....
2002-12-08 19:59:22 +01:00
|
|
|
|
|
|
|
// Find by index
|
|
|
|
sp_pvar_t *
|
|
|
|
find_pvar(uint i)
|
|
|
|
{
|
2003-04-02 20:42:28 +02:00
|
|
|
sp_pvar_t *p;
|
|
|
|
|
|
|
|
if (i < m_pvar.elements)
|
|
|
|
get_dynamic(&m_pvar, (gptr)&p, i);
|
|
|
|
else
|
|
|
|
p= NULL;
|
|
|
|
return p;
|
Simplistic, experimental framework for Stored Procedures (SPs).
Implements creation and dropping of PROCEDUREs, IN, OUT, and INOUT parameters,
single-statement procedures, rudimentary multi-statement (begin-end) prodedures
(when the client can handle it), and local variables.
Missing most of the embedded SQL language, all attributes, FUNCTIONs, error handling,
reparses procedures at each call (no caching), etc, etc.
Certainly buggy too, but procedures can actually be created and called....
2002-12-08 19:59:22 +01:00
|
|
|
}
|
|
|
|
|
2003-09-16 14:26:08 +02:00
|
|
|
//
|
|
|
|
// Labels
|
|
|
|
//
|
|
|
|
|
2002-12-16 15:40:44 +01:00
|
|
|
sp_label_t *
|
2002-12-11 14:24:29 +01:00
|
|
|
push_label(char *name, uint ip);
|
|
|
|
|
|
|
|
sp_label_t *
|
|
|
|
find_label(char *name);
|
|
|
|
|
2002-12-12 13:14:23 +01:00
|
|
|
inline sp_label_t *
|
|
|
|
last_label()
|
|
|
|
{
|
2004-08-26 12:54:30 +02:00
|
|
|
sp_label_t *lab= m_label.head();
|
|
|
|
|
|
|
|
if (!lab && m_parent)
|
|
|
|
lab= m_parent->last_label();
|
|
|
|
return lab;
|
2002-12-12 13:14:23 +01:00
|
|
|
}
|
|
|
|
|
2002-12-16 15:40:44 +01:00
|
|
|
inline sp_label_t *
|
2002-12-11 14:24:29 +01:00
|
|
|
pop_label()
|
|
|
|
{
|
2002-12-16 15:40:44 +01:00
|
|
|
return m_label.pop();
|
2002-12-11 14:24:29 +01:00
|
|
|
}
|
|
|
|
|
2003-09-16 14:26:08 +02:00
|
|
|
//
|
|
|
|
// Conditions
|
|
|
|
//
|
|
|
|
|
|
|
|
void
|
|
|
|
push_cond(LEX_STRING *name, sp_cond_type_t *val);
|
|
|
|
|
|
|
|
inline void
|
|
|
|
pop_cond(uint num)
|
|
|
|
{
|
|
|
|
while (num--)
|
|
|
|
pop_dynamic(&m_cond);
|
|
|
|
}
|
|
|
|
|
|
|
|
sp_cond_type_t *
|
2003-11-13 19:34:56 +01:00
|
|
|
find_cond(LEX_STRING *name, my_bool scoped=0);
|
2003-09-16 14:26:08 +02:00
|
|
|
|
|
|
|
//
|
|
|
|
// Handlers
|
|
|
|
//
|
|
|
|
|
|
|
|
inline void
|
|
|
|
add_handler()
|
|
|
|
{
|
|
|
|
m_handlers+= 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline uint
|
2004-08-26 12:54:30 +02:00
|
|
|
max_handlers()
|
2003-09-16 14:26:08 +02:00
|
|
|
{
|
2004-08-26 12:54:30 +02:00
|
|
|
return m_hsubsize + m_handlers;
|
2003-09-16 14:26:08 +02:00
|
|
|
}
|
|
|
|
|
2004-08-17 20:20:58 +02:00
|
|
|
inline void
|
2004-08-26 12:54:30 +02:00
|
|
|
push_handlers(uint n)
|
2004-08-17 20:20:58 +02:00
|
|
|
{
|
2004-08-26 12:54:30 +02:00
|
|
|
m_handlers+= n;
|
2004-08-17 20:20:58 +02:00
|
|
|
}
|
|
|
|
|
2003-10-10 16:57:21 +02:00
|
|
|
//
|
|
|
|
// Cursors
|
|
|
|
//
|
|
|
|
|
|
|
|
void
|
|
|
|
push_cursor(LEX_STRING *name);
|
|
|
|
|
|
|
|
my_bool
|
2003-11-13 19:34:56 +01:00
|
|
|
find_cursor(LEX_STRING *name, uint *poff, my_bool scoped=0);
|
2003-10-10 16:57:21 +02:00
|
|
|
|
2004-08-26 12:54:30 +02:00
|
|
|
inline uint
|
|
|
|
max_cursors()
|
2003-10-10 16:57:21 +02:00
|
|
|
{
|
2004-08-26 12:54:30 +02:00
|
|
|
return m_csubsize + m_cursor.elements;
|
2003-10-10 16:57:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
inline uint
|
2004-08-26 12:54:30 +02:00
|
|
|
current_cursors()
|
2003-10-10 16:57:21 +02:00
|
|
|
{
|
2004-08-26 12:54:30 +02:00
|
|
|
return m_coffset + m_cursor.elements;
|
2003-10-10 16:57:21 +02:00
|
|
|
}
|
|
|
|
|
2004-08-26 12:54:30 +02:00
|
|
|
protected:
|
2004-08-17 20:20:58 +02:00
|
|
|
|
2004-08-26 12:54:30 +02:00
|
|
|
// The maximum sub context's framesizes
|
|
|
|
uint m_psubsize;
|
|
|
|
uint m_csubsize;
|
|
|
|
uint m_hsubsize;
|
2004-08-17 20:20:58 +02:00
|
|
|
|
Simplistic, experimental framework for Stored Procedures (SPs).
Implements creation and dropping of PROCEDUREs, IN, OUT, and INOUT parameters,
single-statement procedures, rudimentary multi-statement (begin-end) prodedures
(when the client can handle it), and local variables.
Missing most of the embedded SQL language, all attributes, FUNCTIONs, error handling,
reparses procedures at each call (no caching), etc, etc.
Certainly buggy too, but procedures can actually be created and called....
2002-12-08 19:59:22 +01:00
|
|
|
private:
|
|
|
|
|
2004-08-26 12:54:30 +02:00
|
|
|
sp_pcontext *m_parent; // Parent context
|
|
|
|
|
|
|
|
uint m_poffset; // Variable offset for this context
|
|
|
|
uint m_coffset; // Cursor offset for this context
|
|
|
|
uint m_handlers; // No. of handlers in this context
|
Simplistic, experimental framework for Stored Procedures (SPs).
Implements creation and dropping of PROCEDUREs, IN, OUT, and INOUT parameters,
single-statement procedures, rudimentary multi-statement (begin-end) prodedures
(when the client can handle it), and local variables.
Missing most of the embedded SQL language, all attributes, FUNCTIONs, error handling,
reparses procedures at each call (no caching), etc, etc.
Certainly buggy too, but procedures can actually be created and called....
2002-12-08 19:59:22 +01:00
|
|
|
|
2003-09-16 14:26:08 +02:00
|
|
|
DYNAMIC_ARRAY m_pvar; // Parameters/variables
|
|
|
|
DYNAMIC_ARRAY m_cond; // Conditions
|
2003-10-10 16:57:21 +02:00
|
|
|
DYNAMIC_ARRAY m_cursor; // Cursors
|
Simplistic, experimental framework for Stored Procedures (SPs).
Implements creation and dropping of PROCEDUREs, IN, OUT, and INOUT parameters,
single-statement procedures, rudimentary multi-statement (begin-end) prodedures
(when the client can handle it), and local variables.
Missing most of the embedded SQL language, all attributes, FUNCTIONs, error handling,
reparses procedures at each call (no caching), etc, etc.
Certainly buggy too, but procedures can actually be created and called....
2002-12-08 19:59:22 +01:00
|
|
|
|
2002-12-11 14:24:29 +01:00
|
|
|
List<sp_label_t> m_label; // The label list
|
|
|
|
|
2004-08-26 12:54:30 +02:00
|
|
|
List<sp_pcontext> m_children; // Children contexts, used for destruction
|
|
|
|
|
Simplistic, experimental framework for Stored Procedures (SPs).
Implements creation and dropping of PROCEDUREs, IN, OUT, and INOUT parameters,
single-statement procedures, rudimentary multi-statement (begin-end) prodedures
(when the client can handle it), and local variables.
Missing most of the embedded SQL language, all attributes, FUNCTIONs, error handling,
reparses procedures at each call (no caching), etc, etc.
Certainly buggy too, but procedures can actually be created and called....
2002-12-08 19:59:22 +01:00
|
|
|
}; // class sp_pcontext : public Sql_alloc
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* _SP_PCONTEXT_H_ */
|