Commit cb41cf0d authored by Rich Prohaska's avatar Rich Prohaska

#194 fix gcc 4.8 warnings

parent 8e621b67
...@@ -2082,8 +2082,7 @@ int ha_tokudb::remove_frm_data(DB *db, DB_TXN *txn) { ...@@ -2082,8 +2082,7 @@ int ha_tokudb::remove_frm_data(DB *db, DB_TXN *txn) {
return remove_from_status(db, hatoku_frm_data, txn); return remove_from_status(db, hatoku_frm_data, txn);
} }
static int static int smart_dbt_callback_verify_frm (DBT const *key, DBT const *row, void *context) {
smart_dbt_callback_verify_frm (DBT const *key, DBT const *row, void *context) {
DBT* stored_frm = (DBT *)context; DBT* stored_frm = (DBT *)context;
stored_frm->size = row->size; stored_frm->size = row->size;
stored_frm->data = (uchar *)tokudb_my_malloc(row->size, MYF(MY_WME)); stored_frm->data = (uchar *)tokudb_my_malloc(row->size, MYF(MY_WME));
...@@ -2096,19 +2095,22 @@ int ha_tokudb::verify_frm_data(const char* frm_name, DB_TXN* txn) { ...@@ -2096,19 +2095,22 @@ int ha_tokudb::verify_frm_data(const char* frm_name, DB_TXN* txn) {
TOKUDB_HANDLER_DBUG_ENTER("%s", frm_name); TOKUDB_HANDLER_DBUG_ENTER("%s", frm_name);
uchar* mysql_frm_data = NULL; uchar* mysql_frm_data = NULL;
size_t mysql_frm_len = 0; size_t mysql_frm_len = 0;
DBT key, stored_frm; DBT key = {};
DBT stored_frm = {};
int error = 0; int error = 0;
HA_METADATA_KEY curr_key = hatoku_frm_data; HA_METADATA_KEY curr_key = hatoku_frm_data;
memset(&key, 0, sizeof(key));
memset(&stored_frm, 0, sizeof(&stored_frm));
// get the frm data from MySQL // get the frm data from MySQL
#if 100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100099 #if 100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100099
error = table_share->read_frm_image((const uchar**)&mysql_frm_data,&mysql_frm_len); error = table_share->read_frm_image((const uchar**)&mysql_frm_data,&mysql_frm_len);
if (error) { goto cleanup; } if (error) {
goto cleanup;
}
#else #else
error = readfrm(frm_name,&mysql_frm_data,&mysql_frm_len); error = readfrm(frm_name,&mysql_frm_data,&mysql_frm_len);
if (error) { goto cleanup; } if (error) {
goto cleanup;
}
#endif #endif
key.data = &curr_key; key.data = &curr_key;
...@@ -2123,20 +2125,13 @@ int ha_tokudb::verify_frm_data(const char* frm_name, DB_TXN* txn) { ...@@ -2123,20 +2125,13 @@ int ha_tokudb::verify_frm_data(const char* frm_name, DB_TXN* txn) {
); );
if (error == DB_NOTFOUND) { if (error == DB_NOTFOUND) {
// if not found, write it // if not found, write it
error = write_frm_data( error = write_frm_data(share->status_block, txn, frm_name);
share->status_block,
txn,
frm_name
);
goto cleanup; goto cleanup;
} } else if (error) {
else if (error) {
goto cleanup; goto cleanup;
} }
if (stored_frm.size != mysql_frm_len || if (stored_frm.size != mysql_frm_len || memcmp(stored_frm.data, mysql_frm_data, stored_frm.size)) {
memcmp(stored_frm.data, mysql_frm_data, stored_frm.size))
{
error = HA_ERR_TABLE_DEF_CHANGED; error = HA_ERR_TABLE_DEF_CHANGED;
goto cleanup; goto cleanup;
} }
......
...@@ -229,11 +229,7 @@ static void get_blob_field_info( ...@@ -229,11 +229,7 @@ static void get_blob_field_info(
uint32_t num_offset_bytes uint32_t num_offset_bytes
); );
static inline uint32_t get_blob_field_len( static inline uint32_t get_blob_field_len(const uchar* from_tokudb, uint32_t len_bytes) {
const uchar* from_tokudb,
uint32_t len_bytes
)
{
uint32_t length = 0; uint32_t length = 0;
switch (len_bytes) { switch (len_bytes) {
case (1): case (1):
...@@ -255,13 +251,7 @@ static inline uint32_t get_blob_field_len( ...@@ -255,13 +251,7 @@ static inline uint32_t get_blob_field_len(
} }
static inline const uchar* unpack_toku_field_blob( static inline const uchar* unpack_toku_field_blob(uchar *to_mysql, const uchar* from_tokudb, uint32_t len_bytes, bool skip) {
uchar *to_mysql,
const uchar* from_tokudb,
uint32_t len_bytes,
bool skip
)
{
uint32_t length = 0; uint32_t length = 0;
const uchar* data_ptr = NULL; const uchar* data_ptr = NULL;
if (!skip) { if (!skip) {
...@@ -271,9 +261,9 @@ static inline const uchar* unpack_toku_field_blob( ...@@ -271,9 +261,9 @@ static inline const uchar* unpack_toku_field_blob(
data_ptr = from_tokudb + len_bytes; data_ptr = from_tokudb + len_bytes;
if (!skip) { if (!skip) {
memcpy(to_mysql + len_bytes, (uchar *)(&data_ptr), sizeof(uchar *)); memcpy(to_mysql + len_bytes, (uchar *)(&data_ptr), sizeof data_ptr);
} }
return (from_tokudb + len_bytes + length); return from_tokudb + len_bytes + length;
} }
static inline uint get_null_offset(TABLE* table, Field* field) { static inline uint get_null_offset(TABLE* table, Field* field) {
......
...@@ -974,9 +974,8 @@ static int tokudb_discover3(handlerton *hton, THD* thd, const char *db, const ch ...@@ -974,9 +974,8 @@ static int tokudb_discover3(handlerton *hton, THD* thd, const char *db, const ch
DB* status_db = NULL; DB* status_db = NULL;
DB_TXN* txn = NULL; DB_TXN* txn = NULL;
HA_METADATA_KEY curr_key = hatoku_frm_data; HA_METADATA_KEY curr_key = hatoku_frm_data;
DBT key, value; DBT key = {};
memset(&key, 0, sizeof(key)); DBT value = {};
memset(&value, 0, sizeof(&value));
bool do_commit; bool do_commit;
#if 100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100099 #if 100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100099
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment