16
16
/* drop and alter of tables */
19
19
#include <plugin/myisam/myisam.h>
20
20
#include <drizzled/show.h>
21
21
#include <drizzled/error.h>
22
22
#include <drizzled/gettext.h>
23
23
#include <drizzled/data_home.h>
24
24
#include <drizzled/sql_parse.h>
25
#include <drizzled/my_hash.h>
26
25
#include <drizzled/sql_lex.h>
27
26
#include <drizzled/session.h>
28
27
#include <drizzled/sql_base.h>
29
#include "drizzled/strfunc.h"
30
#include <drizzled/db.h>
31
28
#include <drizzled/lock.h>
32
29
#include <drizzled/unireg.h>
33
30
#include <drizzled/item/int.h>
34
31
#include <drizzled/item/empty_string.h>
35
32
#include <drizzled/transaction_services.h>
36
#include "drizzled/transaction_services.h"
33
#include <drizzled/transaction_services.h>
37
34
#include <drizzled/table_proto.h>
38
35
#include <drizzled/plugin/client.h>
39
36
#include <drizzled/identifier.h>
40
#include "drizzled/internal/m_string.h"
41
#include "drizzled/global_charset_info.h"
42
#include "drizzled/charset.h"
44
#include "drizzled/definition/cache.h"
47
#include "drizzled/statement/alter_table.h"
48
#include "drizzled/sql_table.h"
49
#include "drizzled/pthread_globals.h"
37
#include <drizzled/internal/m_string.h>
38
#include <drizzled/global_charset_info.h>
39
#include <drizzled/charset.h>
41
#include <drizzled/definition/cache.h>
43
#include <drizzled/statement/alter_table.h>
44
#include <drizzled/sql_table.h>
45
#include <drizzled/pthread_globals.h>
46
#include <drizzled/typelib.h>
47
#include <drizzled/plugin/storage_engine.h>
51
49
#include <algorithm>
87
83
let's fetch the database default character set and
88
84
apply it to the table.
90
SchemaIdentifier identifier(db);
86
identifier::Schema identifier(db);
91
87
if (create_info->default_table_charset == NULL)
92
88
create_info->default_table_charset= plugin::StorageEngine::getSchemaCollation(identifier);
100
query_length Length of query
106
Write the binlog if open, routine used in multiple places in this
110
void write_bin_log(Session *session, const std::string &query)
112
TransactionServices &transaction_services= TransactionServices::singleton();
113
transaction_services.rawStatement(session, query);
117
92
Execute the drop of a normal or temporary table
120
mysql_rm_table_part2()
121
96
session Thread Cursor
122
97
tables Tables to drop
123
98
if_exists If set, don't give an error if table doesn't exists.
195
170
if (session->getKilled())
198
goto err_with_placeholders;
201
TableIdentifier identifier(table->getSchemaName(), table->getTableName(), table->getInternalTmpTable() ? message::Table::INTERNAL : message::Table::STANDARD);
176
identifier::Table identifier(table->getSchemaName(), table->getTableName(), table->getInternalTmpTable() ? message::Table::INTERNAL : message::Table::STANDARD);
178
message::table::shared_ptr message= plugin::StorageEngine::getTableMessage(*session, identifier, true);
203
180
if (drop_temporary || not plugin::StorageEngine::doesTableExist(*session, identifier))
205
182
// Table was not found on disk and table can't be created from engine
207
185
push_warning_printf(session, DRIZZLE_ERROR::WARN_LEVEL_NOTE,
208
186
ER_BAD_TABLE_ERROR, ER(ER_BAD_TABLE_ERROR),
209
187
table->getTableName());
215
error= plugin::StorageEngine::dropTable(*session, identifier);
217
if ((error == ENOENT || error == HA_ERR_NO_SUCH_TABLE) && if_exists)
220
session->clear_error();
223
if (error == HA_ERR_ROW_IS_REFERENCED)
225
/* the table is referenced by a foreign key constraint */
226
foreign_key_error= true;
230
if (error == 0 || (if_exists && foreign_key_error == false))
232
TransactionServices &transaction_services= TransactionServices::singleton();
233
transaction_services.dropTable(session, string(table->getSchemaName()), string(table->getTableName()), if_exists);
196
drizzled::error_t local_error;
198
/* Generate transaction event ONLY when we successfully drop */
199
if (plugin::StorageEngine::dropTable(*session, identifier, local_error))
201
if (message) // If we have no definition, we don't know if the table should have been replicated
203
TransactionServices &transaction_services= TransactionServices::singleton();
204
transaction_services.dropTable(*session, identifier, *message, if_exists);
209
if (local_error == HA_ERR_NO_SUCH_TABLE and if_exists)
212
session->clear_error();
215
if (local_error == HA_ERR_ROW_IS_REFERENCED)
217
/* the table is referenced by a foreign key constraint */
218
foreign_key_error= true;
238
if (wrong_tables.length())
239
wrong_tables.append(',');
240
wrong_tables.append(String(table->getTableName(), system_charset_info));
226
wrong_tables.push_back(table->getTableName());
244
It's safe to unlock table::Cache::singleton().mutex(): we have an exclusive lock
247
table::Cache::singleton().mutex().unlock();
251
if (wrong_tables.length())
230
tables->unlock_table_names();
234
if (wrong_tables.size())
253
236
if (not foreign_key_error)
238
std::string table_error;
240
for (util::string::vector::iterator iter= wrong_tables.begin();
241
iter != wrong_tables.end();
247
table_error.resize(table_error.size() -1);
255
249
my_printf_error(ER_BAD_TABLE_ERROR, ER(ER_BAD_TABLE_ERROR), MYF(0),
256
wrong_tables.c_ptr());
250
table_error.c_str());
471
460
sql_field->length= 8; // Unireg field length
472
461
(*blob_columns)++;
474
case DRIZZLE_TYPE_VARCHAR:
476
464
case DRIZZLE_TYPE_ENUM:
477
if (check_duplicates_in_interval("ENUM",
478
sql_field->field_name,
484
case DRIZZLE_TYPE_DATE: // Rest of string types
485
case DRIZZLE_TYPE_DATETIME:
486
case DRIZZLE_TYPE_NULL:
488
case DRIZZLE_TYPE_DECIMAL:
466
if (check_duplicates_in_interval("ENUM",
467
sql_field->field_name,
477
case DRIZZLE_TYPE_MICROTIME:
490
478
case DRIZZLE_TYPE_TIMESTAMP:
491
479
/* We should replace old TIMESTAMP fields with their newer analogs */
492
480
if (sql_field->unireg_check == Field::TIMESTAMP_OLD_FIELD)
504
492
else if (sql_field->unireg_check != Field::NONE)
505
494
(*timestamps_with_niladic)++;
501
case DRIZZLE_TYPE_BOOLEAN:
502
case DRIZZLE_TYPE_DATE: // Rest of string types
503
case DRIZZLE_TYPE_DATETIME:
504
case DRIZZLE_TYPE_DECIMAL:
505
case DRIZZLE_TYPE_DOUBLE:
506
case DRIZZLE_TYPE_LONG:
507
case DRIZZLE_TYPE_LONGLONG:
508
case DRIZZLE_TYPE_NULL:
509
case DRIZZLE_TYPE_TIME:
510
case DRIZZLE_TYPE_UUID:
511
case DRIZZLE_TYPE_VARCHAR:
516
static int mysql_prepare_create_table(Session *session,
517
HA_CREATE_INFO *create_info,
518
message::Table &create_proto,
519
AlterInfo *alter_info,
521
uint32_t *db_options,
522
KeyInfo **key_info_buffer,
524
int select_field_count)
518
static int prepare_create_table(Session *session,
519
HA_CREATE_INFO *create_info,
520
message::Table &create_proto,
521
AlterInfo *alter_info,
523
uint32_t *db_options,
524
KeyInfo **key_info_buffer,
526
int select_field_count)
526
528
const char *key_name;
527
529
CreateField *sql_field,*dup_field;
530
532
KeyInfo *key_info;
531
533
KeyPartInfo *key_part_info;
532
534
int timestamps= 0, timestamps_with_niladic= 0;
534
536
int select_field_pos,auto_increment=0;
535
List_iterator<CreateField> it(alter_info->create_list);
536
List_iterator<CreateField> it2(alter_info->create_list);
537
List<CreateField>::iterator it(alter_info->create_list.begin());
538
List<CreateField>::iterator it2(alter_info->create_list.begin());
537
539
uint32_t total_uneven_bit_length= 0;
539
541
plugin::StorageEngine *engine= plugin::StorageEngine::findByName(create_proto.engine().name());
541
select_field_pos= alter_info->create_list.elements - select_field_count;
543
select_field_pos= alter_info->create_list.size() - select_field_count;
542
544
null_fields=blob_columns=0;
543
545
max_key_length= engine->max_key_length();
545
for (field_no=0; (sql_field=it++) ; field_no++)
547
for (int32_t field_no=0; (sql_field=it++) ; field_no++)
547
549
const CHARSET_INFO *save_cs;
963
970
message::Table::Field *protofield= NULL;
965
List_iterator<Key_part_spec> cols(key->columns), cols2(key->columns);
972
List<Key_part_spec>::iterator cols(key->columns.begin());
973
List<Key_part_spec>::iterator cols2(key->columns.begin());
966
974
for (uint32_t column_nr=0 ; (column=cols++) ; column_nr++)
969
977
Key_part_spec *dup_column;
970
978
int proto_field_nr= 0;
980
it= alter_info->create_list.begin();
974
982
while ((sql_field=it++) && ++proto_field_nr &&
975
983
my_strcasecmp(system_charset_info,
976
984
column->field_name.str,
977
985
sql_field->field_name))
981
992
my_error(ER_KEY_COLUMN_DOES_NOT_EXITS, MYF(0), column->field_name.str);
984
996
while ((dup_column= cols2++) != column)
986
998
if (!my_strcasecmp(system_charset_info,
1163
1177
key_info->name=(char*) key_name;
1166
1181
if (!key_info->name || check_column_name(key_info->name))
1168
1183
my_error(ER_WRONG_NAME_FOR_INDEX, MYF(0), key_info->name);
1171
1187
if (!(key_info->flags & HA_NULL_PART_KEY))
1173
1192
key_info->key_length=(uint16_t) key_length;
1174
1194
if (key_length > max_key_length)
1176
1196
my_error(ER_TOO_LONG_KEY,MYF(0),max_key_length);
1181
1203
if (!unique_key && !primary_key &&
1182
1204
(engine->check_flag(HTON_BIT_REQUIRE_PRIMARY_KEY)))
1184
1206
my_message(ER_REQUIRES_PRIMARY_KEY, ER(ER_REQUIRES_PRIMARY_KEY), MYF(0));
1187
1210
if (auto_increment > 0)
1189
1212
my_message(ER_WRONG_AUTO_KEY, ER(ER_WRONG_AUTO_KEY), MYF(0));
1426
1445
set_table_default_charset(create_info, identifier.getSchemaName().c_str());
1428
1447
/* Build a Table object to pass down to the engine, and the do the actual create. */
1429
if (not mysql_prepare_create_table(session, create_info, table_proto, alter_info,
1432
&key_info_buffer, &key_count,
1433
select_field_count))
1448
if (not prepare_create_table(session, create_info, table_proto, alter_info,
1451
&key_info_buffer, &key_count,
1452
select_field_count))
1435
1454
boost_unique_lock_t lock(table::Cache::singleton().mutex()); /* CREATE TABLE (some confussion on naming, double check) */
1436
1455
error= locked_create_event(session,
1512
Database locking aware wrapper for mysql_create_table_no_lock(),
1529
Database locking aware wrapper for create_table_no_lock(),
1514
bool mysql_create_table(Session *session,
1515
const TableIdentifier &identifier,
1531
bool create_table(Session *session,
1532
const identifier::Table &identifier,
1516
1533
HA_CREATE_INFO *create_info,
1517
1534
message::Table &table_proto,
1518
1535
AlterInfo *alter_info,
1748
1765
item->maybe_null = 1;
1749
1766
field_list.push_back(item = new Item_empty_string("Msg_text", 255, cs));
1750
1767
item->maybe_null = 1;
1751
if (session->client->sendFields(&field_list))
1768
if (session->getClient()->sendFields(&field_list))
1754
1771
for (table= tables; table; table= table->next_local)
1756
char table_name[NAME_LEN*2+2];
1773
identifier::Table table_identifier(table->getSchemaName(), table->getTableName());
1774
std::string table_name;
1757
1775
bool fatal_error=0;
1759
snprintf(table_name, sizeof(table_name), "%s.%s", table->getSchemaName(), table->getTableName());
1777
table_identifier.getSQLPath(table_name);
1760
1779
table->lock_type= lock_type;
1761
1780
/* open only one table from local list of command */
1804
1823
char buff[FN_REFLEN + DRIZZLE_ERRMSG_SIZE];
1805
1824
uint32_t length;
1806
session->client->store(table_name);
1807
session->client->store(operator_name);
1808
session->client->store(STRING_WITH_LEN("error"));
1825
session->getClient()->store(table_name.c_str());
1826
session->getClient()->store(operator_name);
1827
session->getClient()->store(STRING_WITH_LEN("error"));
1809
1828
length= snprintf(buff, sizeof(buff), ER(ER_OPEN_AS_READONLY),
1811
session->client->store(buff, length);
1812
transaction_services.autocommitOrRollback(session, false);
1829
table_name.c_str());
1830
session->getClient()->store(buff, length);
1831
transaction_services.autocommitOrRollback(*session, false);
1813
1832
session->endTransaction(COMMIT);
1814
1833
session->close_thread_tables();
1815
lex->reset_query_tables_list(false);
1834
session->getLex()->reset_query_tables_list(false);
1816
1835
table->table=0; // For query cache
1817
if (session->client->flush())
1836
if (session->getClient()->flush())
1826
1845
const char *old_message=session->enter_cond(COND_refresh, table::Cache::singleton().mutex(),
1827
1846
"Waiting to get writelock");
1828
1847
session->abortLock(table->table);
1829
TableIdentifier identifier(table->table->getShare()->getSchemaName(), table->table->getShare()->getTableName());
1848
identifier::Table identifier(table->table->getShare()->getSchemaName(), table->table->getShare()->getTableName());
1830
1849
table::Cache::singleton().removeTable(session, identifier, RTFC_WAIT_OTHER_THREAD_FLAG | RTFC_CHECK_KILLED_FLAG);
1831
1850
session->exit_cond(old_message);
1832
1851
if (session->getKilled())
1841
lex->cleanup_after_one_table_open();
1860
session->getLex()->cleanup_after_one_table_open();
1842
1861
session->clear_error(); // these errors shouldn't get client
1844
List_iterator_fast<DRIZZLE_ERROR> it(session->warn_list);
1863
List<DRIZZLE_ERROR>::iterator it(session->warn_list.begin());
1845
1864
DRIZZLE_ERROR *err;
1846
1865
while ((err= it++))
1848
session->client->store(table_name);
1849
session->client->store(operator_name);
1850
session->client->store(warning_level_names[err->level].str,
1867
session->getClient()->store(table_name.c_str());
1868
session->getClient()->store(operator_name);
1869
session->getClient()->store(warning_level_names[err->level].str,
1851
1870
warning_level_names[err->level].length);
1852
session->client->store(err->msg);
1853
if (session->client->flush())
1871
session->getClient()->store(err->msg);
1872
if (session->getClient()->flush())
1856
1875
drizzle_reset_errors(session, true);
1858
session->client->store(table_name);
1859
session->client->store(operator_name);
1877
session->getClient()->store(table_name.c_str());
1878
session->getClient()->store(operator_name);
1861
1880
switch (result_code) {
1862
1881
case HA_ADMIN_NOT_IMPLEMENTED:
1864
1883
char buf[ERRMSGSIZE+20];
1865
1884
uint32_t length=snprintf(buf, ERRMSGSIZE,
1866
1885
ER(ER_CHECK_NOT_IMPLEMENTED), operator_name);
1867
session->client->store(STRING_WITH_LEN("note"));
1868
session->client->store(buf, length);
1886
session->getClient()->store(STRING_WITH_LEN("note"));
1887
session->getClient()->store(buf, length);
1872
1891
case HA_ADMIN_OK:
1873
session->client->store(STRING_WITH_LEN("status"));
1874
session->client->store(STRING_WITH_LEN("OK"));
1892
session->getClient()->store(STRING_WITH_LEN("status"));
1893
session->getClient()->store(STRING_WITH_LEN("OK"));
1877
1896
case HA_ADMIN_FAILED:
1878
session->client->store(STRING_WITH_LEN("status"));
1879
session->client->store(STRING_WITH_LEN("Operation failed"));
1897
session->getClient()->store(STRING_WITH_LEN("status"));
1898
session->getClient()->store(STRING_WITH_LEN("Operation failed"));
1882
1901
case HA_ADMIN_REJECT:
1883
session->client->store(STRING_WITH_LEN("status"));
1884
session->client->store(STRING_WITH_LEN("Operation need committed state"));
1902
session->getClient()->store(STRING_WITH_LEN("status"));
1903
session->getClient()->store(STRING_WITH_LEN("Operation need committed state"));
1885
1904
open_for_modify= false;
1888
1907
case HA_ADMIN_ALREADY_DONE:
1889
session->client->store(STRING_WITH_LEN("status"));
1890
session->client->store(STRING_WITH_LEN("Table is already up to date"));
1908
session->getClient()->store(STRING_WITH_LEN("status"));
1909
session->getClient()->store(STRING_WITH_LEN("Table is already up to date"));
1893
1912
case HA_ADMIN_CORRUPT:
1894
session->client->store(STRING_WITH_LEN("error"));
1895
session->client->store(STRING_WITH_LEN("Corrupt"));
1913
session->getClient()->store(STRING_WITH_LEN("error"));
1914
session->getClient()->store(STRING_WITH_LEN("Corrupt"));
1899
1918
case HA_ADMIN_INVALID:
1900
session->client->store(STRING_WITH_LEN("error"));
1901
session->client->store(STRING_WITH_LEN("Invalid argument"));
1919
session->getClient()->store(STRING_WITH_LEN("error"));
1920
session->getClient()->store(STRING_WITH_LEN("Invalid argument"));
1904
1923
default: // Probably HA_ADMIN_INTERNAL_ERROR
1930
1949
boost::unique_lock<boost::mutex> lock(table::Cache::singleton().mutex());
1931
TableIdentifier identifier(table->table->getShare()->getSchemaName(), table->table->getShare()->getTableName());
1950
identifier::Table identifier(table->table->getShare()->getSchemaName(), table->table->getShare()->getTableName());
1932
1951
table::Cache::singleton().removeTable(session, identifier, RTFC_NO_FLAG);
1936
transaction_services.autocommitOrRollback(session, false);
1955
transaction_services.autocommitOrRollback(*session, false);
1937
1956
session->endTransaction(COMMIT);
1938
1957
session->close_thread_tables();
1939
1958
table->table=0; // For query cache
1940
if (session->client->flush())
1959
if (session->getClient()->flush())
1968
1987
during the call to plugin::StorageEngine::createTable().
1969
1988
See bug #28614 for more info.
1971
static bool create_table_wrapper(Session &session, const message::Table& create_table_proto,
1972
const TableIdentifier &destination_identifier,
1973
const TableIdentifier &src_table,
1990
static bool create_table_wrapper(Session &session,
1991
const message::Table& create_table_proto,
1992
identifier::Table::const_reference destination_identifier,
1993
identifier::Table::const_reference source_identifier,
1974
1994
bool is_engine_set)
1976
int protoerr= EEXIST;
1977
message::Table new_proto;
1978
message::table::shared_ptr src_proto;
1980
protoerr= plugin::StorageEngine::getTableDefinition(session,
1983
new_proto.CopyFrom(*src_proto);
1996
// We require an additional table message because during parsing we used
1997
// a "new" message and it will not have all of the information that the
1998
// source table message would have.
1999
message::Table new_table_message;
2001
message::table::shared_ptr source_table_message= plugin::StorageEngine::getTableMessage(session, source_identifier);
2003
if (not source_table_message)
2005
my_error(ER_TABLE_UNKNOWN, source_identifier);
2009
new_table_message.CopyFrom(*source_table_message);
1985
2011
if (destination_identifier.isTmp())
1987
new_proto.set_type(message::Table::TEMPORARY);
2013
new_table_message.set_type(message::Table::TEMPORARY);
1991
new_proto.set_type(message::Table::STANDARD);
2017
new_table_message.set_type(message::Table::STANDARD);
1994
2020
if (is_engine_set)
1996
new_proto.mutable_engine()->set_name(create_table_proto.engine().name());
2022
new_table_message.mutable_engine()->set_name(create_table_proto.engine().name());
1999
2025
{ // We now do a selective copy of elements on to the new table.
2000
new_proto.set_name(create_table_proto.name());
2001
new_proto.set_schema(create_table_proto.schema());
2002
new_proto.set_catalog(create_table_proto.catalog());
2026
new_table_message.set_name(create_table_proto.name());
2027
new_table_message.set_schema(create_table_proto.schema());
2028
new_table_message.set_catalog(create_table_proto.catalog());
2005
if (protoerr && protoerr != EEXIST)
2031
/* Fix names of foreign keys being added */
2032
for (int32_t j= 0; j < new_table_message.fk_constraint_size(); j++)
2007
if (errno == ENOENT)
2008
my_error(ER_BAD_DB_ERROR,MYF(0), destination_identifier.getSchemaName().c_str());
2010
my_error(ER_CANT_CREATE_FILE, MYF(0), destination_identifier.getPath().c_str(), errno);
2034
if (new_table_message.fk_constraint(j).has_name())
2036
std::string name(new_table_message.name());
2039
name.append("_ibfk_");
2040
snprintf(number, sizeof(number), "%d", j+1);
2041
name.append(number);
2043
message::Table::ForeignKeyConstraint *pfkey= new_table_message.mutable_fk_constraint(j);
2044
pfkey->set_name(name);
2016
2049
As mysql_truncate don't work on a new table at this stage of
2017
creation, instead create the table directly (for both normal
2018
and temporary tables).
2050
creation, instead create the table directly (for both normal and temporary tables).
2020
int err= plugin::StorageEngine::createTable(session,
2021
destination_identifier,
2052
bool success= plugin::StorageEngine::createTable(session,
2053
destination_identifier,
2024
if (err == false && not destination_identifier.isTmp())
2056
if (success && not destination_identifier.isTmp())
2026
2058
TransactionServices &transaction_services= TransactionServices::singleton();
2027
transaction_services.createTable(&session, new_proto);
2059
transaction_services.createTable(session, new_table_message);
2030
return err ? false : true;
2034
2066
Create a table identical to the specified table
2037
mysql_create_like_table()
2038
2070
session Thread object
2039
2071
table Table list element for target table
2040
2072
src_table Table list element for source table
2048
bool mysql_create_like_table(Session* session,
2049
const TableIdentifier &destination_identifier,
2050
TableList* table, TableList* src_table,
2051
message::Table &create_table_proto,
2052
bool is_if_not_exists,
2080
bool create_like_table(Session* session,
2081
identifier::Table::const_reference destination_identifier,
2082
identifier::Table::const_reference source_identifier,
2083
message::Table &create_table_proto,
2084
bool is_if_not_exists,
2055
2087
bool res= true;
2059
By opening source table we guarantee that it exists and no concurrent
2060
DDL operation will mess with it. Later we also take an exclusive
2061
name-lock on target table name, which makes copying of .frm cursor,
2062
call to plugin::StorageEngine::createTable() and binlogging atomic
2063
against concurrent DML and DDL operations on target table.
2064
Thus by holding both these "locks" we ensure that our statement is
2065
properly isolated from all concurrent operations which matter.
2067
if (session->open_tables_from_list(&src_table, ¬_used))
2070
TableIdentifier src_identifier(src_table->table->getShare()->getSchemaName(),
2071
src_table->table->getShare()->getTableName(), src_table->table->getShare()->getType());
2088
bool table_exists= false;
2076
2091
Check that destination tables does not exist. Note that its name
2162
2179
char warn_buff[DRIZZLE_ERRMSG_SIZE];
2163
2180
snprintf(warn_buff, sizeof(warn_buff),
2164
ER(ER_TABLE_EXISTS_ERROR), table->getTableName());
2181
ER(ER_TABLE_EXISTS_ERROR), destination_identifier.getTableName().c_str());
2165
2182
push_warning(session, DRIZZLE_ERROR::WARN_LEVEL_NOTE,
2166
ER_TABLE_EXISTS_ERROR,warn_buff);
2171
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), table->getTableName());
2183
ER_TABLE_EXISTS_ERROR, warn_buff);
2187
my_error(ER_TABLE_EXISTS_ERROR, destination_identifier);
2179
bool mysql_analyze_table(Session* session, TableList* tables, HA_CHECK_OPT* check_opt)
2196
bool analyze_table(Session* session, TableList* tables, HA_CHECK_OPT* check_opt)
2181
2198
thr_lock_type lock_type = TL_READ_NO_INSERT;
2183
return(mysql_admin_table(session, tables, check_opt,
2200
return(admin_table(session, tables, check_opt,
2184
2201
"analyze", lock_type, true,
2185
2202
&Cursor::ha_analyze));
2189
bool mysql_check_table(Session* session, TableList* tables,HA_CHECK_OPT* check_opt)
2206
bool check_table(Session* session, TableList* tables,HA_CHECK_OPT* check_opt)
2191
2208
thr_lock_type lock_type = TL_READ_NO_INSERT;
2193
return(mysql_admin_table(session, tables, check_opt,
2210
return(admin_table(session, tables, check_opt,
2194
2211
"check", lock_type,
2196
2213
&Cursor::ha_check));