diff options
author | Alexander Barkov <bar@mariadb.com> | 2018-03-02 12:09:41 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2018-03-02 12:09:41 +0400 |
commit | d70573564cb2701076083ea7f55ae9539fad13b4 (patch) | |
tree | 77784321bacf1f37aeb28f0beade9aa1426ce4e2 /sql/sp.cc | |
parent | 5cf0662d76556b09f5d17af69fe37530ce6547fc (diff) | |
parent | 88a9d4ab42d370dedc9b1d90c75bee53fd8fb8c0 (diff) | |
download | mariadb-git-d70573564cb2701076083ea7f55ae9539fad13b4.tar.gz |
Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3
Diffstat (limited to 'sql/sp.cc')
-rw-r--r-- | sql/sp.cc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sql/sp.cc b/sql/sp.cc index d75e40af6ce..cb05108a5bc 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -2998,7 +2998,7 @@ Sp_handler::sp_load_for_information_schema(THD *thd, TABLE *proc_table, defstr.set_charset(creation_ctx->get_client_cs()); if (show_create_sp(thd, &defstr, sp_name_obj.m_db, sp_name_obj.m_name, - params, returns, empty_body_lex_cstring(), + params, returns, empty_body_lex_cstring(sql_mode), Sp_chistics(), definer, DDL_options(), sql_mode)) return 0; @@ -3012,3 +3012,18 @@ Sp_handler::sp_load_for_information_schema(THD *thd, TABLE *proc_table, return sp; } + +LEX_CSTRING Sp_handler_procedure::empty_body_lex_cstring(sql_mode_t mode) const +{ + static LEX_CSTRING m_empty_body_std= {C_STRING_WITH_LEN("BEGIN END")}; + static LEX_CSTRING m_empty_body_ora= {C_STRING_WITH_LEN("AS BEGIN NULL; END")}; + return mode & MODE_ORACLE ? m_empty_body_ora : m_empty_body_std; +} + + +LEX_CSTRING Sp_handler_function::empty_body_lex_cstring(sql_mode_t mode) const +{ + static LEX_CSTRING m_empty_body_std= {C_STRING_WITH_LEN("RETURN NULL")}; + static LEX_CSTRING m_empty_body_ora= {C_STRING_WITH_LEN("AS BEGIN RETURN NULL; END")}; + return mode & MODE_ORACLE ? m_empty_body_ora : m_empty_body_std; +} |