~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to sql/mysql_priv.h

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
#endif
50
50
#include "probes.h"
51
51
 
52
 
/* Windows lacks a netdb.h */
53
 
#ifdef __WIN__
54
 
#include <Ws2tcpip.h>
55
 
#else
 
52
#ifndef __WIN__
56
53
#include <netdb.h>
57
54
#endif
58
55
 
302
299
#define USER_VARS_HASH_SIZE     16
303
300
#define TABLE_OPEN_CACHE_MIN    64
304
301
#define TABLE_OPEN_CACHE_DEFAULT 64
 
302
#define TABLE_DEF_CACHE_DEFAULT 256
 
303
/**
 
304
  We must have room for at least 256 table definitions in the table
 
305
  cache, since otherwise there is no chance prepared
 
306
  statements that use these many tables can work.
 
307
  Prepared statements use table definition cache ids (table_map_id)
 
308
  as table version identifiers. If the table definition
 
309
  cache size is less than the number of tables used in a statement,
 
310
  the contents of the table definition cache is guaranteed to rotate
 
311
  between a prepare and execute. This leads to stable validation
 
312
  errors. In future we shall use more stable version identifiers,
 
313
  for now the only solution is to ensure that the table definition
 
314
  cache can contain at least all tables of a given statement.
 
315
*/
 
316
#define TABLE_DEF_CACHE_MIN     256
305
317
 
306
318
/* 
307
319
 Value of 9236 discovered through binary search 2006-09-26 on Ubuntu Dapper
602
614
#define DBUG_SYNC_POINT(lock_name,lock_timeout)
603
615
#endif /* EXTRA_DEBUG */
604
616
 
 
617
/* Debug Sync Facility. */
 
618
#if defined(ENABLED_DEBUG_SYNC)
 
619
/* Macro to be put in the code at synchronization points. */
 
620
#define DEBUG_SYNC(_thd_, _sync_point_name_)                            \
 
621
          do { if (unlikely(opt_debug_sync_timeout))                    \
 
622
               debug_sync(_thd_, STRING_WITH_LEN(_sync_point_name_));   \
 
623
             } while (0)
 
624
/* Command line option --debug-sync-timeout. See mysqld.cc. */
 
625
extern uint opt_debug_sync_timeout;
 
626
/* Default WAIT_FOR timeout if command line option is given without argument. */
 
627
#define DEBUG_SYNC_DEFAULT_WAIT_TIMEOUT 300
 
628
/* Debug Sync prototypes. See debug_sync.cc. */
 
629
extern int  debug_sync_init(void);
 
630
extern void debug_sync_end(void);
 
631
extern void debug_sync_init_thread(THD *thd);
 
632
extern void debug_sync_end_thread(THD *thd);
 
633
extern void debug_sync(THD *thd, const char *sync_point_name, size_t name_len);
 
634
#else /* defined(ENABLED_DEBUG_SYNC) */
 
635
#define DEBUG_SYNC(_thd_, _sync_point_name_)    /* disabled DEBUG_SYNC */
 
636
#endif /* defined(ENABLED_DEBUG_SYNC) */
 
637
 
605
638
/* BINLOG_DUMP options */
606
639
 
607
640
#define BINLOG_DUMP_NON_BLOCK   1
652
685
 
653
686
struct st_table;
654
687
 
655
 
#define thd_proc_info(thd, msg)  set_thd_proc_info(thd, msg, __func__, __FILE__, __LINE__)
656
688
class THD;
657
689
 
658
690
enum enum_check_fields
662
694
  CHECK_FIELD_ERROR_FOR_NULL
663
695
};
664
696
 
665
 
                                  
666
697
/** Struct to handle simple linked lists. */
667
698
typedef struct st_sql_list {
668
699
  uint elements;
723
754
                              const char *calling_file, 
724
755
                              const unsigned int calling_line);
725
756
 
 
757
/**
 
758
  Enumerate possible types of a table from re-execution
 
759
  standpoint.
 
760
  TABLE_LIST class has a member of this type.
 
761
  At prepared statement prepare, this member is assigned a value
 
762
  as of the current state of the database. Before (re-)execution
 
763
  of a prepared statement, we check that the value recorded at
 
764
  prepare matches the type of the object we obtained from the
 
765
  table definition cache.
 
766
 
 
767
  @sa check_and_update_table_version()
 
768
  @sa Execute_observer
 
769
  @sa Prepared_statement::reprepare()
 
770
*/
 
771
 
 
772
enum enum_table_ref_type
 
773
{
 
774
  /** Initial value set by the parser */
 
775
  TABLE_REF_NULL= 0,
 
776
  TABLE_REF_VIEW,
 
777
  TABLE_REF_BASE_TABLE,
 
778
  TABLE_REF_I_S_TABLE,
 
779
  TABLE_REF_TMP_TABLE
 
780
};
 
781
 
726
782
/*
727
783
  External variables
728
784
*/
764
820
void free_items(Item *item);
765
821
void cleanup_items(Item *item);
766
822
class THD;
767
 
void close_thread_tables(THD *thd);
 
823
void close_thread_tables(THD *thd, bool skip_mdl= 0);
768
824
 
769
825
#ifndef NO_EMBEDDED_ACCESS_CHECKS
770
826
bool check_one_table_access(THD *thd, ulong privilege, TABLE_LIST *tables);
952
1008
{
953
1009
  const char *extra_str= "-d,";
954
1010
  char total_str[200];
955
 
  if (_db_strict_keyword_ (dbug_str))
 
1011
  if (_db_keyword_ (0, dbug_str, 1))
956
1012
  {
957
1013
    strxmov(total_str, extra_str, dbug_str, NullS);
958
1014
    DBUG_SET(total_str);
1012
1068
#define SET_ERROR_INJECT_VALUE(x) \
1013
1069
  current_thd->error_inject_value= (x)
1014
1070
#define ERROR_INJECT_CRASH(code) \
1015
 
  DBUG_EVALUATE_IF(code, (abort(), 0), 0)
 
1071
  DBUG_EVALUATE_IF(code, (DBUG_ABORT(), 0), 0)
1016
1072
#define ERROR_INJECT_ACTION(code, action) \
1017
1073
  (check_and_unset_keyword(code) ? ((action), 0) : 0)
1018
1074
#define ERROR_INJECT(code) \
1022
1078
#define ERROR_INJECT_VALUE_ACTION(value,action) \
1023
1079
  (check_and_unset_inject_value(value) ? (action) : 0)
1024
1080
#define ERROR_INJECT_VALUE_CRASH(value) \
1025
 
  ERROR_INJECT_VALUE_ACTION(value, (abort(), 0))
 
1081
  ERROR_INJECT_VALUE_ACTION(value, (DBUG_ABORT(), 0))
1026
1082
 
1027
1083
#endif
1028
1084
 
1057
1113
                         bool drop_temporary, bool drop_view, bool log_query);
1058
1114
bool quick_rm_table(handlerton *base,const char *db,
1059
1115
                    const char *table_name, uint flags);
1060
 
void close_cached_table(THD *thd, TABLE *table);
1061
1116
bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent);
1062
1117
bool do_rename(THD *thd, TABLE_LIST *ren_table, char *new_db,
1063
1118
                      char *new_table_name, char *new_table_alias,
1098
1153
bool compare_record(TABLE *table);
1099
1154
bool append_file_to_dir(THD *thd, const char **filename_ptr, 
1100
1155
                        const char *table_name);
1101
 
void wait_while_table_is_used(THD *thd, TABLE *table,
1102
 
                              enum ha_extra_function function);
1103
 
bool table_cache_init(void);
1104
 
void table_cache_free(void);
1105
1156
bool table_def_init(void);
1106
1157
void table_def_free(void);
1107
1158
void assign_new_table_id(TABLE_SHARE *share);
1114
1165
#ifndef NO_EMBEDDED_ACCESS_CHECKS
1115
1166
bool check_access(THD *thd, ulong access, const char *db, ulong *save_priv,
1116
1167
                  bool no_grant, bool no_errors, bool schema_db);
1117
 
bool check_table_access(THD *thd, ulong want_access, TABLE_LIST *tables,
 
1168
bool check_table_access(THD *thd, ulong requirements, TABLE_LIST *tables,
1118
1169
                        bool no_errors,
1119
1170
                        bool any_combination_of_privileges_will_do,
1120
1171
                        uint number);
1279
1330
                          bool tmp_table);
1280
1331
TABLE_SHARE *get_table_share(THD *thd, TABLE_LIST *table_list, char *key,
1281
1332
                             uint key_length, uint db_flags, int *error);
1282
 
void release_table_share(TABLE_SHARE *share, enum release_type type);
 
1333
void release_table_share(TABLE_SHARE *share);
1283
1334
TABLE_SHARE *get_cached_table_share(const char *db, const char *table_name);
1284
1335
TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type update,
1285
1336
                   uint lock_flags);
1286
 
TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT* mem,
1287
 
                  bool *refresh, uint flags);
1288
 
bool name_lock_locked_table(THD *thd, TABLE_LIST *tables);
1289
 
bool reopen_name_locked_table(THD* thd, TABLE_LIST* table_list, bool link_in);
1290
 
TABLE *table_cache_insert_placeholder(THD *thd, const char *key,
1291
 
                                      uint key_length);
1292
 
bool lock_table_name_if_not_cached(THD *thd, const char *db,
1293
 
                                   const char *table_name, TABLE **table);
1294
 
TABLE *find_locked_table(THD *thd, const char *db,const char *table_name);
1295
 
void detach_merge_children(TABLE *table, bool clear_refs);
1296
 
bool fix_merge_after_open(TABLE_LIST *old_child_list, TABLE_LIST **old_last,
1297
 
                          TABLE_LIST *new_child_list, TABLE_LIST **new_last);
1298
 
bool reopen_table(TABLE *table);
1299
 
bool reopen_tables(THD *thd,bool get_locks,bool in_refresh);
1300
 
void close_data_files_and_morph_locks(THD *thd, const char *db,
1301
 
                                      const char *table_name);
1302
 
void close_handle_and_leave_table_as_lock(TABLE *table);
 
1337
enum enum_open_table_action {OT_NO_ACTION= 0, OT_BACK_OFF_AND_RETRY,
 
1338
                             OT_DISCOVER, OT_REPAIR};
 
1339
bool open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT* mem,
 
1340
                enum_open_table_action *action, uint flags);
 
1341
bool tdc_open_view(THD *thd, TABLE_LIST *table_list, const char *alias,
 
1342
                   char *cache_key, uint cache_key_length,
 
1343
                   MEM_ROOT *mem_root, uint flags);
 
1344
TABLE *find_locked_table(TABLE *list, const char *db, const char *table_name);
 
1345
TABLE *find_write_locked_table(TABLE *list, const char *db,
 
1346
                               const char *table_name);
1303
1347
bool open_new_frm(THD *thd, TABLE_SHARE *share, const char *alias,
1304
1348
                  uint db_stat, uint prgflag,
1305
1349
                  uint ha_open_flags, TABLE *outparam,
1306
1350
                  TABLE_LIST *table_desc, MEM_ROOT *mem_root);
1307
 
bool wait_for_tables(THD *thd);
1308
 
bool table_is_used(TABLE *table, bool wait_for_name_lock);
1309
 
TABLE *drop_locked_tables(THD *thd,const char *db, const char *table_name);
1310
 
void abort_locked_tables(THD *thd,const char *db, const char *table_name);
1311
1351
void execute_init_command(THD *thd, sys_var_str *init_command_var,
1312
1352
                          rw_lock_t *var_mutex);
1313
1353
extern Field *not_found_field;
1441
1481
bool mysql_ha_read(THD *, TABLE_LIST *,enum enum_ha_read_modes,char *,
1442
1482
                   List<Item> *,enum ha_rkey_function,Item *,ha_rows,ha_rows);
1443
1483
void mysql_ha_flush(THD *thd);
1444
 
void mysql_ha_rm_tables(THD *thd, TABLE_LIST *tables, bool is_locked);
 
1484
void mysql_ha_rm_tables(THD *thd, TABLE_LIST *tables);
1445
1485
void mysql_ha_cleanup(THD *thd);
1446
1486
 
1447
1487
/* sql_base.cc */
1473
1513
void add_join_natural(TABLE_LIST *a,TABLE_LIST *b,List<String> *using_fields,
1474
1514
                      SELECT_LEX *lex);
1475
1515
bool add_proc_to_list(THD *thd, Item *item);
1476
 
void unlink_open_table(THD *thd, TABLE *find, bool unlock);
 
1516
bool wait_while_table_is_used(THD *thd, TABLE *table,
 
1517
                              enum ha_extra_function function);
1477
1518
void drop_open_table(THD *thd, TABLE *table, const char *db_name,
1478
1519
                     const char *table_name);
 
1520
void close_all_tables_for_name(THD *thd, TABLE_SHARE *share,
 
1521
                               bool remove_from_locked_tables);
1479
1522
void update_non_unique_table_error(TABLE_LIST *update,
1480
1523
                                   const char *operation,
1481
1524
                                   TABLE_LIST *duplicate);
1486
1529
extern Item **not_found_item;
1487
1530
 
1488
1531
/*
 
1532
  A set of constants used for checking non aggregated fields and sum
 
1533
  functions mixture in the ONLY_FULL_GROUP_BY_MODE.
 
1534
*/
 
1535
#define NON_AGG_FIELD_USED  1
 
1536
#define SUM_FUNC_USED       2
 
1537
 
 
1538
/*
1489
1539
  This enumeration type is used only by the function find_item_in_list
1490
1540
  to return the info on how an item has been resolved against a list
1491
1541
  of possibly aliased items.
1549
1599
                        pthread_cond_t *cond);
1550
1600
int open_tables(THD *thd, TABLE_LIST **tables, uint *counter, uint flags);
1551
1601
/* open_and_lock_tables with optional derived handling */
1552
 
int open_and_lock_tables_derived(THD *thd, TABLE_LIST *tables, bool derived);
 
1602
int open_and_lock_tables_derived(THD *thd, TABLE_LIST *tables, bool derived,
 
1603
                                 uint flags);
1553
1604
/* simple open_and_lock_tables without derived handling */
1554
1605
inline int simple_open_n_lock_tables(THD *thd, TABLE_LIST *tables)
1555
1606
{
1556
 
  return open_and_lock_tables_derived(thd, tables, FALSE);
 
1607
  return open_and_lock_tables_derived(thd, tables, FALSE, 0);
1557
1608
}
1558
1609
/* open_and_lock_tables with derived handling */
1559
1610
inline int open_and_lock_tables(THD *thd, TABLE_LIST *tables)
1560
1611
{
1561
 
  return open_and_lock_tables_derived(thd, tables, TRUE);
 
1612
  return open_and_lock_tables_derived(thd, tables, TRUE, 0);
1562
1613
}
1563
1614
/* simple open_and_lock_tables without derived handling for single table */
1564
1615
TABLE *open_n_lock_single_table(THD *thd, TABLE_LIST *table_l,
1565
 
                                thr_lock_type lock_type);
 
1616
                                thr_lock_type lock_type, uint flags);
1566
1617
bool open_normal_and_derived_tables(THD *thd, TABLE_LIST *tables, uint flags);
1567
 
int lock_tables(THD *thd, TABLE_LIST *tables, uint counter, bool *need_reopen);
 
1618
int lock_tables(THD *thd, TABLE_LIST *tables, uint counter, uint flags,
 
1619
                bool *need_reopen);
1568
1620
int decide_logging_format(THD *thd, TABLE_LIST *tables);
1569
1621
TABLE *open_temporary_table(THD *thd, const char *path, const char *db,
1570
1622
                            const char *table_name, bool link_in_list,
1574
1626
void intern_close_table(TABLE *entry);
1575
1627
bool close_thread_table(THD *thd, TABLE **table_ptr);
1576
1628
void close_temporary_tables(THD *thd);
1577
 
void close_tables_for_reopen(THD *thd, TABLE_LIST **tables);
 
1629
void close_tables_for_reopen(THD *thd, TABLE_LIST **tables, bool skip_mdl);
1578
1630
TABLE_LIST *find_table_in_list(TABLE_LIST *table,
1579
1631
                               TABLE_LIST *TABLE_LIST::*link,
1580
1632
                               const char *db_name,
1589
1641
void close_temporary(TABLE *table, bool free_share, bool delete_table);
1590
1642
bool rename_temporary_table(THD* thd, TABLE *table, const char *new_db,
1591
1643
                            const char *table_name);
1592
 
void remove_db_from_cache(const char *db);
1593
1644
void flush_tables();
1594
1645
bool is_equal(const LEX_STRING *a, const LEX_STRING *b);
1595
1646
char *make_default_log_name(char *buff,const char* log_ext);
1609
1660
                           uint *fast_alter_partition);
1610
1661
#endif
1611
1662
 
1612
 
/* bits for last argument to remove_table_from_cache() */
1613
 
#define RTFC_NO_FLAG                0x0000
1614
 
#define RTFC_OWNED_BY_THD_FLAG      0x0001
1615
 
#define RTFC_WAIT_OTHER_THREAD_FLAG 0x0002
1616
 
#define RTFC_CHECK_KILLED_FLAG      0x0004
1617
 
bool remove_table_from_cache(THD *thd, const char *db, const char *table,
1618
 
                             uint flags);
 
1663
enum enum_tdc_remove_table_type {TDC_RT_REMOVE_ALL, TDC_RT_REMOVE_NOT_OWN,
 
1664
                                 TDC_RT_REMOVE_UNUSED};
 
1665
void tdc_remove_table(THD *thd, enum_tdc_remove_table_type remove_type,
 
1666
                      const char *db, const char *table_name);
1619
1667
 
1620
1668
#define NORMAL_PART_NAME 0
1621
1669
#define TEMP_PART_NAME 1
1629
1677
 
1630
1678
typedef struct st_lock_param_type
1631
1679
{
1632
 
  TABLE_LIST table_list;
 
1680
  TABLE_LIST *table_list;
1633
1681
  ulonglong copied;
1634
1682
  ulonglong deleted;
1635
1683
  THD *thd;
1640
1688
  const char *db;
1641
1689
  const char *table_name;
1642
1690
  uchar *pack_frm_data;
1643
 
  enum thr_lock_type old_lock_type;
1644
1691
  uint key_count;
1645
1692
  uint db_options;
1646
1693
  size_t pack_frm_len;
1734
1781
bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags);
1735
1782
int abort_and_upgrade_lock(ALTER_PARTITION_PARAM_TYPE *lpt);
1736
1783
void close_open_tables_and_downgrade(ALTER_PARTITION_PARAM_TYPE *lpt);
1737
 
void mysql_wait_completed_table(ALTER_PARTITION_PARAM_TYPE *lpt, TABLE *my_table);
1738
1784
 
1739
1785
/* Functions to work with system tables. */
1740
1786
bool open_system_tables_for_read(THD *thd, TABLE_LIST *table_list,
1747
1793
void close_performance_schema_table(THD *thd, Open_tables_state *backup);
1748
1794
 
1749
1795
bool close_cached_tables(THD *thd, TABLE_LIST *tables, bool have_lock,
1750
 
                         bool wait_for_refresh, bool wait_for_placeholders);
 
1796
                         bool wait_for_refresh);
1751
1797
bool close_cached_connection_tables(THD *thd, bool wait_for_refresh,
1752
1798
                                    LEX_STRING *connect_string,
1753
1799
                                    bool have_lock = FALSE);
1943
1989
extern ulong slave_net_timeout, slave_trans_retries;
1944
1990
extern uint max_user_connections;
1945
1991
extern ulong what_to_log,flush_time;
1946
 
extern ulong query_buff_size, thread_stack;
 
1992
extern ulong query_buff_size;
1947
1993
extern ulong max_prepared_stmt_count, prepared_stmt_count;
1948
1994
extern ulong binlog_cache_size, max_binlog_cache_size, open_files_limit;
1949
1995
extern ulong max_binlog_size, max_relay_log_size;
2019
2065
extern pthread_key(MEM_ROOT**,THR_MALLOC);
2020
2066
extern pthread_mutex_t LOCK_mysql_create_db,LOCK_Acl,LOCK_open, LOCK_lock_db,
2021
2067
       LOCK_thread_count,LOCK_mapped_file,LOCK_user_locks, LOCK_status,
2022
 
       LOCK_error_log, LOCK_delayed_insert, LOCK_uuid_generator,
 
2068
       LOCK_error_log, LOCK_delayed_insert, LOCK_uuid_short,
2023
2069
       LOCK_delayed_status, LOCK_delayed_create, LOCK_crypt, LOCK_timezone,
2024
2070
       LOCK_slave_list, LOCK_active_mi, LOCK_manager, LOCK_global_read_lock,
2025
2071
       LOCK_global_system_variables, LOCK_user_conn,
2049
2095
#ifdef MYSQL_SERVER
2050
2096
extern struct system_variables max_system_variables;
2051
2097
extern struct system_status_var global_status_var;
2052
 
extern struct rand_struct sql_rand;
 
2098
extern struct my_rnd_struct sql_rand;
2053
2099
 
2054
2100
extern const char *opt_date_time_formats[];
2055
2101
extern KNOWN_DATE_TIME_FORMAT known_date_time_formats[];
2056
2102
 
2057
2103
extern String null_string;
2058
 
extern HASH open_cache, lock_db_cache;
 
2104
extern HASH table_def_cache, lock_db_cache;
2059
2105
extern TABLE *unused_tables;
 
2106
extern uint  table_cache_count;
2060
2107
extern const char* any_db;
2061
2108
extern struct my_option my_long_options[];
2062
2109
extern const LEX_STRING view_type;
2068
2115
 
2069
2116
/* optional things, have_* variables */
2070
2117
extern SHOW_COMP_OPTION have_community_features;
2071
 
 
2072
2118
extern handlerton *partition_hton;
2073
2119
extern handlerton *myisam_hton;
 
2120
extern handlerton *maria_hton;
2074
2121
extern handlerton *heap_hton;
2075
2122
 
2076
2123
extern SHOW_COMP_OPTION have_ssl, have_symlink, have_dlopen;
2093
2140
/* mysql_lock_tables() and open_table() flags bits */
2094
2141
#define MYSQL_LOCK_IGNORE_GLOBAL_READ_LOCK      0x0001
2095
2142
#define MYSQL_LOCK_IGNORE_FLUSH                 0x0002
2096
 
#define MYSQL_LOCK_NOTIFY_IF_NEED_REOPEN        0x0004
2097
 
#define MYSQL_OPEN_TEMPORARY_ONLY               0x0008
2098
 
#define MYSQL_LOCK_IGNORE_GLOBAL_READ_ONLY      0x0010
2099
 
#define MYSQL_LOCK_PERF_SCHEMA                  0x0020
 
2143
#define MYSQL_OPEN_TEMPORARY_ONLY               0x0004
 
2144
#define MYSQL_LOCK_IGNORE_GLOBAL_READ_ONLY      0x0008
 
2145
#define MYSQL_LOCK_PERF_SCHEMA                  0x0010
 
2146
#define MYSQL_OPEN_TAKE_UPGRADABLE_MDL          0x0020
 
2147
/**
 
2148
  Do not try to acquire a metadata lock on the table: we
 
2149
  already have one.
 
2150
*/
 
2151
#define MYSQL_OPEN_HAS_MDL_LOCK                 0x0040
 
2152
/**
 
2153
  If in locked tables mode, ignore the locked tables and get
 
2154
  a new instance of the table.
 
2155
*/
 
2156
#define MYSQL_OPEN_GET_NEW_TABLE                0x0080
 
2157
/** Don't look up the table in the list of temporary tables. */
 
2158
#define MYSQL_OPEN_SKIP_TEMPORARY               0x0100
 
2159
 
 
2160
/** Please refer to the internals manual. */
 
2161
#define MYSQL_OPEN_REOPEN  (MYSQL_LOCK_IGNORE_FLUSH |\
 
2162
                            MYSQL_LOCK_IGNORE_GLOBAL_READ_LOCK |\
 
2163
                            MYSQL_LOCK_IGNORE_GLOBAL_READ_ONLY |\
 
2164
                            MYSQL_OPEN_GET_NEW_TABLE |\
 
2165
                            MYSQL_OPEN_SKIP_TEMPORARY |\
 
2166
                            MYSQL_OPEN_HAS_MDL_LOCK)
2100
2167
 
2101
2168
void mysql_unlock_tables(THD *thd, MYSQL_LOCK *sql_lock);
2102
2169
void mysql_unlock_read_tables(THD *thd, MYSQL_LOCK *sql_lock);
2103
2170
void mysql_unlock_some_tables(THD *thd, TABLE **table,uint count);
2104
 
void mysql_lock_remove(THD *thd, MYSQL_LOCK *locked,TABLE *table,
2105
 
                       bool always_unlock);
 
2171
void mysql_lock_remove(THD *thd, MYSQL_LOCK *locked,TABLE *table);
2106
2172
void mysql_lock_abort(THD *thd, TABLE *table, bool upgrade_lock);
2107
2173
void mysql_lock_downgrade_write(THD *thd, TABLE *table,
2108
2174
                                thr_lock_type new_lock_type);
2125
2191
                            bool transactional);
2126
2192
 
2127
2193
/* Lock based on name */
2128
 
int lock_and_wait_for_table_name(THD *thd, TABLE_LIST *table_list);
2129
 
int lock_table_name(THD *thd, TABLE_LIST *table_list, bool check_in_use);
2130
 
void unlock_table_name(THD *thd, TABLE_LIST *table_list);
2131
 
bool wait_for_locked_table_names(THD *thd, TABLE_LIST *table_list);
2132
2194
bool lock_table_names(THD *thd, TABLE_LIST *table_list);
2133
 
void unlock_table_names(THD *thd, TABLE_LIST *table_list,
2134
 
                        TABLE_LIST *last_table);
2135
 
bool lock_table_names_exclusively(THD *thd, TABLE_LIST *table_list);
2136
 
bool is_table_name_exclusively_locked_by_this_thread(THD *thd, 
2137
 
                                                     TABLE_LIST *table_list);
2138
 
bool is_table_name_exclusively_locked_by_this_thread(THD *thd, uchar *key,
2139
 
                                                     int key_length);
 
2195
void unlock_table_names(THD *thd);
2140
2196
 
2141
2197
 
2142
2198
/* old unireg functions */