diff options
author | unknown <pem@mysql.com> | 2002-12-16 15:40:44 +0100 |
---|---|---|
committer | unknown <pem@mysql.com> | 2002-12-16 15:40:44 +0100 |
commit | f6611aa0ab45aa5586101b34c444b8fab305fac9 (patch) | |
tree | 6a965cec0f444a67ed29877855da3a7309f6dce5 /sql/sp_pcontext.cc | |
parent | 390b3e745c05a39704c01365958710189e216f79 (diff) | |
download | mariadb-git-f6611aa0ab45aa5586101b34c444b8fab305fac9.tar.gz |
Fixed the broken backpatching implementation.
Implemented IF-THEN-ELSE.
sql/sp_head.cc:
Reimplemented the broken backpatching, so it works for nested constructions and
IF-THEN-ELSE too.
sql/sp_head.h:
Reimplemented the broken backpatching, so it works for nested constructions and
IF-THEN-ELSE too.
sql/sp_pcontext.cc:
Return the value from push-methods, for convenience.
sql/sp_pcontext.h:
Return the value from push-methods, for convenience.
sql/sql_yacc.yy:
Implemented IF-THEN-ELSE.
Corrected for the new backpatch method.
Diffstat (limited to 'sql/sp_pcontext.cc')
-rw-r--r-- | sql/sp_pcontext.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/sp_pcontext.cc b/sql/sp_pcontext.cc index 9dc995f582f..96296e54184 100644 --- a/sql/sp_pcontext.cc +++ b/sql/sp_pcontext.cc @@ -92,7 +92,7 @@ sp_pcontext::push(LEX_STRING *name, enum enum_field_types type, } } -void +sp_label_t * sp_pcontext::push_label(char *name, uint ip) { sp_label_t *lab = (sp_label_t *)my_malloc(sizeof(sp_label_t), MYF(MY_WME)); @@ -103,18 +103,21 @@ sp_pcontext::push_label(char *name, uint ip) lab->ip= ip; m_label.push_front(lab); } + return lab; } -void +sp_label_t * sp_pcontext::push_gen_label(uint ip) { + sp_label_t *lab= NULL; char *s= my_malloc(10, MYF(MY_WME)); // 10=... if (s) { sprintf(s, ".%08x", m_genlab++); // ...9+1 - push_label(s, ip); + lab= push_label(s, ip); } + return lab; } sp_label_t * |