diff options
author | unknown <pem@mysql.com> | 2003-01-09 17:56:57 +0100 |
---|---|---|
committer | unknown <pem@mysql.com> | 2003-01-09 17:56:57 +0100 |
commit | b09fe58c63a0ee2e68c82f18be452d844cdc642f (patch) | |
tree | d30f557e6920ffb8c9034d2cb484daff205a41ff /sql/sql_parse.cc | |
parent | ac2aea8c4a36175e844bbc884dfd5d38167cf181 (diff) | |
parent | a3fe4223e89ea4e5857005181367faccf2c7bed6 (diff) | |
download | mariadb-git-b09fe58c63a0ee2e68c82f18be452d844cdc642f.tar.gz |
Merge
BitKeeper/etc/logging_ok:
auto-union
configure.in:
Auto merged
sql/Makefile.am:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/item.cc:
SCCS merged
sql/item.h:
SCCS merged
sql/lex.h:
SCCS merged
sql/sql_lex.cc:
SCCS merged
sql/sql_lex.h:
SCCS merged
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index f6e21e421d9..0c32aca4b37 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -29,6 +29,9 @@ #include "ha_innodb.h" #endif +#include "sp_head.h" +#include "sp.h" + #ifdef HAVE_OPENSSL /* Without SSL the handshake consists of one packet. This packet @@ -2808,6 +2811,84 @@ mysql_execute_command(THD *thd) res= -1; thd->options&= ~(ulong) (OPTION_BEGIN | OPTION_STATUS_NO_TRANS_UPDATE); break; + case SQLCOM_CREATE_PROCEDURE: + if (!lex->sphead) + res= -1; + else + { + res= lex->sphead->create(thd); + if (res < 0) + { + // QQ Error! + } + send_ok(thd); + } + break; + case SQLCOM_CALL: + { + Item_string *s; + sp_head *sp; + + s= (Item_string*)lex->value_list.head(); + sp= sp_find(thd, s); + if (! sp) + { + // QQ Error! + res= -1; + } + else + { + res= sp->execute(thd); + if (res == 0) + send_ok(thd); + } + } + break; + case SQLCOM_ALTER_PROCEDURE: + { + Item_string *s; + sp_head *sp; + + s= (Item_string*)lex->value_list.head(); + sp= sp_find(thd, s); + if (! sp) + { + // QQ Error! + res= -1; + } + else + { + /* QQ This is an no-op right now, since we haven't + put the characteristics in yet. */ + send_ok(thd); + } + } + break; + case SQLCOM_DROP_PROCEDURE: + { + Item_string *s; + sp_head *sp; + + s = (Item_string*)lex->value_list.head(); + sp = sp_find(thd, s); + if (! sp) + { + // QQ Error! + res= -1; + } + else + { + String *name = s->const_string(); + + res= sp_drop(thd, name->c_ptr(), name->length()); + if (res < 0) + { + // QQ Error! + } + send_ok(thd); + } + } + break; default: /* Impossible */ send_ok(thd); break; |