~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

Merge in Monty's rename patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
117
117
  Execute the drop of a normal or temporary table
118
118
 
119
119
  SYNOPSIS
120
 
    mysql_rm_table_part2()
 
120
    rm_table_part2()
121
121
    session                     Thread Cursor
122
122
    tables              Tables to drop
123
123
    if_exists           If set, don't give an error if table doesn't exists.
140
140
   -1   Thread was killed
141
141
*/
142
142
 
143
 
int mysql_rm_table_part2(Session *session, TableList *tables, bool if_exists,
 
143
int rm_table_part2(Session *session, TableList *tables, bool if_exists,
144
144
                         bool drop_temporary)
145
145
{
146
146
  TableList *table;
515
515
  return 0;
516
516
}
517
517
 
518
 
static int mysql_prepare_create_table(Session *session,
 
518
static int prepare_create_table(Session *session,
519
519
                                      HA_CREATE_INFO *create_info,
520
520
                                      message::Table &create_proto,
521
521
                                      AlterInfo *alter_info,
1378
1378
  Create a table
1379
1379
 
1380
1380
  SYNOPSIS
1381
 
    mysql_create_table_no_lock()
 
1381
    create_table_no_lock()
1382
1382
    session                     Thread object
1383
1383
    db                  Database
1384
1384
    table_name          Table name
1394
1394
 
1395
1395
    Note that this function assumes that caller already have taken
1396
1396
    name-lock on table being created or used some other way to ensure
1397
 
    that concurrent operations won't intervene. mysql_create_table()
 
1397
    that concurrent operations won't intervene. create_table()
1398
1398
    is a wrapper that can be used for this.
1399
1399
 
1400
1400
  RETURN VALUES
1402
1402
    true  error
1403
1403
*/
1404
1404
 
1405
 
bool mysql_create_table_no_lock(Session *session,
 
1405
bool create_table_no_lock(Session *session,
1406
1406
                                const TableIdentifier &identifier,
1407
1407
                                HA_CREATE_INFO *create_info,
1408
1408
                                message::Table &table_proto,
1428
1428
  set_table_default_charset(create_info, identifier.getSchemaName().c_str());
1429
1429
 
1430
1430
  /* Build a Table object to pass down to the engine, and the do the actual create. */
1431
 
  if (not mysql_prepare_create_table(session, create_info, table_proto, alter_info,
 
1431
  if (not prepare_create_table(session, create_info, table_proto, alter_info,
1432
1432
                                     internal_tmp_table,
1433
1433
                                     &db_options,
1434
1434
                                     &key_info_buffer, &key_count,
1490
1490
  }
1491
1491
  else
1492
1492
  {
1493
 
    result= mysql_create_table_no_lock(session,
 
1493
    result= create_table_no_lock(session,
1494
1494
                                       identifier,
1495
1495
                                       create_info,
1496
1496
                                       table_proto,
1511
1511
 
1512
1512
 
1513
1513
/*
1514
 
  Database locking aware wrapper for mysql_create_table_no_lock(),
 
1514
  Database locking aware wrapper for create_table_no_lock(),
1515
1515
*/
1516
 
bool mysql_create_table(Session *session,
 
1516
bool create_table(Session *session,
1517
1517
                        const TableIdentifier &identifier,
1518
1518
                        HA_CREATE_INFO *create_info,
1519
1519
                        message::Table &table_proto,
1524
1524
{
1525
1525
  if (identifier.isTmp())
1526
1526
  {
1527
 
    return mysql_create_table_no_lock(session,
 
1527
    return create_table_no_lock(session,
1528
1528
                                      identifier,
1529
1529
                                      create_info,
1530
1530
                                      table_proto,
1594
1594
  Rename a table.
1595
1595
 
1596
1596
  SYNOPSIS
1597
 
    mysql_rename_table()
 
1597
    rename_table()
1598
1598
      session
1599
1599
      base                      The plugin::StorageEngine handle.
1600
1600
      old_db                    The old database name.
1608
1608
*/
1609
1609
 
1610
1610
bool
1611
 
mysql_rename_table(Session &session,
 
1611
rename_table(Session &session,
1612
1612
                   plugin::StorageEngine *base,
1613
1613
                   const TableIdentifier &from,
1614
1614
                   const TableIdentifier &to)
1721
1721
    true  Message should be sent by caller
1722
1722
          (admin operation or network communication failed)
1723
1723
*/
1724
 
static bool mysql_admin_table(Session* session, TableList* tables,
 
1724
static bool admin_table(Session* session, TableList* tables,
1725
1725
                              HA_CHECK_OPT* check_opt,
1726
1726
                              const char *operator_name,
1727
1727
                              thr_lock_type lock_type,
2036
2036
  Create a table identical to the specified table
2037
2037
 
2038
2038
  SYNOPSIS
2039
 
    mysql_create_like_table()
 
2039
    create_like_table()
2040
2040
    session             Thread object
2041
2041
    table       Table list element for target table
2042
2042
    src_table   Table list element for source table
2047
2047
    true  error
2048
2048
*/
2049
2049
 
2050
 
bool mysql_create_like_table(Session* session,
 
2050
bool create_like_table(Session* session,
2051
2051
                             const TableIdentifier &destination_identifier,
2052
2052
                             TableList* table, TableList* src_table,
2053
2053
                             message::Table &create_table_proto,
2178
2178
}
2179
2179
 
2180
2180
 
2181
 
bool mysql_analyze_table(Session* session, TableList* tables, HA_CHECK_OPT* check_opt)
 
2181
bool analyze_table(Session* session, TableList* tables, HA_CHECK_OPT* check_opt)
2182
2182
{
2183
2183
  thr_lock_type lock_type = TL_READ_NO_INSERT;
2184
2184
 
2185
 
  return(mysql_admin_table(session, tables, check_opt,
 
2185
  return(admin_table(session, tables, check_opt,
2186
2186
                                "analyze", lock_type, true,
2187
2187
                                &Cursor::ha_analyze));
2188
2188
}
2189
2189
 
2190
2190
 
2191
 
bool mysql_check_table(Session* session, TableList* tables,HA_CHECK_OPT* check_opt)
 
2191
bool check_table(Session* session, TableList* tables,HA_CHECK_OPT* check_opt)
2192
2192
{
2193
2193
  thr_lock_type lock_type = TL_READ_NO_INSERT;
2194
2194
 
2195
 
  return(mysql_admin_table(session, tables, check_opt,
 
2195
  return(admin_table(session, tables, check_opt,
2196
2196
                                "check", lock_type,
2197
2197
                                false,
2198
2198
                                &Cursor::ha_check));