~ubuntu-branches/ubuntu/wily/mysql-5.6/wily

« back to all changes in this revision

Viewing changes to sql/sp.cc

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2015-04-16 20:07:10 UTC
  • mto: (1.3.9 vivid-proposed)
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: package-import@ubuntu.com-20150416200710-pcrsa022082zj46k
Tags: upstream-5.6.24
ImportĀ upstreamĀ versionĀ 5.6.24

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
   Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
 
2
   Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
3
3
 
4
4
   This program is free software; you can redistribute it and/or modify
5
5
   it under the terms of the GNU General Public License as published by
754
754
  sp_rcontext *sp_runtime_ctx_saved= thd->sp_runtime_ctx;
755
755
  Silence_deprecated_warning warning_handler;
756
756
  Parser_state parser_state;
 
757
  sql_digest_state *parent_digest= thd->m_digest;
757
758
  PSI_statement_locker *parent_locker= thd->m_statement_psi;
758
759
 
759
760
  thd->variables.sql_mode= sql_mode;
770
771
  thd->push_internal_handler(&warning_handler);
771
772
  thd->sp_runtime_ctx= NULL;
772
773
 
 
774
  thd->m_digest= NULL;
773
775
  thd->m_statement_psi= NULL;
774
776
  if (parse_sql(thd, & parser_state, creation_ctx) || thd->lex == NULL)
775
777
  {
781
783
  {
782
784
    sp= thd->lex->sphead;
783
785
  }
 
786
  thd->m_digest= parent_digest;
784
787
  thd->m_statement_psi= parent_locker;
785
788
 
786
789
  thd->pop_internal_handler();
1512
1515
    {
1513
1516
      char *sp_name= get_field(thd->mem_root,
1514
1517
                               table->field[MYSQL_PROC_FIELD_NAME]);
 
1518
      if (sp_name == NULL)
 
1519
      {
 
1520
        table->file->ha_index_end();
 
1521
        my_error(ER_SP_WRONG_NAME, MYF(0), "");
 
1522
        close_system_tables(thd, &open_tables_state_backup);
 
1523
        DBUG_RETURN(true);
 
1524
      }
 
1525
 
1515
1526
      longlong sp_type= table->field[MYSQL_PROC_MYSQL_TYPE]->val_int();
1516
1527
      MDL_request *mdl_request= new (thd->mem_root) MDL_request;
1517
1528
      mdl_request->init(sp_type == SP_TYPE_FUNCTION ?