~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

InnoDB compiles clean. Need to send this patch upstream. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
532
532
innobase_release_temporary_latches(
533
533
/*===============================*/
534
534
                                /* out: 0 */
535
 
        handlerton*     hton,   /* in: handlerton */
 
535
        handlerton*     hton __attribute__((__unused__)),       /* in: handlerton */
536
536
        THD*            thd)    /* in: MySQL thread */
537
537
{
538
538
        trx_t*  trx;
1126
1126
                                name */
1127
1127
        uint    full_name_len,  /* in: length of the full name, i.e.
1128
1128
                                len(dbname) + len(tablename) + 1 */
1129
 
        ulonglong *unused)      /* unused for this engine */
 
1129
        ulonglong *unused __attribute__((__unused__)))  /* unused for this engine */
1130
1130
{
1131
1131
        ibool   is_autocommit;
1132
1132
        trx_t*  trx;
1224
1224
void
1225
1225
innobase_invalidate_query_cache(
1226
1226
/*============================*/
1227
 
        trx_t*  trx,            /* in: transaction which modifies the table */
1228
 
        char*   full_name,      /* in: concatenation of database name, null
 
1227
        trx_t*  trx __attribute__((__unused__)),                /* in: transaction which modifies the table */
 
1228
        char*   full_name __attribute__((__unused__)),  /* in: concatenation of database name, null
1229
1229
                                char '\0', table name, null char'\0';
1230
1230
                                NOTE that in Windows this is always
1231
1231
                                in LOWER CASE! */
1232
 
        ulint   full_name_len)  /* in: full name length where also the null
 
1232
        ulint   full_name_len __attribute__((__unused__)))      /* in: full name length where also the null
1233
1233
                                chars count */
1234
1234
{
1235
1235
        /* Note that the sync0sync.h rank of the query cache mutex is just
1685
1685
Closes an InnoDB database. */
1686
1686
static
1687
1687
int
1688
 
innobase_end(handlerton *hton, ha_panic_function type)
 
1688
innobase_end(handlerton *hton __attribute__((__unused__)),
 
1689
             ha_panic_function type __attribute__((__unused__)))
1689
1690
/*==============*/
1690
1691
                                /* out: TRUE if error */
1691
1692
{
1723
1724
the logs, and the name of this function should be innobase_checkpoint. */
1724
1725
static
1725
1726
bool
1726
 
innobase_flush_logs(handlerton *hton)
 
1727
innobase_flush_logs(handlerton *hton __attribute__((__unused__)))
1727
1728
/*=====================*/
1728
1729
                                /* out: TRUE if error */
1729
1730
{
1806
1807
innobase_commit(
1807
1808
/*============*/
1808
1809
                        /* out: 0 */
1809
 
        handlerton *hton, /* in: Innodb handlerton */ 
 
1810
        handlerton *hton __attribute__((__unused__)), /* in: Innodb handlerton */ 
1810
1811
        THD*    thd,    /* in: MySQL thread handle of the user for whom
1811
1812
                        the transaction should be committed */
1812
1813
        bool    all)    /* in:  TRUE - commit transaction
1933
1934
innobase_rollback(
1934
1935
/*==============*/
1935
1936
                        /* out: 0 or error number */
1936
 
        handlerton *hton, /* in: Innodb handlerton */ 
 
1937
        handlerton *hton __attribute__((__unused__)), /* in: Innodb handlerton */ 
1937
1938
        THD*    thd,    /* in: handle to the MySQL thread of the user
1938
1939
                        whose transaction should be rolled back */
1939
1940
        bool    all)    /* in:  TRUE - commit transaction
2013
2014
/*===========================*/
2014
2015
                                /* out: 0 if success, HA_ERR_NO_SAVEPOINT if
2015
2016
                                no savepoint with the given name */
2016
 
        handlerton *hton,       /* in: Innodb handlerton */ 
 
2017
        handlerton *hton __attribute__((__unused__)),       /* in: Innodb handlerton */ 
2017
2018
        THD*    thd,            /* in: handle to the MySQL thread of the user
2018
2019
                                whose transaction should be rolled back */
2019
2020
        void*   savepoint)      /* in: savepoint data */
2050
2051
/*=======================*/
2051
2052
                                /* out: 0 if success, HA_ERR_NO_SAVEPOINT if
2052
2053
                                no savepoint with the given name */
2053
 
        handlerton*     hton,   /* in: handlerton for Innodb */
 
2054
        handlerton*     hton __attribute__((__unused__)),       /* in: handlerton for Innodb */
2054
2055
        THD*    thd,            /* in: handle to the MySQL thread of the user
2055
2056
                                whose transaction should be rolled back */
2056
2057
        void*   savepoint)      /* in: savepoint data */
2079
2080
innobase_savepoint(
2080
2081
/*===============*/
2081
2082
                                /* out: always 0, that is, always succeeds */
2082
 
        handlerton*     hton,   /* in: handle to the Innodb handlerton */
 
2083
        handlerton*     hton __attribute__((__unused__)),   /* in: handle to the Innodb handlerton */
2083
2084
        THD*    thd,            /* in: handle to the MySQL thread */
2084
2085
        void*   savepoint)      /* in: savepoint data */
2085
2086
{
2125
2126
innobase_close_connection(
2126
2127
/*======================*/
2127
2128
                        /* out: 0 or error number */
2128
 
        handlerton*     hton,   /* in:  innobase handlerton */
 
2129
        handlerton*     hton __attribute__((__unused__)),       /* in:  innobase handlerton */
2129
2130
        THD*    thd)    /* in: handle to the MySQL thread of the user
2130
2131
                        whose resources should be free'd */
2131
2132
{
3023
3024
build_template(
3024
3025
/*===========*/
3025
3026
        row_prebuilt_t* prebuilt,       /* in/out: prebuilt struct */
3026
 
        THD*            thd,            /* in: current user thread, used
 
3027
        THD*            thd __attribute__((__unused__)),                /* in: current user thread, used
3027
3028
                                        only if templ_type is
3028
3029
                                        ROW_MYSQL_REC_FIELDS */
3029
3030
        TABLE*          table,          /* in: MySQL table */
3398
3399
        if (prebuilt->trx != trx) {
3399
3400
          sql_print_error("The transaction object for the table handle is at "
3400
3401
                          "%p, but for the current thread it is at %p",
3401
 
                          prebuilt->trx, trx);
 
3402
                          (void *)prebuilt->trx, (void *)trx);
3402
3403
 
3403
3404
                fputs("InnoDB: Dump of 200 bytes around prebuilt: ", stderr);
3404
3405
                ut_print_buf(stderr, ((const byte*)prebuilt) - 100, 200);
3604
3605
        uchar*          upd_buff,       /* in: buffer to use */
3605
3606
        ulint           buff_len,       /* in: buffer length */
3606
3607
        row_prebuilt_t* prebuilt,       /* in: InnoDB prebuilt struct */
3607
 
        THD*            thd)            /* in: user thread */
 
3608
        THD*            thd __attribute__((__unused__)))                /* in: user thread */
3608
3609
{
3609
3610
        uchar*          original_upd_buff = upd_buff;
3610
3611
        Field*          field;
3962
3963
/*====================*/
3963
3964
                        /* out: 0 or error number */
3964
3965
        uint    keynr,  /* in: key (index) number */
3965
 
        bool sorted)    /* in: 1 if result MUST be sorted according to index */
 
3966
        bool sorted __attribute__((__unused__)))        /* in: 1 if result MUST be sorted according to index */
3966
3967
{
3967
3968
        int     error   = 0;
3968
3969
        DBUG_ENTER("index_init");
4400
4401
                                /* out: 0, HA_ERR_END_OF_FILE, or error
4401
4402
                                number */
4402
4403
        uchar*          buf,    /* in/out: buffer for the row */
4403
 
        const uchar*    key,    /* in: key value */
4404
 
        uint            keylen) /* in: key value length */
 
4404
        const uchar*    key __attribute__((__unused__)),        /* in: key value */
 
4405
        uint            keylen __attribute__((__unused__)))     /* in: key value length */
4405
4406
{
4406
4407
        ha_statistic_increment(&SSV::ha_read_next_count);
4407
4408
 
5290
5291
innobase_drop_database(
5291
5292
/*===================*/
5292
5293
                        /* out: error number */
5293
 
        handlerton *hton, /* in: handlerton of Innodb */
 
5294
        handlerton *hton __attribute__((__unused__)), /* in: handlerton of Innodb */
5294
5295
        char*   path)   /* in: database path; inside InnoDB the name
5295
5296
                        of the last directory in the path is used as
5296
5297
                        the database name: for example, in 'mysql/data/test'
5875
5876
ha_innobase::analyze(
5876
5877
/*=================*/
5877
5878
                                        /* out: returns always 0 (success) */
5878
 
        THD*            thd,            /* in: connection thread handle */
5879
 
        HA_CHECK_OPT*   check_opt)      /* in: currently ignored */
 
5879
        THD*            thd __attribute__((__unused__)),                /* in: connection thread handle */
 
5880
        HA_CHECK_OPT*   check_opt __attribute__((__unused__)))  /* in: currently ignored */
5880
5881
{
5881
5882
        /* Simply call ::info() with all the flags */
5882
5883
        info(HA_STATUS_TIME | HA_STATUS_CONST | HA_STATUS_VARIABLE);
5891
5892
int
5892
5893
ha_innobase::optimize(
5893
5894
/*==================*/
5894
 
        THD*            thd,            /* in: connection thread handle */
5895
 
        HA_CHECK_OPT*   check_opt)      /* in: currently ignored */
 
5895
        THD*            thd __attribute__((__unused__)),                /* in: connection thread handle */
 
5896
        HA_CHECK_OPT*   check_opt __attribute__((__unused__)))  /* in: currently ignored */
5896
5897
{
5897
5898
        return(HA_ADMIN_TRY_ALTER);
5898
5899
}
5908
5909
                                        /* out: HA_ADMIN_CORRUPT or
5909
5910
                                        HA_ADMIN_OK */
5910
5911
        THD*            thd,            /* in: user thread handle */
5911
 
        HA_CHECK_OPT*   check_opt)      /* in: check options, currently
 
5912
        HA_CHECK_OPT*   check_opt __attribute__((__unused__)))  /* in: check options, currently
5912
5913
                                        ignored */
5913
5914
{
5914
5915
        ulint           ret;
5973
5974
        mutex_enter_noninline(&srv_dict_tmpfile_mutex);
5974
5975
        rewind(srv_dict_tmpfile);
5975
5976
 
5976
 
        fprintf(srv_dict_tmpfile, "InnoDB free: %llu kB",
 
5977
        fprintf(srv_dict_tmpfile, "InnoDB free: %lu kB",
5977
5978
                fsp_get_available_space_in_free_extents(
5978
5979
                        prebuilt->table->space));
5979
5980
 
6708
6709
 
6709
6710
/****************************************************************************
6710
6711
Here we export InnoDB status variables to MySQL.  */
 
6712
/* TODO: FIX the case below:
6711
6713
static
6712
6714
int
6713
6715
innodb_export_status()
6714
 
/*==================*/
 
6716
*==================*
6715
6717
{
6716
6718
        if (innodb_inited) {
6717
6719
                srv_export_innodb_status();
6719
6721
 
6720
6722
        return 0;
6721
6723
}
 
6724
*/
6722
6725
 
6723
6726
/****************************************************************************
6724
6727
Implements the SHOW INNODB STATUS command. Sends the output of the InnoDB
6727
6730
bool
6728
6731
innodb_show_status(
6729
6732
/*===============*/
6730
 
        handlerton*     hton,   /* in: the innodb handlerton */
 
6733
        handlerton*     hton __attribute__((__unused__)),       /* in: the innodb handlerton */
6731
6734
        THD*    thd,    /* in: the MySQL query thread of the caller */
6732
6735
        stat_print_fn *stat_print)
6733
6736
{
6814
6817
bool
6815
6818
innodb_mutex_show_status(
6816
6819
/*=====================*/
6817
 
        handlerton*     hton,   /* in: the innodb handlerton */
 
6820
        handlerton*     hton __attribute__((__unused__)),       /* in: the innodb handlerton */
6818
6821
        THD*            thd,            /* in: the MySQL query thread of the
6819
6822
                                        caller */
6820
6823
        stat_print_fn*  stat_print)
7366
7369
void
7367
7370
ha_innobase::get_auto_increment(
7368
7371
/*============================*/
7369
 
        ulonglong       offset,              /* in: */
 
7372
        ulonglong       offset __attribute__((__unused__)),              /* in: */
7370
7373
        ulonglong       increment,           /* in: table autoinc increment */
7371
7374
        ulonglong       nb_desired_values,   /* in: number of values reqd */
7372
7375
        ulonglong       *first_value,        /* out: the autoinc value */
7475
7478
 
7476
7479
/* See comment in handler.cc */
7477
7480
bool
7478
 
ha_innobase::get_error_message(int error, String *buf)
 
7481
ha_innobase::get_error_message(int error __attribute__((__unused__)), String *buf)
7479
7482
{
7480
7483
        trx_t*  trx = check_trx_exists(ha_thd());
7481
7484
 
7680
7683
innobase_xa_prepare(
7681
7684
/*================*/
7682
7685
                        /* out: 0 or error number */
7683
 
        handlerton *hton,
 
7686
        handlerton *hton __attribute__((__unused__)),
7684
7687
        THD*    thd,    /* in: handle to the MySQL thread of the user
7685
7688
                        whose XA transaction should be prepared */
7686
7689
        bool    all)    /* in: TRUE - commit transaction
7775
7778
/*================*/
7776
7779
                                /* out: number of prepared transactions
7777
7780
                                stored in xid_list */
7778
 
        handlerton *hton,
 
7781
        handlerton *hton __attribute__((__unused__)),
7779
7782
        XID*    xid_list,       /* in/out: prepared transactions */
7780
7783
        uint    len)            /* in: number of slots in xid_list */
7781
7784
{
7795
7798
innobase_commit_by_xid(
7796
7799
/*===================*/
7797
7800
                        /* out: 0 or error number */
7798
 
        handlerton *hton,
 
7801
        handlerton *hton __attribute__((__unused__)),
7799
7802
        XID*    xid)    /* in: X/Open XA transaction identification */
7800
7803
{
7801
7804
        trx_t*  trx;
7819
7822
innobase_rollback_by_xid(
7820
7823
/*=====================*/
7821
7824
                        /* out: 0 or error number */
7822
 
        handlerton *hton,
 
7825
        handlerton *hton __attribute__((__unused__)),
7823
7826
        XID     *xid)   /* in: X/Open XA transaction identification */
7824
7827
{
7825
7828
        trx_t*  trx;
7843
7846
innobase_create_cursor_view(
7844
7847
/*========================*/
7845
7848
                          /* out: pointer to cursor view or NULL */
7846
 
        handlerton *hton, /* in: innobase hton */
 
7849
        handlerton *hton __attribute__((__unused__)), /* in: innobase hton */
7847
7850
        THD* thd)         /* in: user thread handle */
7848
7851
{
7849
7852
        return(read_cursor_view_create_for_mysql(check_trx_exists(thd)));
7857
7860
void
7858
7861
innobase_close_cursor_view(
7859
7862
/*=======================*/
7860
 
        handlerton *hton,
 
7863
        handlerton *hton __attribute__((__unused__)),
7861
7864
        THD*    thd,    /* in: user thread handle */
7862
7865
        void*   curview)/* in: Consistent read view to be closed */
7863
7866
{
7874
7877
void
7875
7878
innobase_set_cursor_view(
7876
7879
/*=====================*/
7877
 
        handlerton *hton,
 
7880
        handlerton *hton __attribute__((__unused__)),
7878
7881
        THD*    thd,    /* in: user thread handle */
7879
7882
        void*   curview)/* in: Consistent cursor view to be set */
7880
7883
{
7909
7912
        return COMPATIBLE_DATA_YES;
7910
7913
}
7911
7914
 
7912
 
static int show_innodb_vars(THD *thd, SHOW_VAR *var, char *buff)
 
7915
/* TODO: Fix the cast below!!!
 
7916
 
 
7917
static char * show_innodb_vars(THD *thd __attribute__((__unused__)),
 
7918
                            SHOW_VAR *var, char *buff __attribute__((__unused__)))
7913
7919
{
7914
7920
  innodb_export_status();
7915
7921
  var->type= SHOW_ARRAY;
7918
7924
}
7919
7925
 
7920
7926
static SHOW_VAR innodb_status_variables_export[]= {
7921
 
  {"Innodb",                   (char*) &show_innodb_vars, SHOW_FUNC},
 
7927
  {"Innodb",                  (char *) &show_innodb_vars, SHOW_FUNC},
7922
7928
  {NullS, NullS, SHOW_LONG}
7923
7929
};
7924
7930
 
 
7931
*/
 
7932
 
7925
7933
static struct st_mysql_storage_engine innobase_storage_engine=
7926
7934
{ MYSQL_HANDLERTON_INTERFACE_VERSION };
7927
7935
 
8170
8178
  innobase_init, /* Plugin Init */
8171
8179
  NULL, /* Plugin Deinit */
8172
8180
  0x0100 /* 1.0 */,
8173
 
  innodb_status_variables_export,/* status variables             */
 
8181
  innodb_status_variables,/* status variables             */
8174
8182
  innobase_system_variables, /* system variables */
8175
8183
  NULL /* reserved */
8176
8184
}