~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/handler/ha_innodb.h

  • Committer: Monty Taylor
  • Date: 2009-08-12 06:25:19 UTC
  • mto: (1114.1.1 innodb-plugin-merge)
  • mto: This revision was merged to the branch mainline in revision 1183.
  • Revision ID: mordred@inaugust.com-20090812062519-cij02mrrunvnxblt
Tags: innodb-plugin-1.0.4
InnoDB Plugin 1.0.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#pragma interface                       /* gcc class implementation */
28
28
#endif
29
29
 
 
30
/** InnoDB table share */
30
31
typedef struct st_innobase_share {
31
 
  THR_LOCK lock;
32
 
  pthread_mutex_t mutex;
33
 
  const char* table_name;
34
 
  uint use_count;
35
 
  void* table_name_hash;
 
32
        THR_LOCK        lock;           /*!< MySQL lock protecting
 
33
                                        this structure */
 
34
        const char*     table_name;     /*!< InnoDB table name */
 
35
        uint            use_count;      /*!< reference count,
 
36
                                        incremented in get_share()
 
37
                                        and decremented in free_share() */
 
38
        void*           table_name_hash;/*!< hash table chain node */
36
39
} INNOBASE_SHARE;
37
40
 
38
41
 
 
42
/** InnoDB B-tree index */
39
43
struct dict_index_struct;
 
44
/** Prebuilt structures in an Innobase table handle used within MySQL */
40
45
struct row_prebuilt_struct;
41
46
 
 
47
/** InnoDB B-tree index */
42
48
typedef struct dict_index_struct dict_index_t;
 
49
/** Prebuilt structures in an Innobase table handle used within MySQL */
43
50
typedef struct row_prebuilt_struct row_prebuilt_t;
44
51
 
45
 
/* The class defining a handle to an Innodb table */
 
52
/** The class defining a handle to an Innodb table */
46
53
class ha_innobase: public handler
47
54
{
48
 
        row_prebuilt_t* prebuilt;       /* prebuilt struct in InnoDB, used
 
55
        row_prebuilt_t* prebuilt;       /*!< prebuilt struct in InnoDB, used
49
56
                                        to save CPU time with prebuilt data
50
57
                                        structures*/
51
 
        THD*            user_thd;       /* the thread handle of the user
 
58
        THD*            user_thd;       /*!< the thread handle of the user
52
59
                                        currently using the handle; this is
53
60
                                        set in external_lock function */
54
61
        THR_LOCK_DATA   lock;
55
 
        INNOBASE_SHARE  *share;
 
62
        INNOBASE_SHARE* share;          /*!< information for MySQL
 
63
                                        table locking */
56
64
 
57
 
        uchar*          upd_buff;       /* buffer used in updates */
58
 
        uchar*          key_val_buff;   /* buffer used in converting
 
65
        uchar*          upd_buff;       /*!< buffer used in updates */
 
66
        uchar*          key_val_buff;   /*!< buffer used in converting
59
67
                                        search key values from MySQL format
60
68
                                        to Innodb format */
61
69
        ulong           upd_and_key_val_buff_len;
63
71
                                        two buffers */
64
72
        Table_flags     int_table_flags;
65
73
        uint            primary_key;
66
 
        ulong           start_of_scan;  /* this is set to 1 when we are
 
74
        ulong           start_of_scan;  /*!< this is set to 1 when we are
67
75
                                        starting a table scan but have not
68
76
                                        yet fetched any row, else 0 */
69
77
        uint            last_match_mode;/* match mode of the latest search:
70
78
                                        ROW_SEL_EXACT, ROW_SEL_EXACT_PREFIX,
71
79
                                        or undefined */
72
 
        uint            num_write_row;  /* number of write_row() calls */
 
80
        uint            num_write_row;  /*!< number of write_row() calls */
73
81
 
74
82
        uint store_key_val_for_row(uint keynr, char* buff, uint buff_len,
75
83
                                   const uchar* record);
119
127
        void try_semi_consistent_read(bool yes);
120
128
        void unlock_row();
121
129
 
122
 
#ifdef ROW_MERGE_IS_INDEX_USABLE
123
 
        /** Check if an index can be used by this transaction.
124
 
        * @param keynr  key number to check
125
 
        * @return       true if available, false if the index
126
 
        *               does not contain old records that exist
127
 
        *               in the read view of this transaction */
128
 
        bool is_index_available(uint keynr);
129
 
#endif /* ROW_MERGE_IS_INDEX_USABLE */
130
130
        int index_init(uint index, bool sorted);
131
131
        int index_end();
132
132
        int index_read(uchar * buf, const uchar * key,
260
260
}
261
261
 
262
262
typedef struct trx_struct trx_t;
263
 
/************************************************************************
 
263
/********************************************************************//**
 
264
@file handler/ha_innodb.h
264
265
Converts an InnoDB error code to a MySQL error code and also tells to MySQL
265
266
about a possible transaction rollback inside InnoDB caused by a lock wait
266
 
timeout or a deadlock. */
 
267
timeout or a deadlock.
 
268
@return MySQL error code */
267
269
extern "C"
268
270
int
269
271
convert_error_code_to_mysql(
270
272
/*========================*/
271
 
                                /* out: MySQL error code */
272
 
        int             error,  /* in: InnoDB error code */
273
 
        ulint           flags,  /* in: InnoDB table flags, or 0 */
274
 
        MYSQL_THD       thd);   /* in: user thread handle or NULL */
 
273
        int             error,  /*!< in: InnoDB error code */
 
274
        ulint           flags,  /*!< in: InnoDB table flags, or 0 */
 
275
        MYSQL_THD       thd);   /*!< in: user thread handle or NULL */
275
276
 
276
 
/*************************************************************************
277
 
Allocates an InnoDB transaction for a MySQL handler object. */
 
277
/*********************************************************************//**
 
278
Allocates an InnoDB transaction for a MySQL handler object.
 
279
@return InnoDB transaction handle */
278
280
extern "C"
279
281
trx_t*
280
282
innobase_trx_allocate(
281
283
/*==================*/
282
 
                                /* out: InnoDB transaction handle */
283
 
        MYSQL_THD       thd);   /* in: user thread handle */
 
284
        MYSQL_THD       thd);   /*!< in: user thread handle */