summaryrefslogtreecommitdiff
path: root/sql/sp_head.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r--sql/sp_head.cc18
1 files changed, 14 insertions, 4 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index b3b99557b63..9965c48935a 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -1869,8 +1869,11 @@ sp_head::show_create_procedure(THD *thd)
field_list.push_back(new Item_empty_string("Procedure", NAME_LEN));
field_list.push_back(new Item_empty_string("sql_mode", sql_mode_len));
// 1024 is for not to confuse old clients
- field_list.push_back(new Item_empty_string("Create Procedure",
- max(buffer.length(), 1024)));
+ Item_empty_string *definition=
+ new Item_empty_string("Create Procedure", max(buffer.length(),1024));
+ definition->maybe_null= TRUE;
+ field_list.push_back(definition);
+
if (protocol->send_fields(&field_list, Protocol::SEND_NUM_ROWS |
Protocol::SEND_EOF))
DBUG_RETURN(1);
@@ -1879,6 +1882,8 @@ sp_head::show_create_procedure(THD *thd)
protocol->store((char*) sql_mode_str, sql_mode_len, system_charset_info);
if (full_access)
protocol->store(m_defstr.str, m_defstr.length, system_charset_info);
+ else
+ protocol->store_null();
res= protocol->write();
send_eof(thd);
@@ -1934,8 +1939,11 @@ sp_head::show_create_function(THD *thd)
&sql_mode_len);
field_list.push_back(new Item_empty_string("Function",NAME_LEN));
field_list.push_back(new Item_empty_string("sql_mode", sql_mode_len));
- field_list.push_back(new Item_empty_string("Create Function",
- max(buffer.length(),1024)));
+ Item_empty_string *definition=
+ new Item_empty_string("Create Function", max(buffer.length(),1024));
+ definition->maybe_null= TRUE;
+ field_list.push_back(definition);
+
if (protocol->send_fields(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
DBUG_RETURN(1);
@@ -1944,6 +1952,8 @@ sp_head::show_create_function(THD *thd)
protocol->store((char*) sql_mode_str, sql_mode_len, system_charset_info);
if (full_access)
protocol->store(m_defstr.str, m_defstr.length, system_charset_info);
+ else
+ protocol->store_null();
res= protocol->write();
send_eof(thd);