diff options
author | Michael Widenius <monty@mariadb.org> | 2017-04-16 22:40:39 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2017-04-18 12:23:53 +0300 |
commit | a05a610d60a6d177b66f9da97906efdb44336a6f (patch) | |
tree | bca0d63ddc2a8b43d22a3d1732e5497caab40f78 | |
parent | d82ac8eaafd89a6a74436747b660ef02c69eaac3 (diff) | |
download | mariadb-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.
73 files changed, 126 insertions, 110 deletions
diff --git a/include/maria.h b/include/maria.h index ab8fc944c8c..e25fa4c24ee 100644 --- a/include/maria.h +++ b/include/maria.h @@ -305,7 +305,7 @@ extern int maria_rsame(MARIA_HA *file, uchar *record, int inx); extern int maria_rsame_with_pos(MARIA_HA *file, uchar *record, int inx, MARIA_RECORD_POS pos); extern int maria_update(MARIA_HA *file, const uchar *old, - uchar *new_record); + const uchar *new_record); extern int maria_write(MARIA_HA *file, uchar *buff); extern MARIA_RECORD_POS maria_position(MARIA_HA *file); extern int maria_status(MARIA_HA *info, MARIA_INFO *x, uint flag); diff --git a/include/myisam.h b/include/myisam.h index f7a3ae8cc8a..dfbc00f64aa 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -275,7 +275,7 @@ extern int mi_rsame(struct st_myisam_info *file,uchar *record,int inx); extern int mi_rsame_with_pos(struct st_myisam_info *file,uchar *record, int inx, my_off_t pos); extern int mi_update(struct st_myisam_info *file,const uchar *old, - uchar *new_record); + const uchar *new_record); extern int mi_write(struct st_myisam_info *file,uchar *buff); extern my_off_t mi_position(struct st_myisam_info *file); extern int mi_status(struct st_myisam_info *info, MI_ISAMINFO *x, uint flag); diff --git a/include/myisammrg.h b/include/myisammrg.h index 89293537989..952f3b02920 100644 --- a/include/myisammrg.h +++ b/include/myisammrg.h @@ -104,7 +104,8 @@ extern int myrg_rkey(MYRG_INFO *info,uchar *buf,int inx, const uchar *key, key_part_map keypart_map, enum ha_rkey_function search_flag); extern int myrg_rrnd(MYRG_INFO *file,uchar *buf,ulonglong pos); extern int myrg_rsame(MYRG_INFO *file,uchar *record,int inx); -extern int myrg_update(MYRG_INFO *file,const uchar *old,uchar *new_rec); +extern int myrg_update(MYRG_INFO *file,const uchar *old, + const uchar *new_rec); extern int myrg_write(MYRG_INFO *info,uchar *rec); extern int myrg_status(MYRG_INFO *file,MYMERGE_INFO *x,int flag); extern int myrg_lock_database(MYRG_INFO *file,int lock_type); diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index b27de9dad4d..79b49eb1edb 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -4204,7 +4204,7 @@ exit: old_data is always record[1] */ -int ha_partition::update_row(const uchar *old_data, uchar *new_data) +int ha_partition::update_row(const uchar *old_data, const uchar *new_data) { THD *thd= ha_thd(); uint32 new_part_id, old_part_id; @@ -4280,7 +4280,7 @@ int ha_partition::update_row(const uchar *old_data, uchar *new_data) DBUG_PRINT("info", ("Update from partition %d to partition %d", old_part_id, new_part_id)); tmp_disable_binlog(thd); /* Do not replicate the low-level changes. */ - error= m_file[new_part_id]->ha_write_row(new_data); + error= m_file[new_part_id]->ha_write_row((uchar*) new_data); reenable_binlog(thd); table->next_number_field= saved_next_number_field; if (error) diff --git a/sql/ha_partition.h b/sql/ha_partition.h index 70ec4ae8edb..46fca544279 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -485,7 +485,7 @@ public: number of calls to write_row. */ 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); virtual int delete_all_rows(void); virtual int truncate(); diff --git a/sql/ha_sequence.cc b/sql/ha_sequence.cc index f3c4d8961a8..70d16516241 100644 --- a/sql/ha_sequence.cc +++ b/sql/ha_sequence.cc @@ -231,7 +231,7 @@ int ha_sequence::write_row(uchar *buf) } -int ha_sequence::update_row(const uchar *old_data, uchar *new_data) +int ha_sequence::update_row(const uchar *old_data, const uchar *new_data) { int error; sequence_definition tmp_seq; diff --git a/sql/ha_sequence.h b/sql/ha_sequence.h index aeb7ff3fd58..ff8e4263692 100644 --- a/sql/ha_sequence.h +++ b/sql/ha_sequence.h @@ -69,7 +69,7 @@ public: HA_CREATE_INFO *create_info); handler *clone(const char *name, MEM_ROOT *mem_root); 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); Table_flags table_flags() const; /* One can't delete from sequence engine */ int delete_row(const uchar *buf) diff --git a/sql/handler.cc b/sql/handler.cc index 5d0ec99e978..fb4384a8bc5 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -4042,7 +4042,7 @@ int handler::ha_repair(THD* thd, HA_CHECK_OPT* check_opt) */ int -handler::ha_bulk_update_row(const uchar *old_data, uchar *new_data, +handler::ha_bulk_update_row(const uchar *old_data, const uchar *new_data, uint *dup_key_found) { DBUG_ASSERT(table_share->tmp_table != NO_TMP_TABLE || @@ -5998,7 +5998,7 @@ int handler::ha_write_row(uchar *buf) } -int handler::ha_update_row(const uchar *old_data, uchar *new_data) +int handler::ha_update_row(const uchar *old_data, const uchar *new_data) { int error; Log_func *log_func= Update_rows_log_event::binlog_row_logging_function; diff --git a/sql/handler.h b/sql/handler.h index 7f8dd687bda..f85b7c26284 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -2882,7 +2882,7 @@ public: */ int ha_external_lock(THD *thd, int lock_type); int ha_write_row(uchar * buf); - int ha_update_row(const uchar * old_data, uchar * new_data); + int ha_update_row(const uchar * old_data, const uchar * new_data); int ha_delete_row(const uchar * buf); void ha_release_auto_increment(); @@ -2921,7 +2921,7 @@ public: int ret= end_bulk_insert(); DBUG_RETURN(ret); } - int ha_bulk_update_row(const uchar *old_data, uchar *new_data, + int ha_bulk_update_row(const uchar *old_data, const uchar *new_data, uint *dup_key_found); int ha_delete_all_rows(); int ha_truncate(); @@ -4039,7 +4039,7 @@ private: message will contain garbage. */ virtual int update_row(const uchar *old_data __attribute__((unused)), - uchar *new_data __attribute__((unused))) + const uchar *new_data __attribute__((unused))) { return HA_ERR_WRONG_COMMAND; } @@ -4127,7 +4127,7 @@ public: @retval 0 Bulk delete used by handler @retval 1 Bulk delete not used, normal operation used */ - virtual int bulk_update_row(const uchar *old_data, uchar *new_data, + virtual int bulk_update_row(const uchar *old_data, const uchar *new_data, uint *dup_key_found) { DBUG_ASSERT(FALSE); diff --git a/sql/key.cc b/sql/key.cc index 0c931184da7..c2d22005736 100644 --- a/sql/key.cc +++ b/sql/key.cc @@ -112,7 +112,7 @@ int find_ref_key(KEY *key, uint key_count, uchar *record, Field *field, @param with_zerofill skipped bytes in the key buffer to be filled with 0 */ -void key_copy(uchar *to_key, uchar *from_record, KEY *key_info, +void key_copy(uchar *to_key, const uchar *from_record, KEY *key_info, uint key_length, bool with_zerofill) { uint length; diff --git a/sql/key.h b/sql/key.h index f2521e4a665..7b83d74c901 100644 --- a/sql/key.h +++ b/sql/key.h @@ -27,8 +27,8 @@ typedef struct st_key_part_info KEY_PART_INFO; int find_ref_key(KEY *key, uint key_count, uchar *record, Field *field, uint *key_length, uint *keypart); -void key_copy(uchar *to_key, uchar *from_record, KEY *key_info, uint key_length, - bool with_zerofill= FALSE); +void key_copy(uchar *to_key, const uchar *from_record, KEY *key_info, + uint key_length, bool with_zerofill= FALSE); void key_restore(uchar *to_record, const uchar *from_key, KEY *key_info, uint key_length); bool key_cmp_if_same(TABLE *form,const uchar *key,uint index,uint key_length); diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 0a146aeb12b..d226f7e05ba 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -282,7 +282,7 @@ bool partition_default_handling(THD *thd, TABLE *table, partition_info *part_inf > 0 Error code */ -int get_parts_for_update(const uchar *old_data, uchar *new_data, +int get_parts_for_update(const uchar *old_data, const uchar *new_data, const uchar *rec0, partition_info *part_info, uint32 *old_part_id, uint32 *new_part_id, longlong *new_func_value) diff --git a/sql/sql_partition.h b/sql/sql_partition.h index c2665a8366b..93e3bbba641 100644 --- a/sql/sql_partition.h +++ b/sql/sql_partition.h @@ -85,7 +85,7 @@ bool check_reorganise_list(partition_info *new_part_info, partition_info *old_part_info, List<char> list_part_names); handler *get_ha_partition(partition_info *part_info); -int get_parts_for_update(const uchar *old_data, uchar *new_data, +int get_parts_for_update(const uchar *old_data, const uchar *new_data, const uchar *rec0, partition_info *part_info, uint32 *old_part_id, uint32 *new_part_id, longlong *func_value); 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); |