~ubuntu-branches/ubuntu/quantal/mysql-5.5/quantal-security

« back to all changes in this revision

Viewing changes to sql/sql_admin.cc

  • Committer: Package Import Robot
  • Author(s): Seth Arnold
  • Date: 2013-04-18 18:15:39 UTC
  • mfrom: (1.1.12)
  • Revision ID: package-import@ubuntu.com-20130418181539-7uo1w041b4h2ulbs
Tags: 5.5.31-0ubuntu0.12.10.1
* SECURITY UPDATE: Update to 5.5.31 to fix security issues (LP: #1170516)
  - http://www.oracle.com/technetwork/topics/security/cpuapr2013-1899555.html
* debian/patches/71_disable_rpl_tests.patch: refreshed.
* debian/patches/fix-mysqldump-test.patch: removed, fixed differently
  upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
 
1
/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
2
2
 
3
3
   This program is free software; you can redistribute it and/or modify
4
4
   it under the terms of the GNU General Public License as published by
286
286
  item->maybe_null = 1;
287
287
  field_list.push_back(item = new Item_empty_string("Msg_type", 10));
288
288
  item->maybe_null = 1;
289
 
  field_list.push_back(item = new Item_empty_string("Msg_text", 255));
 
289
  field_list.push_back(item = new Item_empty_string("Msg_text",
 
290
                                                    SQL_ADMIN_MSG_TEXT_SIZE));
290
291
  item->maybe_null = 1;
291
292
  if (protocol->send_result_set_metadata(&field_list,
292
293
                            Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
688
689
 
689
690
    case HA_ADMIN_TRY_ALTER:
690
691
    {
 
692
      uint save_flags;
 
693
      Alter_info *alter_info= &lex->alter_info;
 
694
 
 
695
      /* Store the original value of alter_info->flags */
 
696
      save_flags= alter_info->flags;
691
697
      /*
692
698
        This is currently used only by InnoDB. ha_innobase::optimize() answers
693
699
        "try with alter", so here we close the table, do an ALTER TABLE,
700
706
      thd->mdl_context.release_transactional_locks();
701
707
      DEBUG_SYNC(thd, "ha_admin_try_alter");
702
708
      protocol->store(STRING_WITH_LEN("note"), system_charset_info);
703
 
      protocol->store(STRING_WITH_LEN(
704
 
          "Table does not support optimize, doing recreate + analyze instead"),
705
 
                      system_charset_info);
706
 
      if (protocol->write())
 
709
      if(alter_info->flags & ALTER_ADMIN_PARTITION)
 
710
      {
 
711
        protocol->store(STRING_WITH_LEN(
 
712
        "Table does not support optimize on partitions. All partitions "
 
713
        "will be rebuilt and analyzed."),system_charset_info);
 
714
      }
 
715
      else
 
716
      {
 
717
        protocol->store(STRING_WITH_LEN(
 
718
        "Table does not support optimize, doing recreate + analyze instead"),
 
719
        system_charset_info);
 
720
      }
 
721
     if (protocol->write())
707
722
        goto err;
708
723
      DBUG_PRINT("info", ("HA_ADMIN_TRY_ALTER, trying analyze..."));
709
724
      TABLE_LIST *save_next_local= table->next_local,
731
746
        table->mdl_request.ticket= NULL;
732
747
        DEBUG_SYNC(thd, "ha_admin_open_ltable");
733
748
        table->mdl_request.set_type(MDL_SHARED_WRITE);
 
749
        /*
 
750
          Reset the ALTER_ADMIN_PARTITION bit in alter_info->flags
 
751
          to force analyze on all partitions.
 
752
        */
 
753
        alter_info->flags &= ~(ALTER_ADMIN_PARTITION);
734
754
        if ((table->table= open_ltable(thd, table, lock_type, 0)))
735
755
        {
736
756
          result_code= table->table->file->ha_analyze(thd, check_opt);
741
761
        }
742
762
        else
743
763
          result_code= -1; // open failed
 
764
        alter_info->flags= save_flags;
744
765
      }
745
766
      /* Start a new row for the final status row */
746
767
      protocol->prepare_for_resend();