You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

132 lines
3.1 KiB

  1. /* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation; version 2 of the License.
  5. This program is distributed in the hope that it will be useful,
  6. but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8. GNU General Public License for more details.
  9. You should have received a copy of the GNU General Public License
  10. along with this program; if not, write to the Free Software
  11. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
  12. #ifndef SQL_TABLE_MAINTENANCE_H
  13. #define SQL_TABLE_MAINTENANCE_H
  14. bool mysql_assign_to_keycache(THD* thd, TABLE_LIST* table_list,
  15. LEX_STRING *key_cache_name);
  16. bool mysql_preload_keys(THD* thd, TABLE_LIST* table_list);
  17. int reassign_keycache_tables(THD* thd, KEY_CACHE *src_cache,
  18. KEY_CACHE *dst_cache);
  19. /**
  20. Analyze_statement represents the ANALYZE TABLE statement.
  21. */
  22. class Analyze_table_statement : public Sql_statement
  23. {
  24. public:
  25. /**
  26. Constructor, used to represent a ANALYZE TABLE statement.
  27. @param lex the LEX structure for this statement.
  28. */
  29. Analyze_table_statement(LEX *lex)
  30. : Sql_statement(lex)
  31. {}
  32. ~Analyze_table_statement()
  33. {}
  34. /**
  35. Execute a ANALYZE TABLE statement at runtime.
  36. @param thd the current thread.
  37. @return false on success.
  38. */
  39. bool execute(THD *thd);
  40. };
  41. /**
  42. Check_table_statement represents the CHECK TABLE statement.
  43. */
  44. class Check_table_statement : public Sql_statement
  45. {
  46. public:
  47. /**
  48. Constructor, used to represent a CHECK TABLE statement.
  49. @param lex the LEX structure for this statement.
  50. */
  51. Check_table_statement(LEX *lex)
  52. : Sql_statement(lex)
  53. {}
  54. ~Check_table_statement()
  55. {}
  56. /**
  57. Execute a CHECK TABLE statement at runtime.
  58. @param thd the current thread.
  59. @return false on success.
  60. */
  61. bool execute(THD *thd);
  62. };
  63. /**
  64. Optimize_table_statement represents the OPTIMIZE TABLE statement.
  65. */
  66. class Optimize_table_statement : public Sql_statement
  67. {
  68. public:
  69. /**
  70. Constructor, used to represent a OPTIMIZE TABLE statement.
  71. @param lex the LEX structure for this statement.
  72. */
  73. Optimize_table_statement(LEX *lex)
  74. : Sql_statement(lex)
  75. {}
  76. ~Optimize_table_statement()
  77. {}
  78. /**
  79. Execute a OPTIMIZE TABLE statement at runtime.
  80. @param thd the current thread.
  81. @return false on success.
  82. */
  83. bool execute(THD *thd);
  84. };
  85. /**
  86. Repair_table_statement represents the REPAIR TABLE statement.
  87. */
  88. class Repair_table_statement : public Sql_statement
  89. {
  90. public:
  91. /**
  92. Constructor, used to represent a REPAIR TABLE statement.
  93. @param lex the LEX structure for this statement.
  94. */
  95. Repair_table_statement(LEX *lex)
  96. : Sql_statement(lex)
  97. {}
  98. ~Repair_table_statement()
  99. {}
  100. /**
  101. Execute a REPAIR TABLE statement at runtime.
  102. @param thd the current thread.
  103. @return false on success.
  104. */
  105. bool execute(THD *thd);
  106. };
  107. #endif