diff options
author | jani@ua141d10.elisa.omakaista.fi <> | 2005-08-09 15:29:33 +0300 |
---|---|---|
committer | jani@ua141d10.elisa.omakaista.fi <> | 2005-08-09 15:29:33 +0300 |
commit | 083da3ecee010fc0deae65aba6d61da8cf8433d9 (patch) | |
tree | d2f897dd14204c703d73417c1daf8de50c904ac0 /sql | |
parent | 82fb0beb9e0a37c4ccc01ee978133bef0f15aea9 (diff) | |
download | mariadb-git-083da3ecee010fc0deae65aba6d61da8cf8433d9.tar.gz |
Merged code.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_parse.cc | 51 |
1 files changed, 22 insertions, 29 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index c1d4fae5253..685044fb79b 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -4060,8 +4060,8 @@ end_with_restore_list: name= thd->strdup(name); db= thd->strmake(lex->sphead->m_db.str, lex->sphead->m_db.length); res= (result= lex->sphead->create(thd)); - switch (result) { - case SP_OK: + if (result == SP_OK) + { lex->unit.cleanup(); delete lex->sphead; lex->sphead= 0; @@ -4081,33 +4081,26 @@ end_with_restore_list: } #endif send_ok(thd); - break; - case SP_WRITE_ROW_FAILED: - my_error(ER_SP_ALREADY_EXISTS, MYF(0), SP_TYPE_STRING(lex), name); - lex->unit.cleanup(); - delete lex->sphead; - lex->sphead= 0; - goto error; - case SP_NO_DB_ERROR: - my_error(ER_BAD_DB_ERROR, MYF(0), lex->sphead->m_db.str); - lex->unit.cleanup(); - delete lex->sphead; - lex->sphead= 0; - goto error; - case SP_BAD_IDENTIFIER: - my_error(ER_TOO_LONG_IDENT, MYF(0), name); - lex->unit.cleanup(); - delete lex->sphead; - lex->sphead= 0; - goto error; - case SP_BODY_TOO_LONG: - my_error(ER_TOO_LONG_BODY, MYF(0), name); - lex->unit.cleanup(); - delete lex->sphead; - lex->sphead= 0; - goto error; - default: - my_error(ER_SP_STORE_FAILED, MYF(0), SP_TYPE_STRING(lex), name); + } + else + { + switch (result) { + case SP_WRITE_ROW_FAILED: + my_error(ER_SP_ALREADY_EXISTS, MYF(0), SP_TYPE_STRING(lex), name); + break; + case SP_NO_DB_ERROR: + my_error(ER_BAD_DB_ERROR, MYF(0), lex->sphead->m_db.str); + break; + case SP_BAD_IDENTIFIER: + my_error(ER_TOO_LONG_IDENT, MYF(0), name); + break; + case SP_BODY_TOO_LONG: + my_error(ER_TOO_LONG_BODY, MYF(0), name); + break; + default: + my_error(ER_SP_STORE_FAILED, MYF(0), SP_TYPE_STRING(lex), name); + break; + } lex->unit.cleanup(); delete lex->sphead; lex->sphead= 0; |