summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorEugene Kosov <claprix@yandex.ru>2019-07-04 21:31:35 +0300
committerEugene Kosov <claprix@yandex.ru>2019-07-05 13:14:19 +0300
commitc9aa495fb67ab4fd5c9790d4f61b7e988423619f (patch)
tree9f6aa0423075e0450ce433983c163d06023b638d /storage
parent23c12ed5cb2a86516f4d4502779d2be312fa6e17 (diff)
downloadmariadb-git-c9aa495fb67ab4fd5c9790d4f61b7e988423619f.tar.gz
MDEV-19955 make argument of handler::ha_write_row() const
MDEV-19486 and one more similar bug appeared because handler::write_row() interface welcomes to modify buffer by storage engine. But callers are not ready for that thus bugs are possible in future. handler::write_row(): handler::ha_write_row(): make argument const
Diffstat (limited to 'storage')
-rw-r--r--storage/archive/ha_archive.cc8
-rw-r--r--storage/archive/ha_archive.h8
-rw-r--r--storage/blackhole/ha_blackhole.cc2
-rw-r--r--storage/blackhole/ha_blackhole.h2
-rw-r--r--storage/cassandra/ha_cassandra.cc2
-rw-r--r--storage/cassandra/ha_cassandra.h2
-rw-r--r--storage/connect/ha_connect.cc2
-rw-r--r--storage/connect/ha_connect.h2
-rw-r--r--storage/csv/ha_tina.cc2
-rw-r--r--storage/csv/ha_tina.h2
-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.cc2
-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_write.c2
-rw-r--r--storage/mroonga/ha_mroonga.cpp14
-rw-r--r--storage/mroonga/ha_mroonga.hpp14
-rw-r--r--storage/myisam/ha_myisam.cc2
-rw-r--r--storage/myisam/ha_myisam.h2
-rw-r--r--storage/myisam/mi_write.c2
-rw-r--r--storage/myisammrg/ha_myisammrg.cc2
-rw-r--r--storage/myisammrg/ha_myisammrg.h2
-rw-r--r--storage/myisammrg/myrg_write.c2
-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.cc2
-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_objects.cc2
-rw-r--r--storage/perfschema/table_setup_objects.h2
-rw-r--r--storage/rocksdb/ha_rocksdb.cc2
-rw-r--r--storage/rocksdb/ha_rocksdb.h2
-rw-r--r--storage/spider/ha_spider.cc2
-rw-r--r--storage/spider/ha_spider.h2
-rw-r--r--storage/tokudb/ha_tokudb.cc6
-rw-r--r--storage/tokudb/ha_tokudb.h6
47 files changed, 70 insertions, 70 deletions
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc
index 0cf9763a0ee..fa49b081ad1 100644
--- a/storage/archive/ha_archive.cc
+++ b/storage/archive/ha_archive.cc
@@ -371,7 +371,7 @@ int Archive_share::write_v1_metafile()
@return Length of packed row
*/
-unsigned int ha_archive::pack_row_v1(uchar *record)
+unsigned int ha_archive::pack_row_v1(const uchar *record)
{
uint *blob, *end;
uchar *pos;
@@ -868,7 +868,7 @@ error:
/*
This is where the actual row is written out.
*/
-int ha_archive::real_write_row(uchar *buf, azio_stream *writer)
+int ha_archive::real_write_row(const uchar *buf, azio_stream *writer)
{
my_off_t written;
unsigned int r_pack_length;
@@ -917,7 +917,7 @@ uint32 ha_archive::max_row_length(const uchar *record)
}
-unsigned int ha_archive::pack_row(uchar *record, azio_stream *writer)
+unsigned int ha_archive::pack_row(const uchar *record, azio_stream *writer)
{
uchar *ptr;
my_ptrdiff_t const rec_offset= record - table->record[0];
@@ -959,7 +959,7 @@ unsigned int ha_archive::pack_row(uchar *record, azio_stream *writer)
for implementing start_bulk_insert() is that we could skip
setting dirty to true each time.
*/
-int ha_archive::write_row(uchar *buf)
+int ha_archive::write_row(const uchar *buf)
{
int rc;
uchar *read_buf= NULL;
diff --git a/storage/archive/ha_archive.h b/storage/archive/ha_archive.h
index 043eab2670a..b9fcf10f96f 100644
--- a/storage/archive/ha_archive.h
+++ b/storage/archive/ha_archive.h
@@ -95,7 +95,7 @@ class ha_archive: public handler
void destroy_record_buffer(archive_record_buffer *r);
int frm_copy(azio_stream *src, azio_stream *dst);
int frm_compare(azio_stream *src);
- unsigned int pack_row_v1(uchar *record);
+ unsigned int pack_row_v1(const uchar *record);
public:
ha_archive(handlerton *hton, TABLE_SHARE *table_arg);
@@ -131,8 +131,8 @@ public:
int index_next(uchar * buf);
int open(const char *name, int mode, uint test_if_locked);
int close(void);
- int write_row(uchar * buf);
- int real_write_row(uchar *buf, azio_stream *writer);
+ int write_row(const uchar * buf);
+ int real_write_row(const uchar *buf, azio_stream *writer);
int truncate();
int rnd_init(bool scan=1);
int rnd_next(uchar *buf);
@@ -168,7 +168,7 @@ public:
uint32 max_row_length(const uchar *buf);
bool fix_rec_buff(unsigned int length);
int unpack_row(azio_stream *file_to_read, uchar *record);
- unsigned int pack_row(uchar *record, azio_stream *writer);
+ unsigned int pack_row(const uchar *record, azio_stream *writer);
bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes);
int external_lock(THD *thd, int lock_type);
private:
diff --git a/storage/blackhole/ha_blackhole.cc b/storage/blackhole/ha_blackhole.cc
index 3f770c7005e..1b64db142e0 100644
--- a/storage/blackhole/ha_blackhole.cc
+++ b/storage/blackhole/ha_blackhole.cc
@@ -117,7 +117,7 @@ const char *ha_blackhole::index_type(uint key_number)
HA_KEY_ALG_RTREE) ? "RTREE" : "BTREE");
}
-int ha_blackhole::write_row(uchar * buf)
+int ha_blackhole::write_row(const uchar * buf)
{
DBUG_ENTER("ha_blackhole::write_row");
DBUG_RETURN(table->next_number_field ? update_auto_increment() : 0);
diff --git a/storage/blackhole/ha_blackhole.h b/storage/blackhole/ha_blackhole.h
index 0632c87c306..6ee30877b64 100644
--- a/storage/blackhole/ha_blackhole.h
+++ b/storage/blackhole/ha_blackhole.h
@@ -96,7 +96,7 @@ public:
THR_LOCK_DATA **to,
enum thr_lock_type lock_type);
private:
- virtual int write_row(uchar *buf);
+ virtual int write_row(const uchar *buf);
virtual int update_row(const uchar *old_data, const uchar *new_data);
virtual int delete_row(const uchar *buf);
};
diff --git a/storage/cassandra/ha_cassandra.cc b/storage/cassandra/ha_cassandra.cc
index 4f9e207235f..f081dca71c3 100644
--- a/storage/cassandra/ha_cassandra.cc
+++ b/storage/cassandra/ha_cassandra.cc
@@ -1931,7 +1931,7 @@ void ha_cassandra::free_dynamic_row(DYNAMIC_COLUMN_VALUE **vals,
*names= 0;
}
-int ha_cassandra::write_row(uchar *buf)
+int ha_cassandra::write_row(const uchar *buf)
{
my_bitmap_map *old_map;
int ires;
diff --git a/storage/cassandra/ha_cassandra.h b/storage/cassandra/ha_cassandra.h
index 9a44abc985f..a36d58fa4da 100644
--- a/storage/cassandra/ha_cassandra.h
+++ b/storage/cassandra/ha_cassandra.h
@@ -239,7 +239,7 @@ public:
int open(const char *name, int mode, uint test_if_locked);
int close(void);
- int write_row(uchar *buf);
+ int write_row(const uchar *buf);
int update_row(const uchar *old_data, const uchar *new_data);
int delete_row(const uchar *buf);
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc
index 9a154cf1af2..b1eddc29dff 100644
--- a/storage/connect/ha_connect.cc
+++ b/storage/connect/ha_connect.cc
@@ -3576,7 +3576,7 @@ int ha_connect::close(void)
item_sum.cc, item_sum.cc, sql_acl.cc, sql_insert.cc,
sql_insert.cc, sql_select.cc, sql_table.cc, sql_udf.cc and sql_update.cc
*/
-int ha_connect::write_row(uchar *buf)
+int ha_connect::write_row(const uchar *buf)
{
int rc= 0;
PGLOBAL& g= xp->g;
diff --git a/storage/connect/ha_connect.h b/storage/connect/ha_connect.h
index 5a1dcb1a88f..53e666d534d 100644
--- a/storage/connect/ha_connect.h
+++ b/storage/connect/ha_connect.h
@@ -388,7 +388,7 @@ virtual int check(THD* thd, HA_CHECK_OPT* check_opt);
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 write_row(uchar *buf);
+ int write_row(const uchar *buf);
/** @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 3ff3b5bd1ba..badb515c2b2 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -1004,7 +1004,7 @@ int ha_tina::close(void)
of the file and appends the data. In an error case it really should
just truncate to the original position (this is not done yet).
*/
-int ha_tina::write_row(uchar * buf)
+int ha_tina::write_row(const uchar * buf)
{
int size;
DBUG_ENTER("ha_tina::write_row");
diff --git a/storage/csv/ha_tina.h b/storage/csv/ha_tina.h
index efb161a714e..aae535c271e 100644
--- a/storage/csv/ha_tina.h
+++ b/storage/csv/ha_tina.h
@@ -136,7 +136,7 @@ public:
int open(const char *name, int mode, uint open_options);
int close(void);
- int write_row(uchar * buf);
+ int write_row(const uchar * buf);
int update_row(const uchar * old_data, const uchar * new_data);
int delete_row(const uchar * buf);
int rnd_init(bool scan=1);
diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc
index 643fa1ae09a..d5d7594791e 100644
--- a/storage/example/ha_example.cc
+++ b/storage/example/ha_example.cc
@@ -398,7 +398,7 @@ int ha_example::close(void)
sql_insert.cc, sql_select.cc, sql_table.cc, sql_udf.cc and sql_update.cc
*/
-int ha_example::write_row(uchar *buf)
+int ha_example::write_row(const uchar *buf)
{
DBUG_ENTER("ha_example::write_row");
/*
diff --git a/storage/example/ha_example.h b/storage/example/ha_example.h
index 52fb4ff3c1b..0a08e871461 100644
--- a/storage/example/ha_example.h
+++ b/storage/example/ha_example.h
@@ -180,7 +180,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 write_row(uchar *buf);
+ int write_row(const uchar *buf);
/** @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 79e70ce5123..ec34cf16858 100644
--- a/storage/federated/ha_federated.cc
+++ b/storage/federated/ha_federated.cc
@@ -1825,7 +1825,7 @@ bool ha_federated::append_stmt_insert(String *query)
sql_insert.cc, sql_select.cc, sql_table.cc, sql_udf.cc, and sql_update.cc.
*/
-int ha_federated::write_row(uchar *buf)
+int ha_federated::write_row(const uchar *buf)
{
char values_buffer[FEDERATED_QUERY_BUFFER_SIZE];
char insert_field_value_buffer[STRING_BUFFER_USUAL_SIZE];
diff --git a/storage/federated/ha_federated.h b/storage/federated/ha_federated.h
index fc379707703..3beb2ca9570 100644
--- a/storage/federated/ha_federated.h
+++ b/storage/federated/ha_federated.h
@@ -209,7 +209,7 @@ public:
void start_bulk_insert(ha_rows rows, uint flags);
int end_bulk_insert();
- int write_row(uchar *buf);
+ int write_row(const uchar *buf);
int update_row(const uchar *old_data, const uchar *new_data);
int delete_row(const uchar *buf);
int index_init(uint keynr, bool sorted);
diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc
index b0a08a0d49a..bea7f2cfb87 100644
--- a/storage/federatedx/ha_federatedx.cc
+++ b/storage/federatedx/ha_federatedx.cc
@@ -1987,7 +1987,7 @@ bool ha_federatedx::append_stmt_insert(String *query)
sql_insert.cc, sql_select.cc, sql_table.cc, sql_udf.cc, and sql_update.cc.
*/
-int ha_federatedx::write_row(uchar *buf)
+int ha_federatedx::write_row(const uchar *buf)
{
char values_buffer[FEDERATEDX_QUERY_BUFFER_SIZE];
char insert_field_value_buffer[STRING_BUFFER_USUAL_SIZE];
diff --git a/storage/federatedx/ha_federatedx.h b/storage/federatedx/ha_federatedx.h
index 67aa83f7b33..1870a83d13d 100644
--- a/storage/federatedx/ha_federatedx.h
+++ b/storage/federatedx/ha_federatedx.h
@@ -397,7 +397,7 @@ public:
void start_bulk_insert(ha_rows rows, uint flags);
int end_bulk_insert();
- int write_row(uchar *buf);
+ int write_row(const uchar *buf);
int update_row(const uchar *old_data, const uchar *new_data);
int delete_row(const uchar *buf);
int index_init(uint keynr, bool sorted);
diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc
index 73857a14a2f..acc835cf300 100644
--- a/storage/heap/ha_heap.cc
+++ b/storage/heap/ha_heap.cc
@@ -228,7 +228,7 @@ void ha_heap::update_key_stats()
}
-int ha_heap::write_row(uchar * buf)
+int ha_heap::write_row(const uchar * buf)
{
int res;
if (table->next_number_field && buf == table->record[0])
diff --git a/storage/heap/ha_heap.h b/storage/heap/ha_heap.h
index 0d2a7a3a442..3440c8fd205 100644
--- a/storage/heap/ha_heap.h
+++ b/storage/heap/ha_heap.h
@@ -70,7 +70,7 @@ public:
int open(const char *name, int mode, uint test_if_locked);
int close(void);
void set_keys_for_scanning(void);
- int write_row(uchar * buf);
+ int write_row(const uchar * buf);
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,
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index ada0e8b1773..4898e1527dc 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -7997,7 +7997,7 @@ handle.
int
ha_innobase::write_row(
/*===================*/
- uchar* record) /*!< in: a row in MySQL format */
+ const uchar* record) /*!< in: a row in MySQL format */
{
dberr_t error;
#ifdef WITH_WSREP
diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h
index cffd1683a67..a0ce93bec3c 100644
--- a/storage/innobase/handler/ha_innodb.h
+++ b/storage/innobase/handler/ha_innodb.h
@@ -112,7 +112,7 @@ public:
int delete_all_rows() override;
- int write_row(uchar * buf) override;
+ int write_row(const uchar * buf) override;
int update_row(const uchar * old_data, const uchar * new_data) override;
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index 54a1d1ce146..496f6006aa1 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -1227,7 +1227,7 @@ int ha_maria::close(void)
}
-int ha_maria::write_row(uchar * buf)
+int ha_maria::write_row(const uchar * buf)
{
/*
If we have an auto_increment column and we are writing a changed row
diff --git a/storage/maria/ha_maria.h b/storage/maria/ha_maria.h
index 48af840d86b..ef0ceb1cd32 100644
--- a/storage/maria/ha_maria.h
+++ b/storage/maria/ha_maria.h
@@ -73,7 +73,7 @@ public:
int open(const char *name, int mode, uint test_if_locked);
int close(void);
- int write_row(uchar * buf);
+ int write_row(const uchar * buf);
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,
diff --git a/storage/maria/ma_write.c b/storage/maria/ma_write.c
index faf47929973..07be8333794 100644
--- a/storage/maria/ma_write.c
+++ b/storage/maria/ma_write.c
@@ -83,7 +83,7 @@ my_bool _ma_write_abort_default(MARIA_HA *info __attribute__((unused)))
/* Write new record to a table */
-int maria_write(MARIA_HA *info, uchar *record)
+int maria_write(MARIA_HA *info, const uchar *record)
{
MARIA_SHARE *share= info->s;
uint i;
diff --git a/storage/mroonga/ha_mroonga.cpp b/storage/mroonga/ha_mroonga.cpp
index a2ab9dd6423..767f357c9fe 100644
--- a/storage/mroonga/ha_mroonga.cpp
+++ b/storage/mroonga/ha_mroonga.cpp
@@ -5852,7 +5852,7 @@ bool ha_mroonga::wrapper_have_target_index()
DBUG_RETURN(have_target_index);
}
-int ha_mroonga::wrapper_write_row(uchar *buf)
+int ha_mroonga::wrapper_write_row(const uchar *buf)
{
int error = 0;
THD *thd = ha_thd();
@@ -5881,7 +5881,7 @@ int ha_mroonga::wrapper_write_row(uchar *buf)
DBUG_RETURN(error);
}
-int ha_mroonga::wrapper_write_row_index(uchar *buf)
+int ha_mroonga::wrapper_write_row_index(const uchar *buf)
{
MRN_DBUG_ENTER_METHOD();
@@ -5968,7 +5968,7 @@ err:
DBUG_RETURN(error);
}
-int ha_mroonga::storage_write_row(uchar *buf)
+int ha_mroonga::storage_write_row(const uchar *buf)
{
MRN_DBUG_ENTER_METHOD();
int error = 0;
@@ -6231,7 +6231,7 @@ err:
DBUG_RETURN(error);
}
-int ha_mroonga::storage_write_row_multiple_column_index(uchar *buf,
+int ha_mroonga::storage_write_row_multiple_column_index(const uchar *buf,
grn_id record_id,
KEY *key_info,
grn_obj *index_column)
@@ -6268,7 +6268,7 @@ int ha_mroonga::storage_write_row_multiple_column_index(uchar *buf,
DBUG_RETURN(error);
}
-int ha_mroonga::storage_write_row_multiple_column_indexes(uchar *buf,
+int ha_mroonga::storage_write_row_multiple_column_indexes(const uchar *buf,
grn_id record_id)
{
MRN_DBUG_ENTER_METHOD();
@@ -6380,7 +6380,7 @@ int ha_mroonga::storage_write_row_unique_index(const uchar *buf,
DBUG_RETURN(0);
}
-int ha_mroonga::storage_write_row_unique_indexes(uchar *buf)
+int ha_mroonga::storage_write_row_unique_indexes(const uchar *buf)
{
int error = 0;
uint i;
@@ -6443,7 +6443,7 @@ err:
DBUG_RETURN(error);
}
-int ha_mroonga::write_row(uchar *buf)
+int ha_mroonga::write_row(const uchar *buf)
{
MRN_DBUG_ENTER_METHOD();
int error = 0;
diff --git a/storage/mroonga/ha_mroonga.hpp b/storage/mroonga/ha_mroonga.hpp
index 4c64959b17f..9b545450185 100644
--- a/storage/mroonga/ha_mroonga.hpp
+++ b/storage/mroonga/ha_mroonga.hpp
@@ -451,7 +451,7 @@ public:
int extra_opt(enum ha_extra_function operation, ulong cache_size);
int delete_table(const char *name);
- int write_row(uchar *buf);
+ int write_row(const uchar *buf);
int update_row(const uchar *old_data, const uchar *new_data);
int delete_row(const uchar *buf);
@@ -908,20 +908,20 @@ private:
int storage_end_bulk_insert();
bool wrapper_is_target_index(KEY *key_info);
bool wrapper_have_target_index();
- int wrapper_write_row(uchar *buf);
- int wrapper_write_row_index(uchar *buf);
- int storage_write_row(uchar *buf);
- int storage_write_row_multiple_column_index(uchar *buf,
+ int wrapper_write_row(const uchar *buf);
+ int wrapper_write_row_index(const uchar *buf);
+ int storage_write_row(const uchar *buf);
+ int storage_write_row_multiple_column_index(const uchar *buf,
grn_id record_id,
KEY *key_info,
grn_obj *index_column);
- int storage_write_row_multiple_column_indexes(uchar *buf, grn_id record_id);
+ int storage_write_row_multiple_column_indexes(const uchar *buf, grn_id record_id);
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 storage_write_row_unique_indexes(const uchar *buf);
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);
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 19382ee4a50..f478e01e441 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -933,7 +933,7 @@ int ha_myisam::close(void)
return mi_close(tmp);
}
-int ha_myisam::write_row(uchar *buf)
+int ha_myisam::write_row(const uchar *buf)
{
/*
If we have an auto_increment column and we are writing a changed row
diff --git a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h
index 3e191ecfa3f..0af4215e8f9 100644
--- a/storage/myisam/ha_myisam.h
+++ b/storage/myisam/ha_myisam.h
@@ -69,7 +69,7 @@ class ha_myisam: public handler
void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share);
int open(const char *name, int mode, uint test_if_locked);
int close(void);
- int write_row(uchar * buf);
+ int write_row(const uchar * buf);
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,
diff --git a/storage/myisam/mi_write.c b/storage/myisam/mi_write.c
index f08dea77354..7345ab1604d 100644
--- a/storage/myisam/mi_write.c
+++ b/storage/myisam/mi_write.c
@@ -40,7 +40,7 @@ int _mi_ck_write_btree(register MI_INFO *info, uint keynr,uchar *key,
/* Write new record to database */
-int mi_write(MI_INFO *info, uchar *record)
+int mi_write(MI_INFO *info, const uchar *record)
{
MYISAM_SHARE *share=info->s;
uint i;
diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc
index 8f5e65084ce..14036a31b8c 100644
--- a/storage/myisammrg/ha_myisammrg.cc
+++ b/storage/myisammrg/ha_myisammrg.cc
@@ -1088,7 +1088,7 @@ int ha_myisammrg::close(void)
DBUG_RETURN(rc);
}
-int ha_myisammrg::write_row(uchar * buf)
+int ha_myisammrg::write_row(const uchar * buf)
{
DBUG_ENTER("ha_myisammrg::write_row");
DBUG_ASSERT(this->file->children_attached);
diff --git a/storage/myisammrg/ha_myisammrg.h b/storage/myisammrg/ha_myisammrg.h
index 7cb2b0f1993..b7cbd6c7d12 100644
--- a/storage/myisammrg/ha_myisammrg.h
+++ b/storage/myisammrg/ha_myisammrg.h
@@ -111,7 +111,7 @@ public:
int detach_children(void);
virtual handler *clone(const char *name, MEM_ROOT *mem_root);
int close(void);
- int write_row(uchar * buf);
+ int write_row(const uchar * buf);
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,
diff --git a/storage/myisammrg/myrg_write.c b/storage/myisammrg/myrg_write.c
index eb496911a52..e511d60d634 100644
--- a/storage/myisammrg/myrg_write.c
+++ b/storage/myisammrg/myrg_write.c
@@ -18,7 +18,7 @@
#include "myrg_def.h"
-int myrg_write(register MYRG_INFO *info, uchar *rec)
+int myrg_write(register MYRG_INFO *info, const uchar *rec)
{
/* [phi] MERGE_WRITE_DISABLED is handled by the else case */
if (info->merge_insert_method == MERGE_INSERT_TO_FIRST)
diff --git a/storage/oqgraph/ha_oqgraph.cc b/storage/oqgraph/ha_oqgraph.cc
index 4154f89028a..fd715c57a1f 100644
--- a/storage/oqgraph/ha_oqgraph.cc
+++ b/storage/oqgraph/ha_oqgraph.cc
@@ -799,7 +799,7 @@ void ha_oqgraph::update_key_stats()
}
-int ha_oqgraph::write_row(byte * buf)
+int ha_oqgraph::write_row(const byte * buf)
{
return HA_ERR_TABLE_READONLY;
}
diff --git a/storage/oqgraph/ha_oqgraph.h b/storage/oqgraph/ha_oqgraph.h
index d0ac8d7e18c..0c0af6def97 100644
--- a/storage/oqgraph/ha_oqgraph.h
+++ b/storage/oqgraph/ha_oqgraph.h
@@ -83,7 +83,7 @@ public:
int open(const char *name, int mode, uint test_if_locked);
int close(void);
- int write_row(byte * buf);
+ int write_row(const byte * buf);
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,
diff --git a/storage/perfschema/ha_perfschema.cc b/storage/perfschema/ha_perfschema.cc
index cb5805db5da..50d7a3aa468 100644
--- a/storage/perfschema/ha_perfschema.cc
+++ b/storage/perfschema/ha_perfschema.cc
@@ -251,7 +251,7 @@ int ha_perfschema::close(void)
DBUG_RETURN(0);
}
-int ha_perfschema::write_row(uchar *buf)
+int ha_perfschema::write_row(const uchar *buf)
{
int result;
diff --git a/storage/perfschema/ha_perfschema.h b/storage/perfschema/ha_perfschema.h
index 4aad6a3beef..31b4e84e87d 100644
--- a/storage/perfschema/ha_perfschema.h
+++ b/storage/perfschema/ha_perfschema.h
@@ -120,7 +120,7 @@ public:
@param buf the row to write
@return 0 on success
*/
- int write_row(uchar *buf);
+ int write_row(const uchar *buf);
void use_hidden_primary_key();
diff --git a/storage/perfschema/pfs_engine_table.cc b/storage/perfschema/pfs_engine_table.cc
index b133988e908..380818cf025 100644
--- a/storage/perfschema/pfs_engine_table.cc
+++ b/storage/perfschema/pfs_engine_table.cc
@@ -178,7 +178,7 @@ ha_rows PFS_engine_table_share::get_row_count(void) const
return m_records;
}
-int PFS_engine_table_share::write_row(TABLE *table, unsigned char *buf,
+int PFS_engine_table_share::write_row(TABLE *table, const unsigned char *buf,
Field **fields) const
{
my_bitmap_map *org_bitmap;
diff --git a/storage/perfschema/pfs_engine_table.h b/storage/perfschema/pfs_engine_table.h
index b29a9c54754..d58ac4390f9 100644
--- a/storage/perfschema/pfs_engine_table.h
+++ b/storage/perfschema/pfs_engine_table.h
@@ -200,7 +200,7 @@ protected:
typedef PFS_engine_table* (*pfs_open_table_t)(void);
/** Callback to write a row. */
typedef int (*pfs_write_row_t)(TABLE *table,
- unsigned char *buf, Field **fields);
+ const unsigned char *buf, Field **fields);
/** Callback to delete all rows. */
typedef int (*pfs_delete_all_rows_t)(void);
/** Callback to get a row count. */
@@ -217,7 +217,7 @@ struct PFS_engine_table_share
/** Get the row count. */
ha_rows get_row_count(void) const;
/** Write a row. */
- int write_row(TABLE *table, unsigned char *buf, Field **fields) const;
+ int write_row(TABLE *table, const unsigned char *buf, Field **fields) const;
/** Table name. */
LEX_STRING m_name;
diff --git a/storage/perfschema/table_setup_actors.cc b/storage/perfschema/table_setup_actors.cc
index b5058f8cd85..1ff1ac8c412 100644
--- a/storage/perfschema/table_setup_actors.cc
+++ b/storage/perfschema/table_setup_actors.cc
@@ -52,7 +52,7 @@ PFS_engine_table* table_setup_actors::create()
return new table_setup_actors();
}
-int table_setup_actors::write_row(TABLE *table, unsigned char *buf,
+int table_setup_actors::write_row(TABLE *table, const unsigned char *buf,
Field **fields)
{
Field *f;
diff --git a/storage/perfschema/table_setup_actors.h b/storage/perfschema/table_setup_actors.h
index aa403b4909d..2e274a0cf15 100644
--- a/storage/perfschema/table_setup_actors.h
+++ b/storage/perfschema/table_setup_actors.h
@@ -55,7 +55,7 @@ public:
static PFS_engine_table_share m_share;
/** Table builder. */
static PFS_engine_table* create();
- static int write_row(TABLE *table, unsigned char *buf, Field **fields);
+ static int write_row(TABLE *table, const unsigned char *buf, Field **fields);
static int delete_all_rows();
static ha_rows get_row_count();
diff --git a/storage/perfschema/table_setup_objects.cc b/storage/perfschema/table_setup_objects.cc
index e15c55b41ae..c3f3e01f933 100644
--- a/storage/perfschema/table_setup_objects.cc
+++ b/storage/perfschema/table_setup_objects.cc
@@ -66,7 +66,7 @@ PFS_engine_table* table_setup_objects::create(void)
return new table_setup_objects();
}
-int table_setup_objects::write_row(TABLE *table, unsigned char *buf,
+int table_setup_objects::write_row(TABLE *table, const unsigned char *buf,
Field **fields)
{
int result;
diff --git a/storage/perfschema/table_setup_objects.h b/storage/perfschema/table_setup_objects.h
index 8e883126298..d8fd041bd57 100644
--- a/storage/perfschema/table_setup_objects.h
+++ b/storage/perfschema/table_setup_objects.h
@@ -58,7 +58,7 @@ public:
static PFS_engine_table_share m_share;
/** Table builder. */
static PFS_engine_table* create();
- static int write_row(TABLE *table, unsigned char *buf, Field **fields);
+ static int write_row(TABLE *table, const unsigned char *buf, Field **fields);
static int delete_all_rows();
static ha_rows get_row_count();
diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc
index 5300f84db1e..59c764caa96 100644
--- a/storage/rocksdb/ha_rocksdb.cc
+++ b/storage/rocksdb/ha_rocksdb.cc
@@ -9485,7 +9485,7 @@ const std::string ha_rocksdb::get_table_comment(const TABLE *const table_arg) {
HA_EXIT_SUCCESS OK
other HA_ERR error code (can be SE-specific)
*/
-int ha_rocksdb::write_row(uchar *const buf) {
+int ha_rocksdb::write_row(const uchar *const buf) {
DBUG_ENTER_FUNC();
DBUG_ASSERT(buf != nullptr);
diff --git a/storage/rocksdb/ha_rocksdb.h b/storage/rocksdb/ha_rocksdb.h
index cadbd9abfe9..1abdc345527 100644
--- a/storage/rocksdb/ha_rocksdb.h
+++ b/storage/rocksdb/ha_rocksdb.h
@@ -640,7 +640,7 @@ public:
MY_ATTRIBUTE((__warn_unused_result__));
int close(void) override MY_ATTRIBUTE((__warn_unused_result__));
- int write_row(uchar *const buf) override
+ int write_row(const uchar *const buf) override
MY_ATTRIBUTE((__warn_unused_result__));
int update_row(const uchar *const old_data, const uchar *const new_data) override
MY_ATTRIBUTE((__warn_unused_result__));
diff --git a/storage/spider/ha_spider.cc b/storage/spider/ha_spider.cc
index 33e81201fff..5457bc0ba50 100644
--- a/storage/spider/ha_spider.cc
+++ b/storage/spider/ha_spider.cc
@@ -9796,7 +9796,7 @@ int ha_spider::end_bulk_insert()
}
int ha_spider::write_row(
- uchar *buf
+ const uchar *buf
) {
int error_num;
THD *thd = ha_thd();
diff --git a/storage/spider/ha_spider.h b/storage/spider/ha_spider.h
index 6f5359007f1..a146745aa97 100644
--- a/storage/spider/ha_spider.h
+++ b/storage/spider/ha_spider.h
@@ -568,7 +568,7 @@ public:
#endif
int end_bulk_insert();
int write_row(
- uchar *buf
+ const uchar *buf
);
#ifdef HA_CAN_BULK_ACCESS
int pre_write_row(
diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc
index 2be8556a123..c19a75d680d 100644
--- a/storage/tokudb/ha_tokudb.cc
+++ b/storage/tokudb/ha_tokudb.cc
@@ -3714,7 +3714,7 @@ static bool do_unique_checks_fn(THD *thd) {
#endif // defined(TOKU_INCLUDE_RFR) && TOKU_INCLUDE_RFR
-int ha_tokudb::do_uniqueness_checks(uchar* record, DB_TXN* txn, THD* thd) {
+int ha_tokudb::do_uniqueness_checks(const uchar* record, DB_TXN* txn, THD* thd) {
int error = 0;
//
// first do uniqueness checks
@@ -3757,7 +3757,7 @@ cleanup:
return error;
}
-void ha_tokudb::test_row_packing(uchar* record, DBT* pk_key, DBT* pk_val) {
+void ha_tokudb::test_row_packing(const uchar* record, DBT* pk_key, DBT* pk_val) {
int error;
DBT row, key;
//
@@ -3998,7 +3998,7 @@ out:
// 0 on success
// error otherwise
//
-int ha_tokudb::write_row(uchar * record) {
+int ha_tokudb::write_row(const uchar * record) {
TOKUDB_HANDLER_DBUG_ENTER("%p", record);
DBT row, prim_key;
diff --git a/storage/tokudb/ha_tokudb.h b/storage/tokudb/ha_tokudb.h
index c36c93a4c74..f95143a6b4b 100644
--- a/storage/tokudb/ha_tokudb.h
+++ b/storage/tokudb/ha_tokudb.h
@@ -703,11 +703,11 @@ private:
void trace_create_table_info(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, const uchar* record, KEY* key_info, uint dict_index, DB_TXN* txn);
- int do_uniqueness_checks(uchar* record, DB_TXN* txn, THD* thd);
+ int do_uniqueness_checks(const 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(DBT* pk_key, DBT* pk_val, DB_TXN* txn);
int insert_rows_to_dictionaries_mult(DBT* pk_key, DBT* pk_val, DB_TXN* txn, THD* thd);
- void test_row_packing(uchar* record, DBT* pk_key, DBT* pk_val);
+ void test_row_packing(const uchar* record, DBT* pk_key, DBT* pk_val);
uint32_t fill_row_mutator(
uchar* buf,
uint32_t* dropped_columns,
@@ -785,7 +785,7 @@ public:
int rename_table(const char *from, const char *to);
int optimize(THD * thd, HA_CHECK_OPT * check_opt);
int analyze(THD * thd, HA_CHECK_OPT * check_opt);
- int write_row(uchar * buf);
+ int write_row(const uchar * buf);
int update_row(const uchar * old_data, const uchar * new_data);
int delete_row(const uchar * buf);
#if MYSQL_VERSION_ID >= 100000