summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorMichael Widenius <monty@mariadb.org>2017-04-16 22:40:39 +0300
committerMonty <monty@mariadb.org>2017-04-18 12:23:53 +0300
commita05a610d60a6d177b66f9da97906efdb44336a6f (patch)
treebca0d63ddc2a8b43d22a3d1732e5497caab40f78 /storage
parentd82ac8eaafd89a6a74436747b660ef02c69eaac3 (diff)
downloadmariadb-git-a05a610d60a6d177b66f9da97906efdb44336a6f.tar.gz
Added "const" to new data for handler::update_row()
This was done to make it clear that a update_row() should not change the row. This was not done for handler::write_row() as this function still needs to update auto_increment values in the row. This should at some point be moved to handler::ha_write_row() after which write_row can also have const arguments.
Diffstat (limited to 'storage')
-rw-r--r--storage/blackhole/ha_blackhole.cc2
-rw-r--r--storage/blackhole/ha_blackhole.h2
-rw-r--r--storage/connect/ha_connect.cc6
-rw-r--r--storage/connect/ha_connect.h6
-rw-r--r--storage/csv/ha_tina.cc4
-rw-r--r--storage/csv/ha_tina.h4
-rw-r--r--storage/example/ha_example.cc2
-rw-r--r--storage/example/ha_example.h2
-rw-r--r--storage/federated/ha_federated.cc2
-rw-r--r--storage/federated/ha_federated.h2
-rw-r--r--storage/federatedx/ha_federatedx.cc2
-rw-r--r--storage/federatedx/ha_federatedx.h2
-rw-r--r--storage/heap/ha_heap.cc2
-rw-r--r--storage/heap/ha_heap.h2
-rw-r--r--storage/innobase/handler/ha_innodb.cc4
-rw-r--r--storage/innobase/handler/ha_innodb.h2
-rw-r--r--storage/maria/ha_maria.cc2
-rw-r--r--storage/maria/ha_maria.h2
-rw-r--r--storage/maria/ma_unique.c6
-rw-r--r--storage/maria/ma_update.c3
-rw-r--r--storage/maria/maria_def.h2
-rw-r--r--storage/mroonga/ha_mroonga.cpp20
-rw-r--r--storage/mroonga/ha_mroonga.hpp21
-rw-r--r--storage/myisam/ha_myisam.cc2
-rw-r--r--storage/myisam/ha_myisam.h2
-rw-r--r--storage/myisam/mi_unique.c5
-rw-r--r--storage/myisam/mi_update.c3
-rw-r--r--storage/myisam/myisamdef.h2
-rw-r--r--storage/myisammrg/ha_myisammrg.cc2
-rw-r--r--storage/myisammrg/ha_myisammrg.h2
-rw-r--r--storage/myisammrg/myrg_update.c3
-rw-r--r--storage/oqgraph/ha_oqgraph.cc2
-rw-r--r--storage/oqgraph/ha_oqgraph.h2
-rw-r--r--storage/perfschema/ha_perfschema.cc2
-rw-r--r--storage/perfschema/ha_perfschema.h2
-rw-r--r--storage/perfschema/pfs_engine_table.cc4
-rw-r--r--storage/perfschema/pfs_engine_table.h4
-rw-r--r--storage/perfschema/table_setup_actors.cc2
-rw-r--r--storage/perfschema/table_setup_actors.h2
-rw-r--r--storage/perfschema/table_setup_consumers.cc2
-rw-r--r--storage/perfschema/table_setup_consumers.h2
-rw-r--r--storage/perfschema/table_setup_instruments.cc2
-rw-r--r--storage/perfschema/table_setup_instruments.h2
-rw-r--r--storage/perfschema/table_setup_objects.cc2
-rw-r--r--storage/perfschema/table_setup_objects.h2
-rw-r--r--storage/perfschema/table_setup_timers.cc2
-rw-r--r--storage/perfschema/table_setup_timers.h2
-rw-r--r--storage/perfschema/table_threads.cc2
-rw-r--r--storage/perfschema/table_threads.h2
-rw-r--r--storage/rocksdb/ha_rocksdb.cc3
-rw-r--r--storage/rocksdb/ha_rocksdb.h2
-rw-r--r--storage/rocksdb/rdb_datadic.h1
-rw-r--r--storage/sphinx/ha_sphinx.cc2
-rw-r--r--storage/sphinx/ha_sphinx.h2
-rw-r--r--storage/spider/ha_spider.cc6
-rw-r--r--storage/spider/ha_spider.h6
-rw-r--r--storage/tokudb/ha_tokudb.cc4
-rw-r--r--storage/tokudb/ha_tokudb.h4
-rw-r--r--storage/xtradb/handler/ha_innodb.cc2
-rw-r--r--storage/xtradb/handler/ha_innodb.h2
60 files changed, 106 insertions, 91 deletions
diff --git a/storage/blackhole/ha_blackhole.cc b/storage/blackhole/ha_blackhole.cc
index 56d8000d64d..ed9b03dc82b 100644
--- a/storage/blackhole/ha_blackhole.cc
+++ b/storage/blackhole/ha_blackhole.cc
@@ -105,7 +105,7 @@ int ha_blackhole::write_row(uchar * buf)
DBUG_RETURN(table->next_number_field ? update_auto_increment() : 0);
}
-int ha_blackhole::update_row(const uchar *old_data, uchar *new_data)
+int ha_blackhole::update_row(const uchar *old_data, const uchar *new_data)
{
DBUG_ENTER("ha_blackhole::update_row");
THD *thd= ha_thd();
diff --git a/storage/blackhole/ha_blackhole.h b/storage/blackhole/ha_blackhole.h
index b70320848d7..9a4b34809f8 100644
--- a/storage/blackhole/ha_blackhole.h
+++ b/storage/blackhole/ha_blackhole.h
@@ -97,6 +97,6 @@ public:
enum thr_lock_type lock_type);
private:
virtual int write_row(uchar *buf);
- virtual int update_row(const uchar *old_data, uchar *new_data);
+ virtual int update_row(const uchar *old_data, const uchar *new_data);
virtual int delete_row(const uchar *buf);
};
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc
index f2727ba15f7..e655655fb9c 100644
--- a/storage/connect/ha_connect.cc
+++ b/storage/connect/ha_connect.cc
@@ -2097,7 +2097,7 @@ int ha_connect::MakeRecord(char *buf)
/***********************************************************************/
/* Set row values from a MySQL pseudo record. Specific to MySQL. */
/***********************************************************************/
-int ha_connect::ScanRecord(PGLOBAL g, uchar *)
+int ha_connect::ScanRecord(PGLOBAL g, const uchar *)
{
char attr_buffer[1024];
char data_buffer[1024];
@@ -2239,7 +2239,7 @@ int ha_connect::ScanRecord(PGLOBAL g, uchar *)
/* Check change in index column. Specific to MySQL. */
/* Should be elaborated to check for real changes. */
/***********************************************************************/
-int ha_connect::CheckRecord(PGLOBAL g, const uchar *, uchar *newbuf)
+int ha_connect::CheckRecord(PGLOBAL g, const uchar *, const uchar *newbuf)
{
return ScanRecord(g, newbuf);
} // end of dummy CheckRecord
@@ -3417,7 +3417,7 @@ int ha_connect::write_row(uchar *buf)
@see
sql_select.cc, sql_acl.cc, sql_update.cc and sql_insert.cc
*/
-int ha_connect::update_row(const uchar *old_data, uchar *new_data)
+int ha_connect::update_row(const uchar *old_data, const uchar *new_data)
{
int rc= 0;
PGLOBAL& g= xp->g;
diff --git a/storage/connect/ha_connect.h b/storage/connect/ha_connect.h
index cb15d371b5c..4757f6edfe1 100644
--- a/storage/connect/ha_connect.h
+++ b/storage/connect/ha_connect.h
@@ -206,8 +206,8 @@ public:
bool IsOpened(void);
int CloseTable(PGLOBAL g);
int MakeRecord(char *buf);
- int ScanRecord(PGLOBAL g, uchar *buf);
- int CheckRecord(PGLOBAL g, const uchar *oldbuf, uchar *newbuf);
+ int ScanRecord(PGLOBAL g, const uchar *buf);
+ int CheckRecord(PGLOBAL g, const uchar *oldbuf, const uchar *newbuf);
int ReadIndexed(uchar *buf, OPVAL op, const key_range *kr= NULL);
bool IsIndexed(Field *fp);
bool MakeKeyWhere(PGLOBAL g, PSTRG qry, OPVAL op, char q,
@@ -388,7 +388,7 @@ PFIL CondFilter(PGLOBAL g, Item *cond);
We implement this in ha_connect.cc. It's not an obligatory method;
skip it and and MySQL will treat it as not implemented.
*/
- int update_row(const uchar *old_data, uchar *new_data);
+ int update_row(const uchar *old_data, const uchar *new_data);
/** @brief
We implement this in ha_connect.cc. It's not an obligatory method;
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index 308e6f12d73..363fb993fe7 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -519,7 +519,7 @@ ha_tina::ha_tina(handlerton *hton, TABLE_SHARE *table_arg)
Encode a buffer into the quoted format.
*/
-int ha_tina::encode_quote(uchar *buf)
+int ha_tina::encode_quote(const uchar *buf)
{
char attribute_buffer[1024];
String attribute(attribute_buffer, sizeof(attribute_buffer),
@@ -1063,7 +1063,7 @@ int ha_tina::open_update_temp_file_if_needed()
This will be called in a table scan right before the previous ::rnd_next()
call.
*/
-int ha_tina::update_row(const uchar * old_data, uchar * new_data)
+int ha_tina::update_row(const uchar * old_data, const uchar * new_data)
{
int size;
int rc= -1;
diff --git a/storage/csv/ha_tina.h b/storage/csv/ha_tina.h
index 127c6053a53..c75a64faa52 100644
--- a/storage/csv/ha_tina.h
+++ b/storage/csv/ha_tina.h
@@ -137,7 +137,7 @@ public:
int open(const char *name, int mode, uint open_options);
int close(void);
int write_row(uchar * buf);
- int update_row(const uchar * old_data, uchar * new_data);
+ int update_row(const uchar * old_data, const uchar * new_data);
int delete_row(const uchar * buf);
int rnd_init(bool scan=1);
int rnd_next(uchar *buf);
@@ -173,7 +173,7 @@ public:
void update_status();
/* The following methods were added just for TINA */
- int encode_quote(uchar *buf);
+ int encode_quote(const uchar *buf);
int find_current_row(uchar *buf);
int chain_append();
};
diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc
index 3a5b269e79f..13062c0bf7c 100644
--- a/storage/example/ha_example.cc
+++ b/storage/example/ha_example.cc
@@ -431,7 +431,7 @@ int ha_example::write_row(uchar *buf)
@see
sql_select.cc, sql_acl.cc, sql_update.cc and sql_insert.cc
*/
-int ha_example::update_row(const uchar *old_data, uchar *new_data)
+int ha_example::update_row(const uchar *old_data, const uchar *new_data)
{
DBUG_ENTER("ha_example::update_row");
diff --git a/storage/example/ha_example.h b/storage/example/ha_example.h
index 2d3d0c81ed9..3a9654bbb7b 100644
--- a/storage/example/ha_example.h
+++ b/storage/example/ha_example.h
@@ -186,7 +186,7 @@ public:
We implement this in ha_example.cc. It's not an obligatory method;
skip it and and MySQL will treat it as not implemented.
*/
- int update_row(const uchar *old_data, uchar *new_data);
+ int update_row(const uchar *old_data, const uchar *new_data);
/** @brief
We implement this in ha_example.cc. It's not an obligatory method;
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc
index 879a17782aa..b4b781ca534 100644
--- a/storage/federated/ha_federated.cc
+++ b/storage/federated/ha_federated.cc
@@ -2125,7 +2125,7 @@ int ha_federated::repair(THD* thd, HA_CHECK_OPT* check_opt)
Called from sql_select.cc, sql_acl.cc, sql_update.cc, and sql_insert.cc.
*/
-int ha_federated::update_row(const uchar *old_data, uchar *new_data)
+int ha_federated::update_row(const uchar *old_data, const uchar *new_data)
{
/*
This used to control how the query was built. If there was a
diff --git a/storage/federated/ha_federated.h b/storage/federated/ha_federated.h
index a23375cbe58..e264258a63a 100644
--- a/storage/federated/ha_federated.h
+++ b/storage/federated/ha_federated.h
@@ -210,7 +210,7 @@ public:
void start_bulk_insert(ha_rows rows, uint flags);
int end_bulk_insert();
int write_row(uchar *buf);
- int update_row(const uchar *old_data, uchar *new_data);
+ int update_row(const uchar *old_data, const uchar *new_data);
int delete_row(const uchar *buf);
int index_init(uint keynr, bool sorted);
ha_rows estimate_rows_upper_bound();
diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc
index e3506e1a4df..a7b1edd0086 100644
--- a/storage/federatedx/ha_federatedx.cc
+++ b/storage/federatedx/ha_federatedx.cc
@@ -2276,7 +2276,7 @@ int ha_federatedx::repair(THD* thd, HA_CHECK_OPT* check_opt)
Called from sql_select.cc, sql_acl.cc, sql_update.cc, and sql_insert.cc.
*/
-int ha_federatedx::update_row(const uchar *old_data, uchar *new_data)
+int ha_federatedx::update_row(const uchar *old_data, const uchar *new_data)
{
/*
This used to control how the query was built. If there was a
diff --git a/storage/federatedx/ha_federatedx.h b/storage/federatedx/ha_federatedx.h
index 2c2c6eef26b..759ddfdfe71 100644
--- a/storage/federatedx/ha_federatedx.h
+++ b/storage/federatedx/ha_federatedx.h
@@ -394,7 +394,7 @@ public:
void start_bulk_insert(ha_rows rows, uint flags);
int end_bulk_insert();
int write_row(uchar *buf);
- int update_row(const uchar *old_data, uchar *new_data);
+ int update_row(const uchar *old_data, const uchar *new_data);
int delete_row(const uchar *buf);
int index_init(uint keynr, bool sorted);
ha_rows estimate_rows_upper_bound();
diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc
index e87c878d11b..ef6530e98e1 100644
--- a/storage/heap/ha_heap.cc
+++ b/storage/heap/ha_heap.cc
@@ -251,7 +251,7 @@ int ha_heap::write_row(uchar * buf)
return res;
}
-int ha_heap::update_row(const uchar * old_data, uchar * new_data)
+int ha_heap::update_row(const uchar * old_data, const uchar * new_data)
{
int res;
res= heap_update(file,old_data,new_data);
diff --git a/storage/heap/ha_heap.h b/storage/heap/ha_heap.h
index 6443ff55646..e17c18c8b14 100644
--- a/storage/heap/ha_heap.h
+++ b/storage/heap/ha_heap.h
@@ -71,7 +71,7 @@ public:
int close(void);
void set_keys_for_scanning(void);
int write_row(uchar * buf);
- int update_row(const uchar * old_data, uchar * new_data);
+ int update_row(const uchar * old_data, const uchar * new_data);
int delete_row(const uchar * buf);
virtual void get_auto_increment(ulonglong offset, ulonglong increment,
ulonglong nb_desired_values,
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 789765dfe34..b351ac00c1a 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -8974,7 +8974,7 @@ dberr_t
calc_row_difference(
upd_t* uvect,
const uchar* old_row,
- uchar* new_row,
+ const uchar* new_row,
TABLE* table,
uchar* upd_buff,
ulint buff_len,
@@ -9470,7 +9470,7 @@ if its index columns are updated!
int
ha_innobase::update_row(
const uchar* old_row,
- uchar* new_row)
+ const uchar* new_row)
{
int err;
diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h
index 463717ee6b2..429c6eb0b86 100644
--- a/storage/innobase/handler/ha_innodb.h
+++ b/storage/innobase/handler/ha_innodb.h
@@ -138,7 +138,7 @@ public:
int write_row(uchar * buf);
- int update_row(const uchar * old_data, uchar * new_data);
+ int update_row(const uchar * old_data, const uchar * new_data);
int delete_row(const uchar * buf);
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index 86bb49c5625..adf32b4f68c 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -2311,7 +2311,7 @@ bool ha_maria::is_crashed() const
} \
} while(0)
-int ha_maria::update_row(const uchar * old_data, uchar * new_data)
+int ha_maria::update_row(const uchar * old_data, const uchar * new_data)
{
CHECK_UNTIL_WE_FULLY_IMPLEMENTED_VERSIONING("UPDATE in WRITE CONCURRENT");
return maria_update(file, old_data, new_data);
diff --git a/storage/maria/ha_maria.h b/storage/maria/ha_maria.h
index 58d13ca3cf4..49ee2afc827 100644
--- a/storage/maria/ha_maria.h
+++ b/storage/maria/ha_maria.h
@@ -75,7 +75,7 @@ public:
int open(const char *name, int mode, uint test_if_locked);
int close(void);
int write_row(uchar * buf);
- int update_row(const uchar * old_data, uchar * new_data);
+ int update_row(const uchar * old_data, const uchar * new_data);
int delete_row(const uchar * buf);
int index_read_map(uchar * buf, const uchar * key, key_part_map keypart_map,
enum ha_rkey_function find_flag);
diff --git a/storage/maria/ma_unique.c b/storage/maria/ma_unique.c
index 72104e25e3f..dfbb471f31e 100644
--- a/storage/maria/ma_unique.c
+++ b/storage/maria/ma_unique.c
@@ -27,8 +27,9 @@
isn't any versioning information.
*/
-my_bool _ma_check_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def, uchar *record,
- ha_checksum unique_hash, my_off_t disk_pos)
+my_bool _ma_check_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def,
+ const uchar *record,
+ ha_checksum unique_hash, my_off_t disk_pos)
{
my_off_t lastpos=info->cur_row.lastpos;
MARIA_KEYDEF *keyinfo= &info->s->keyinfo[def->key];
@@ -38,6 +39,7 @@ my_bool _ma_check_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def, uchar *record,
DBUG_ENTER("_ma_check_unique");
DBUG_PRINT("enter",("unique_hash: %lu", (ulong) unique_hash));
+ /* We need to store the hash value as a key in the record, breaking const */
maria_unique_store(record+keyinfo->seg->start, unique_hash);
/* Can't be spatial so it's ok to call _ma_make_key directly here */
_ma_make_key(info, &key, def->key, key_buff, record, 0, 0);
diff --git a/storage/maria/ma_update.c b/storage/maria/ma_update.c
index 0e006d2473d..6e150f727d6 100644
--- a/storage/maria/ma_update.c
+++ b/storage/maria/ma_update.c
@@ -21,7 +21,8 @@
Update an old row in a MARIA table
*/
-int maria_update(register MARIA_HA *info, const uchar *oldrec, uchar *newrec)
+int maria_update(register MARIA_HA *info, const uchar *oldrec,
+ const uchar *newrec)
{
int flag,key_changed,save_errno;
reg3 my_off_t pos;
diff --git a/storage/maria/maria_def.h b/storage/maria/maria_def.h
index 8664157a65a..0e33f1c938d 100644
--- a/storage/maria/maria_def.h
+++ b/storage/maria/maria_def.h
@@ -1323,7 +1323,7 @@ ulong _ma_calc_total_blob_length(MARIA_HA *info, const uchar *record);
ha_checksum _ma_checksum(MARIA_HA *info, const uchar *buf);
ha_checksum _ma_static_checksum(MARIA_HA *info, const uchar *buf);
my_bool _ma_check_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def,
- uchar *record, ha_checksum unique_hash,
+ const uchar *record, ha_checksum unique_hash,
MARIA_RECORD_POS pos);
ha_checksum _ma_unique_hash(MARIA_UNIQUEDEF *def, const uchar *buf);
my_bool _ma_cmp_static_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def,
diff --git a/storage/mroonga/ha_mroonga.cpp b/storage/mroonga/ha_mroonga.cpp
index 27a3e7b3294..ba3d910f936 100644
--- a/storage/mroonga/ha_mroonga.cpp
+++ b/storage/mroonga/ha_mroonga.cpp
@@ -5674,7 +5674,7 @@ err:
DBUG_RETURN(error);
}
-int ha_mroonga::storage_write_row_unique_index(uchar *buf,
+int ha_mroonga::storage_write_row_unique_index(const uchar *buf,
KEY *key_info,
grn_obj *index_table,
grn_obj *index_column,
@@ -5856,7 +5856,8 @@ int ha_mroonga::wrapper_get_record_id(uchar *data, grn_id *record_id,
DBUG_RETURN(error);
}
-int ha_mroonga::wrapper_update_row(const uchar *old_data, uchar *new_data)
+int ha_mroonga::wrapper_update_row(const uchar *old_data,
+ const uchar *new_data)
{
MRN_DBUG_ENTER_METHOD();
@@ -5877,7 +5878,8 @@ int ha_mroonga::wrapper_update_row(const uchar *old_data, uchar *new_data)
DBUG_RETURN(error);
}
-int ha_mroonga::wrapper_update_row_index(const uchar *old_data, uchar *new_data)
+int ha_mroonga::wrapper_update_row_index(const uchar *old_data,
+ const uchar *new_data)
{
MRN_DBUG_ENTER_METHOD();
@@ -5989,7 +5991,8 @@ err:
DBUG_RETURN(error);
}
-int ha_mroonga::storage_update_row(const uchar *old_data, uchar *new_data)
+int ha_mroonga::storage_update_row(const uchar *old_data,
+ const uchar *new_data)
{
MRN_DBUG_ENTER_METHOD();
int error = 0;
@@ -6152,7 +6155,8 @@ err:
DBUG_RETURN(error);
}
-int ha_mroonga::storage_update_row_index(const uchar *old_data, uchar *new_data)
+int ha_mroonga::storage_update_row_index(const uchar *old_data,
+ const uchar *new_data)
{
MRN_DBUG_ENTER_METHOD();
int error = 0;
@@ -6244,7 +6248,7 @@ err:
DBUG_RETURN(error);
}
-int ha_mroonga::storage_update_row_unique_indexes(uchar *new_data)
+int ha_mroonga::storage_update_row_unique_indexes(const uchar *new_data)
{
int error;
uint i;
@@ -6321,7 +6325,7 @@ err:
DBUG_RETURN(error);
}
-int ha_mroonga::update_row(const uchar *old_data, uchar *new_data)
+int ha_mroonga::update_row(const uchar *old_data, const uchar *new_data)
{
MRN_DBUG_ENTER_METHOD();
int error = 0;
@@ -11015,7 +11019,7 @@ void ha_mroonga::storage_store_fields(uchar *buf, grn_id record_id)
}
void ha_mroonga::storage_store_fields_for_prep_update(const uchar *old_data,
- uchar *new_data,
+ const uchar *new_data,
grn_id record_id)
{
MRN_DBUG_ENTER_METHOD();
diff --git a/storage/mroonga/ha_mroonga.hpp b/storage/mroonga/ha_mroonga.hpp
index 37059210dd1..579107f9465 100644
--- a/storage/mroonga/ha_mroonga.hpp
+++ b/storage/mroonga/ha_mroonga.hpp
@@ -384,7 +384,7 @@ public:
int delete_table(const char *name);
int write_row(uchar *buf);
- int update_row(const uchar *old_data, uchar *new_data);
+ int update_row(const uchar *old_data, const uchar *new_data);
int delete_row(const uchar *buf);
uint max_supported_record_length() const;
@@ -692,7 +692,7 @@ private:
int nth_column, grn_id record_id);
void storage_store_fields(uchar *buf, grn_id record_id);
void storage_store_fields_for_prep_update(const uchar *old_data,
- uchar *new_data,
+ const uchar *new_data,
grn_id record_id);
void storage_store_fields_by_index(uchar *buf);
@@ -827,18 +827,21 @@ private:
KEY *key_info,
grn_obj *index_column);
int storage_write_row_multiple_column_indexes(uchar *buf, grn_id record_id);
- int storage_write_row_unique_index(uchar *buf,
+ int storage_write_row_unique_index(const uchar *buf,
KEY *key_info,
grn_obj *index_table,
grn_obj *index_column,
grn_id *key_id);
int storage_write_row_unique_indexes(uchar *buf);
- int wrapper_get_record_id(uchar *data, grn_id *record_id, const char *context);
- int wrapper_update_row(const uchar *old_data, uchar *new_data);
- int wrapper_update_row_index(const uchar *old_data, uchar *new_data);
- int storage_update_row(const uchar *old_data, uchar *new_data);
- int storage_update_row_index(const uchar *old_data, uchar *new_data);
- int storage_update_row_unique_indexes(uchar *new_data);
+ int wrapper_get_record_id(uchar *data, grn_id *record_id,
+ const char *context);
+ int wrapper_update_row(const uchar *old_data, const uchar *new_data);
+ int wrapper_update_row_index(const uchar *old_data,
+ const uchar *new_data);
+ int storage_update_row(const uchar *old_data, const uchar *new_data);
+ int storage_update_row_index(const uchar *old_data,
+ const uchar *new_data);
+ int storage_update_row_unique_indexes(const uchar *new_data);
int wrapper_delete_row(const uchar *buf);
int wrapper_delete_row_index(const uchar *buf);
int storage_delete_row(const uchar *buf);
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 9a0d3ab7b5f..99073a2caa1 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -1779,7 +1779,7 @@ bool ha_myisam::is_crashed() const
(my_disable_locking && file->s->state.open_count));
}
-int ha_myisam::update_row(const uchar *old_data, uchar *new_data)
+int ha_myisam::update_row(const uchar *old_data, const uchar *new_data)
{
return mi_update(file,old_data,new_data);
}
diff --git a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h
index 4068720e39e..531c96baacc 100644
--- a/storage/myisam/ha_myisam.h
+++ b/storage/myisam/ha_myisam.h
@@ -71,7 +71,7 @@ class ha_myisam: public handler
int open(const char *name, int mode, uint test_if_locked);
int close(void);
int write_row(uchar * buf);
- int update_row(const uchar * old_data, uchar * new_data);
+ int update_row(const uchar * old_data, const uchar * new_data);
int delete_row(const uchar * buf);
int index_read_map(uchar *buf, const uchar *key, key_part_map keypart_map,
enum ha_rkey_function find_flag);
diff --git a/storage/myisam/mi_unique.c b/storage/myisam/mi_unique.c
index dae453beaec..371c1a7fd6c 100644
--- a/storage/myisam/mi_unique.c
+++ b/storage/myisam/mi_unique.c
@@ -19,7 +19,7 @@
#include "myisamdef.h"
#include <m_ctype.h>
-my_bool mi_check_unique(MI_INFO *info, MI_UNIQUEDEF *def, uchar *record,
+my_bool mi_check_unique(MI_INFO *info, MI_UNIQUEDEF *def, const uchar *record,
ha_checksum unique_hash, my_off_t disk_pos)
{
my_off_t lastpos=info->lastpos;
@@ -27,7 +27,8 @@ my_bool mi_check_unique(MI_INFO *info, MI_UNIQUEDEF *def, uchar *record,
uchar *key_buff=info->lastkey2;
DBUG_ENTER("mi_check_unique");
- mi_unique_store(record+key->seg->start, unique_hash);
+ /* We need to store the hash value as a key in the record, breaking const */
+ mi_unique_store(((uchar*) record)+key->seg->start, unique_hash);
_mi_make_key(info,def->key,key_buff,record,0);
/* The above changed info->lastkey2. Inform mi_rnext_same(). */
diff --git a/storage/myisam/mi_update.c b/storage/myisam/mi_update.c
index b75bd4bf2aa..459ce0eade3 100644
--- a/storage/myisam/mi_update.c
+++ b/storage/myisam/mi_update.c
@@ -19,7 +19,8 @@
#include "fulltext.h"
#include "rt_index.h"
-int mi_update(register MI_INFO *info, const uchar *oldrec, uchar *newrec)
+int mi_update(register MI_INFO *info, const uchar *oldrec,
+ const uchar *newrec)
{
int flag,key_changed,save_errno;
reg3 my_off_t pos;
diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h
index ff12cb53dd9..0d718f0a22e 100644
--- a/storage/myisam/myisamdef.h
+++ b/storage/myisam/myisamdef.h
@@ -696,7 +696,7 @@ extern int mi_indexes_are_disabled(MI_INFO *info);
ulong _mi_calc_total_blob_length(MI_INFO *info, const uchar *record);
ha_checksum mi_checksum(MI_INFO *info, const uchar *buf);
ha_checksum mi_static_checksum(MI_INFO *info, const uchar *buf);
-my_bool mi_check_unique(MI_INFO *info, MI_UNIQUEDEF *def, uchar *record,
+my_bool mi_check_unique(MI_INFO *info, MI_UNIQUEDEF *def, const uchar *record,
ha_checksum unique_hash, my_off_t pos);
ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const uchar *buf);
int _mi_cmp_static_unique(MI_INFO *info, MI_UNIQUEDEF *def,
diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc
index 3d91aa67793..8f4997cf795 100644
--- a/storage/myisammrg/ha_myisammrg.cc
+++ b/storage/myisammrg/ha_myisammrg.cc
@@ -1104,7 +1104,7 @@ int ha_myisammrg::write_row(uchar * buf)
DBUG_RETURN(myrg_write(file,buf));
}
-int ha_myisammrg::update_row(const uchar * old_data, uchar * new_data)
+int ha_myisammrg::update_row(const uchar * old_data, const uchar * new_data)
{
DBUG_ASSERT(this->file->children_attached);
return myrg_update(file,old_data,new_data);
diff --git a/storage/myisammrg/ha_myisammrg.h b/storage/myisammrg/ha_myisammrg.h
index b6db549119d..6ace880ab99 100644
--- a/storage/myisammrg/ha_myisammrg.h
+++ b/storage/myisammrg/ha_myisammrg.h
@@ -112,7 +112,7 @@ public:
virtual handler *clone(const char *name, MEM_ROOT *mem_root);
int close(void);
int write_row(uchar * buf);
- int update_row(const uchar * old_data, uchar * new_data);
+ int update_row(const uchar * old_data, const uchar * new_data);
int delete_row(const uchar * buf);
int index_read_map(uchar *buf, const uchar *key, key_part_map keypart_map,
enum ha_rkey_function find_flag);
diff --git a/storage/myisammrg/myrg_update.c b/storage/myisammrg/myrg_update.c
index add6f9f819b..fd28b2699e9 100644
--- a/storage/myisammrg/myrg_update.c
+++ b/storage/myisammrg/myrg_update.c
@@ -18,7 +18,8 @@
#include "myrg_def.h"
-int myrg_update(register MYRG_INFO *info,const uchar *oldrec, uchar *newrec)
+int myrg_update(register MYRG_INFO *info,const uchar *oldrec,
+ const uchar *newrec)
{
if (!info->current_table)
return (my_errno=HA_ERR_NO_ACTIVE_RECORD);
diff --git a/storage/oqgraph/ha_oqgraph.cc b/storage/oqgraph/ha_oqgraph.cc
index 66a20e9a6a1..2380ab8157e 100644
--- a/storage/oqgraph/ha_oqgraph.cc
+++ b/storage/oqgraph/ha_oqgraph.cc
@@ -803,7 +803,7 @@ int ha_oqgraph::write_row(byte * buf)
return HA_ERR_TABLE_READONLY;
}
-int ha_oqgraph::update_row(const byte * old, byte * buf)
+int ha_oqgraph::update_row(const uchar * old, const uchar * buf)
{
return HA_ERR_TABLE_READONLY;
}
diff --git a/storage/oqgraph/ha_oqgraph.h b/storage/oqgraph/ha_oqgraph.h
index 07f47bd1239..ad0cdd61256 100644
--- a/storage/oqgraph/ha_oqgraph.h
+++ b/storage/oqgraph/ha_oqgraph.h
@@ -84,7 +84,7 @@ public:
int open(const char *name, int mode, uint test_if_locked);
int close(void);
int write_row(byte * buf);
- int update_row(const byte * old_data, byte * new_data);
+ int update_row(const uchar * old_data, const uchar * new_data);
int delete_row(const byte * buf);
int index_read(byte * buf, const byte * key,
uint key_len, enum ha_rkey_function find_flag);
diff --git a/storage/perfschema/ha_perfschema.cc b/storage/perfschema/ha_perfschema.cc
index 598fc1061d8..0ee08238318 100644
--- a/storage/perfschema/ha_perfschema.cc
+++ b/storage/perfschema/ha_perfschema.cc
@@ -286,7 +286,7 @@ void ha_perfschema::use_hidden_primary_key(void)
table->column_bitmaps_set_no_signal(&table->s->all_set, table->write_set);
}
-int ha_perfschema::update_row(const uchar *old_data, uchar *new_data)
+int ha_perfschema::update_row(const uchar *old_data, const uchar *new_data)
{
DBUG_ENTER("ha_perfschema::update_row");
if (!pfs_initialized)
diff --git a/storage/perfschema/ha_perfschema.h b/storage/perfschema/ha_perfschema.h
index ff87b1fd665..62996e12fe0 100644
--- a/storage/perfschema/ha_perfschema.h
+++ b/storage/perfschema/ha_perfschema.h
@@ -130,7 +130,7 @@ public:
@param new_data the row new values
@return 0 on success
*/
- int update_row(const uchar *old_data, uchar *new_data);
+ int update_row(const uchar *old_data, const uchar *new_data);
/**
Delete a row.
diff --git a/storage/perfschema/pfs_engine_table.cc b/storage/perfschema/pfs_engine_table.cc
index 9e9ab02df46..579d3ccd74e 100644
--- a/storage/perfschema/pfs_engine_table.cc
+++ b/storage/perfschema/pfs_engine_table.cc
@@ -284,7 +284,7 @@ int PFS_engine_table::read_row(TABLE *table,
*/
int PFS_engine_table::update_row(TABLE *table,
const unsigned char *old_buf,
- unsigned char *new_buf,
+ const unsigned char *new_buf,
Field **fields)
{
my_bitmap_map *org_bitmap;
@@ -428,7 +428,7 @@ PFS_engine_table::get_field_varchar_utf8(Field *f, String *val)
int PFS_engine_table::update_row_values(TABLE *,
const unsigned char *,
- unsigned char *,
+ const unsigned char *,
Field **)
{
return HA_ERR_WRONG_COMMAND;
diff --git a/storage/perfschema/pfs_engine_table.h b/storage/perfschema/pfs_engine_table.h
index 2bbf8891420..bae27172810 100644
--- a/storage/perfschema/pfs_engine_table.h
+++ b/storage/perfschema/pfs_engine_table.h
@@ -46,7 +46,7 @@ public:
int read_row(TABLE *table, unsigned char *buf, Field **fields);
int update_row(TABLE *table, const unsigned char *old_buf,
- unsigned char *new_buf, Field **fields);
+ const unsigned char *new_buf, Field **fields);
/**
Delete a row from this table.
@@ -165,7 +165,7 @@ protected:
@param fields Table fields
*/
virtual int update_row_values(TABLE *table, const unsigned char *old_buf,
- unsigned char *new_buf, Field **fields);
+ const unsigned char *new_buf, Field **fields);
/**
Delete a row.
diff --git a/storage/perfschema/table_setup_actors.cc b/storage/perfschema/table_setup_actors.cc
index c82d67fba2d..bf6006057df 100644
--- a/storage/perfschema/table_setup_actors.cc
+++ b/storage/perfschema/table_setup_actors.cc
@@ -217,7 +217,7 @@ int table_setup_actors::read_row_values(TABLE *table,
int table_setup_actors::update_row_values(TABLE *table,
const unsigned char *old_buf,
- unsigned char *new_buf,
+ const unsigned char *new_buf,
Field **fields)
{
Field *f;
diff --git a/storage/perfschema/table_setup_actors.h b/storage/perfschema/table_setup_actors.h
index 2a9395dfac7..66379593cc5 100644
--- a/storage/perfschema/table_setup_actors.h
+++ b/storage/perfschema/table_setup_actors.h
@@ -71,7 +71,7 @@ protected:
virtual int update_row_values(TABLE *table,
const unsigned char *old_buf,
- unsigned char *new_buf,
+ const unsigned char *new_buf,
Field **fields);
virtual int delete_row_values(TABLE *table,
diff --git a/storage/perfschema/table_setup_consumers.cc b/storage/perfschema/table_setup_consumers.cc
index c09853ffeca..f3529eb8846 100644
--- a/storage/perfschema/table_setup_consumers.cc
+++ b/storage/perfschema/table_setup_consumers.cc
@@ -190,7 +190,7 @@ int table_setup_consumers::read_row_values(TABLE *table,
int table_setup_consumers::update_row_values(TABLE *table,
const unsigned char *,
- unsigned char *,
+ const unsigned char *,
Field **fields)
{
Field *f;
diff --git a/storage/perfschema/table_setup_consumers.h b/storage/perfschema/table_setup_consumers.h
index e59033c0ad1..f5a386829a1 100644
--- a/storage/perfschema/table_setup_consumers.h
+++ b/storage/perfschema/table_setup_consumers.h
@@ -60,7 +60,7 @@ protected:
virtual int update_row_values(TABLE *table,
const unsigned char *old_buf,
- unsigned char *new_buf,
+ const unsigned char *new_buf,
Field **fields);
table_setup_consumers();
diff --git a/storage/perfschema/table_setup_instruments.cc b/storage/perfschema/table_setup_instruments.cc
index d911128ce94..f5ac1cafe63 100644
--- a/storage/perfschema/table_setup_instruments.cc
+++ b/storage/perfschema/table_setup_instruments.cc
@@ -217,7 +217,7 @@ int table_setup_instruments::read_row_values(TABLE *table,
int table_setup_instruments::update_row_values(TABLE *table,
const unsigned char *,
- unsigned char *,
+ const unsigned char *,
Field **fields)
{
Field *f;
diff --git a/storage/perfschema/table_setup_instruments.h b/storage/perfschema/table_setup_instruments.h
index 2e70a528bbd..dfe9070721b 100644
--- a/storage/perfschema/table_setup_instruments.h
+++ b/storage/perfschema/table_setup_instruments.h
@@ -92,7 +92,7 @@ protected:
virtual int update_row_values(TABLE *table,
const unsigned char *old_buf,
- unsigned char *new_buf,
+ const unsigned char *new_buf,
Field **fields);
table_setup_instruments();
diff --git a/storage/perfschema/table_setup_objects.cc b/storage/perfschema/table_setup_objects.cc
index 5321271a62d..994622f4a52 100644
--- a/storage/perfschema/table_setup_objects.cc
+++ b/storage/perfschema/table_setup_objects.cc
@@ -265,7 +265,7 @@ int table_setup_objects::read_row_values(TABLE *table,
int table_setup_objects::update_row_values(TABLE *table,
const unsigned char *,
- unsigned char *,
+ const unsigned char *,
Field **fields)
{
int result;
diff --git a/storage/perfschema/table_setup_objects.h b/storage/perfschema/table_setup_objects.h
index 55423ffd90f..7fcefa45407 100644
--- a/storage/perfschema/table_setup_objects.h
+++ b/storage/perfschema/table_setup_objects.h
@@ -74,7 +74,7 @@ protected:
virtual int update_row_values(TABLE *table,
const unsigned char *old_buf,
- unsigned char *new_buf,
+ const unsigned char *new_buf,
Field **fields);
virtual int delete_row_values(TABLE *table,
diff --git a/storage/perfschema/table_setup_timers.cc b/storage/perfschema/table_setup_timers.cc
index 911fa121e06..9c6af49595d 100644
--- a/storage/perfschema/table_setup_timers.cc
+++ b/storage/perfschema/table_setup_timers.cc
@@ -145,7 +145,7 @@ int table_setup_timers::read_row_values(TABLE *table,
int table_setup_timers::update_row_values(TABLE *table,
const unsigned char *,
- unsigned char *,
+ const unsigned char *,
Field **fields)
{
Field *f;
diff --git a/storage/perfschema/table_setup_timers.h b/storage/perfschema/table_setup_timers.h
index 46af68bb9e3..f230a68af98 100644
--- a/storage/perfschema/table_setup_timers.h
+++ b/storage/perfschema/table_setup_timers.h
@@ -58,7 +58,7 @@ protected:
virtual int update_row_values(TABLE *table,
const unsigned char *old_buf,
- unsigned char *new_buf,
+ const unsigned char *new_buf,
Field **fields);
table_setup_timers();
diff --git a/storage/perfschema/table_threads.cc b/storage/perfschema/table_threads.cc
index 5c78b567b8c..7be51b2bb20 100644
--- a/storage/perfschema/table_threads.cc
+++ b/storage/perfschema/table_threads.cc
@@ -292,7 +292,7 @@ int table_threads::read_row_values(TABLE *table,
int table_threads::update_row_values(TABLE *table,
const unsigned char *old_buf,
- unsigned char *new_buf,
+ const unsigned char *new_buf,
Field **fields)
{
Field *f;
diff --git a/storage/perfschema/table_threads.h b/storage/perfschema/table_threads.h
index 10afbe14e74..fb843f5ca36 100644
--- a/storage/perfschema/table_threads.h
+++ b/storage/perfschema/table_threads.h
@@ -87,7 +87,7 @@ protected:
virtual int update_row_values(TABLE *table,
const unsigned char *old_buf,
- unsigned char *new_buf,
+ const unsigned char *new_buf,
Field **fields);
protected:
diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc
index 981acdf22b0..1344bdc497f 100644
--- a/storage/rocksdb/ha_rocksdb.cc
+++ b/storage/rocksdb/ha_rocksdb.cc
@@ -8303,7 +8303,8 @@ void ha_rocksdb::calc_updated_indexes() {
}
}
-int ha_rocksdb::update_row(const uchar *const old_data, uchar *const new_data) {
+int ha_rocksdb::update_row(const uchar *const old_data,
+ const uchar *const new_data) {
DBUG_ENTER_FUNC();
DBUG_ASSERT(old_data != nullptr);
diff --git a/storage/rocksdb/ha_rocksdb.h b/storage/rocksdb/ha_rocksdb.h
index 5852ad4e954..1ac48111636 100644
--- a/storage/rocksdb/ha_rocksdb.h
+++ b/storage/rocksdb/ha_rocksdb.h
@@ -887,7 +887,7 @@ public:
int write_row(uchar *const buf) override
MY_ATTRIBUTE((__warn_unused_result__));
- int update_row(const uchar *const old_data, uchar *const new_data) override
+ int update_row(const uchar *const old_data, const uchar *const new_data) override
MY_ATTRIBUTE((__warn_unused_result__));
int delete_row(const uchar *const buf) override
MY_ATTRIBUTE((__warn_unused_result__));
diff --git a/storage/rocksdb/rdb_datadic.h b/storage/rocksdb/rdb_datadic.h
index 2ffd3f6e8db..8742a0794a4 100644
--- a/storage/rocksdb/rdb_datadic.h
+++ b/storage/rocksdb/rdb_datadic.h
@@ -751,6 +751,7 @@ public:
interface Rdb_tables_scanner {
virtual int add_table(Rdb_tbl_def * tdef) = 0;
+ virtual ~Rdb_tables_scanner() {}
};
/*
diff --git a/storage/sphinx/ha_sphinx.cc b/storage/sphinx/ha_sphinx.cc
index 541ccf62260..d65f5ac900a 100644
--- a/storage/sphinx/ha_sphinx.cc
+++ b/storage/sphinx/ha_sphinx.cc
@@ -2457,7 +2457,7 @@ int ha_sphinx::delete_row ( const byte * )
}
-int ha_sphinx::update_row ( const byte *, byte * )
+int ha_sphinx::update_row ( const byte *, const byte * )
{
SPH_ENTER_METHOD();
SPH_RET ( HA_ERR_WRONG_COMMAND );
diff --git a/storage/sphinx/ha_sphinx.h b/storage/sphinx/ha_sphinx.h
index c310deb7060..8e6af908aab 100644
--- a/storage/sphinx/ha_sphinx.h
+++ b/storage/sphinx/ha_sphinx.h
@@ -86,7 +86,7 @@ public:
int close ();
int write_row ( byte * buf );
- int update_row ( const byte * old_data, byte * new_data );
+ int update_row ( const byte * old_data, const byte * new_data );
int delete_row ( const byte * buf );
int extra ( enum ha_extra_function op );
diff --git a/storage/spider/ha_spider.cc b/storage/spider/ha_spider.cc
index 6ded5992c79..fef18e0e652 100644
--- a/storage/spider/ha_spider.cc
+++ b/storage/spider/ha_spider.cc
@@ -9747,7 +9747,7 @@ void ha_spider::end_bulk_update(
int ha_spider::bulk_update_row(
const uchar *old_data,
- uchar *new_data,
+ const uchar *new_data,
uint *dup_key_found
) {
DBUG_ENTER("ha_spider::bulk_update_row");
@@ -9758,7 +9758,7 @@ int ha_spider::bulk_update_row(
int ha_spider::update_row(
const uchar *old_data,
- uchar *new_data
+ const uchar *new_data
) {
int error_num;
THD *thd = ha_thd();
@@ -9990,7 +9990,7 @@ int ha_spider::pre_direct_update_rows_init(
KEY_MULTI_RANGE *ranges,
uint range_count,
bool sorted,
- uchar *new_data
+ const uchar *new_data
) {
int error_num;
DBUG_ENTER("ha_spider::pre_direct_update_rows_init");
diff --git a/storage/spider/ha_spider.h b/storage/spider/ha_spider.h
index 50d890dc854..bd02e34043d 100644
--- a/storage/spider/ha_spider.h
+++ b/storage/spider/ha_spider.h
@@ -569,12 +569,12 @@ public:
void end_bulk_update();
int bulk_update_row(
const uchar *old_data,
- uchar *new_data,
+ const uchar *new_data,
uint *dup_key_found
);
int update_row(
const uchar *old_data,
- uchar *new_data
+ const uchar *new_data
);
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS
int direct_update_rows_init(
@@ -582,7 +582,7 @@ public:
KEY_MULTI_RANGE *ranges,
uint range_count,
bool sorted,
- uchar *new_data
+ const uchar *new_data
);
#ifdef HA_CAN_BULK_ACCESS
int pre_direct_update_rows_init(
diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc
index 227c8ae6b15..ceab0b29d61 100644
--- a/storage/tokudb/ha_tokudb.cc
+++ b/storage/tokudb/ha_tokudb.cc
@@ -3604,7 +3604,7 @@ cleanup:
return error;
}
-int ha_tokudb::is_val_unique(bool* is_unique, uchar* record, KEY* key_info, uint dict_index, DB_TXN* txn) {
+int ha_tokudb::is_val_unique(bool* is_unique, const uchar* record, KEY* key_info, uint dict_index, DB_TXN* txn) {
int error = 0;
bool has_null;
DBC* tmp_cursor = NULL;
@@ -4160,7 +4160,7 @@ bool ha_tokudb::key_changed(uint keynr, const uchar * old_row, const uchar * new
// 0 on success
// error otherwise
//
-int ha_tokudb::update_row(const uchar * old_row, uchar * new_row) {
+int ha_tokudb::update_row(const uchar * old_row, const uchar * new_row) {
TOKUDB_HANDLER_DBUG_ENTER("");
DBT prim_key, old_prim_key, prim_row, old_prim_row;
int UNINIT_VAR(error);
diff --git a/storage/tokudb/ha_tokudb.h b/storage/tokudb/ha_tokudb.h
index 4a7e395d0d1..d240cf1169d 100644
--- a/storage/tokudb/ha_tokudb.h
+++ b/storage/tokudb/ha_tokudb.h
@@ -708,7 +708,7 @@ private:
int create_main_dictionary(const char* name, TABLE* form, DB_TXN* txn, KEY_AND_COL_INFO* kc_info, toku_compression_method compression_method);
void trace_create_table_info(const char *name, TABLE * form);
int is_index_unique(bool* is_unique, DB_TXN* txn, DB* db, KEY* key_info, int lock_flags);
- int is_val_unique(bool* is_unique, uchar* record, KEY* key_info, uint dict_index, DB_TXN* txn);
+ int is_val_unique(bool* is_unique, const uchar* record, KEY* key_info, uint dict_index, DB_TXN* txn);
int do_uniqueness_checks(uchar* record, DB_TXN* txn, THD* thd);
void set_main_dict_put_flags(THD* thd, bool opt_eligible, uint32_t* put_flags);
int insert_row_to_main_dictionary(uchar* record, DBT* pk_key, DBT* pk_val, DB_TXN* txn);
@@ -792,7 +792,7 @@ public:
int optimize(THD * thd, HA_CHECK_OPT * check_opt);
int analyze(THD * thd, HA_CHECK_OPT * check_opt);
int write_row(uchar * buf);
- int update_row(const uchar * old_data, uchar * new_data);
+ int update_row(const uchar * old_data, const uchar * new_data);
int delete_row(const uchar * buf);
#if MYSQL_VERSION_ID >= 100000
void start_bulk_insert(ha_rows rows, uint flags);
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index 11779a66e7c..4a9cfb975fe 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -9389,7 +9389,7 @@ int
ha_innobase::update_row(
/*====================*/
const uchar* old_row, /*!< in: old row in MySQL format */
- uchar* new_row) /*!< in: new row in MySQL format */
+ const uchar* new_row) /*!< in: new row in MySQL format */
{
upd_t* uvect;
dberr_t error;
diff --git a/storage/xtradb/handler/ha_innodb.h b/storage/xtradb/handler/ha_innodb.h
index 62b80c492a1..d1ec566b043 100644
--- a/storage/xtradb/handler/ha_innodb.h
+++ b/storage/xtradb/handler/ha_innodb.h
@@ -148,7 +148,7 @@ class ha_innobase: public handler
my_bool is_fake_change_enabled(THD *thd);
int write_row(uchar * buf);
- int update_row(const uchar * old_data, uchar * new_data);
+ int update_row(const uchar * old_data, const uchar * new_data);
int delete_row(const uchar * buf);
bool was_semi_consistent_read();
void try_semi_consistent_read(bool yes);