Commit 8f077940 authored by marko's avatar marko

branches/zip: Introduce const qualifiers to many read-only parameters

and modify some functions to return const pointers.  Add const qualifiers
to local variable declarations or casts to remove the const qualifier
in those places where write access is needed.
parent 67740324
......@@ -3376,7 +3376,8 @@ btr_cur_mark_dtuple_inherited_extern(
}
if (!is_updated) {
dfield = dtuple_get_nth_field(entry, ext_vec[i]);
dfield = (dfield_t*)
dtuple_get_nth_field(entry, ext_vec[i]);
data = (byte*) dfield_get_data(dfield);
len = dfield_get_len(dfield);
......@@ -3441,7 +3442,7 @@ btr_cur_unmark_dtuple_extern_fields(
ulint i;
for (i = 0; i < n_ext_vec; i++) {
dfield = dtuple_get_nth_field(entry, ext_vec[i]);
dfield = (dfield_t*) dtuple_get_nth_field(entry, ext_vec[i]);
data = (byte*) dfield_get_data(dfield);
len = dfield_get_len(dfield);
......
......@@ -44,19 +44,19 @@ dfield_get_data_noninline(
}
ulint
dfield_get_len_noninline(
dfield_t* field) /* in: field */
const dfield_t* field) /* in: field */
{
return(dfield_get_len(field));
}
ulint
dtuple_get_n_fields_noninline(
dtuple_t* tuple) /* in: tuple */
const dtuple_t* tuple) /* in: tuple */
{
return(dtuple_get_n_fields(tuple));
}
dfield_t*
const dfield_t*
dtuple_get_nth_field_noninline(
dtuple_t* tuple, /* in: tuple */
const dtuple_t* tuple, /* in: tuple */
ulint n) /* in: index of field */
{
return(dtuple_get_nth_field(tuple, n));
......@@ -69,9 +69,9 @@ ibool
dfield_data_is_binary_equal(
/*========================*/
/* out: TRUE if equal */
dfield_t* field, /* in: field */
const dfield_t* field, /* in: field */
ulint len, /* in: data length or UNIV_SQL_NULL */
byte* data) /* in: data */
const byte* data) /* in: data */
{
if (len != field->len) {
......@@ -103,11 +103,11 @@ dtuple_datas_are_ordering_equal(
when compared with cmp_data_data:
NOTE: in character type fields some letters
are identified with others! (collation) */
dtuple_t* tuple1, /* in: tuple 1 */
dtuple_t* tuple2) /* in: tuple 2 */
const dtuple_t* tuple1, /* in: tuple 1 */
const dtuple_t* tuple2) /* in: tuple 2 */
{
dfield_t* field1;
dfield_t* field2;
const dfield_t* field1;
const dfield_t* field2;
ulint n_fields;
ulint i;
......@@ -187,7 +187,7 @@ ibool
dfield_check_typed_no_assert(
/*=========================*/
/* out: TRUE if ok */
dfield_t* field) /* in: data field */
const dfield_t* field) /* in: data field */
{
if (dfield_get_type(field)->mtype > DATA_MYSQL
|| dfield_get_type(field)->mtype < DATA_VARCHAR) {
......@@ -209,9 +209,9 @@ ibool
dtuple_check_typed_no_assert(
/*=========================*/
/* out: TRUE if ok */
dtuple_t* tuple) /* in: tuple */
const dtuple_t* tuple) /* in: tuple */
{
dfield_t* field;
const dfield_t* field;
ulint i;
if (dtuple_get_n_fields(tuple) > REC_MAX_N_FIELDS) {
......@@ -245,7 +245,7 @@ ibool
dfield_check_typed(
/*===============*/
/* out: TRUE if ok */
dfield_t* field) /* in: data field */
const dfield_t* field) /* in: data field */
{
if (dfield_get_type(field)->mtype > DATA_MYSQL
|| dfield_get_type(field)->mtype < DATA_VARCHAR) {
......@@ -268,9 +268,9 @@ ibool
dtuple_check_typed(
/*===============*/
/* out: TRUE if ok */
dtuple_t* tuple) /* in: tuple */
const dtuple_t* tuple) /* in: tuple */
{
dfield_t* field;
const dfield_t* field;
ulint i;
for (i = 0; i < dtuple_get_n_fields(tuple); i++) {
......@@ -292,10 +292,10 @@ ibool
dtuple_validate(
/*============*/
/* out: TRUE if ok */
dtuple_t* tuple) /* in: tuple */
const dtuple_t* tuple) /* in: tuple */
{
dfield_t* field;
byte* data;
const dfield_t* field;
const byte* data;
ulint n_fields;
ulint len;
ulint i;
......@@ -339,15 +339,15 @@ Pretty prints a dfield value according to its data type. */
void
dfield_print(
/*=========*/
dfield_t* dfield) /* in: dfield */
const dfield_t* dfield) /* in: dfield */
{
byte* data;
ulint len;
ulint mtype;
ulint i;
const byte* data;
ulint len;
ulint mtype;
ulint i;
len = dfield_get_len(dfield);
data = dfield_get_data(dfield);
data = dfield_get_data((dfield_t*) dfield);
if (len == UNIV_SQL_NULL) {
fputs("NULL", stderr);
......@@ -378,16 +378,16 @@ is printed if a string contains non-printable characters. */
void
dfield_print_also_hex(
/*==================*/
dfield_t* dfield) /* in: dfield */
const dfield_t* dfield) /* in: dfield */
{
byte* data;
ulint len;
ulint mtype;
ulint i;
ibool print_also_hex;
const byte* data;
ulint len;
ulint mtype;
ulint i;
ibool print_also_hex;
len = dfield_get_len(dfield);
data = dfield_get_data(dfield);
data = dfield_get_data((dfield_t*) dfield);
if (len == UNIV_SQL_NULL) {
fputs("NULL", stderr);
......@@ -417,7 +417,7 @@ dfield_print_also_hex(
fputs(" Hex: ", stderr);
data = dfield_get_data(dfield);
data = dfield_get_data((dfield_t*) dfield);
for (i = 0; i < len; i++) {
fprintf(stderr, "%02lx", (ulint)*data);
......@@ -439,7 +439,7 @@ void
dfield_print_raw(
/*=============*/
FILE* f, /* in: output stream */
dfield_t* dfield) /* in: dfield */
const dfield_t* dfield) /* in: dfield */
{
ulint len = dfield->len;
if (len != UNIV_SQL_NULL) {
......@@ -460,7 +460,7 @@ void
dtuple_print(
/*=========*/
FILE* f, /* in: output stream */
dtuple_t* tuple) /* in: tuple */
const dtuple_t* tuple) /* in: tuple */
{
ulint n_fields;
ulint i;
......@@ -555,7 +555,7 @@ dtuple_convert_big_rec(
i < dtuple_get_n_fields(entry); i++) {
ulint savings;
dfield = dtuple_get_nth_field(entry, i);
dfield = (dfield_t*) dtuple_get_nth_field(entry, i);
ifield = dict_index_get_nth_field(index, i);
/* Skip fixed-length or NULL or short columns */
......@@ -606,7 +606,7 @@ skip_field:
we can calculate all ordering fields in all indexes
from locally stored data. */
dfield = dtuple_get_nth_field(entry, longest_i);
dfield = (dfield_t*) dtuple_get_nth_field(entry, longest_i);
ifield = dict_index_get_nth_field(index, longest_i);
vector->fields[n_fields].field_no = longest_i;
......@@ -644,8 +644,9 @@ dtuple_convert_back_big_rec(
for (i = 0; i < vector->n_fields; i++) {
dfield = dtuple_get_nth_field(entry,
vector->fields[i].field_no);
dfield = (dfield_t*)
dtuple_get_nth_field(entry,
vector->fields[i].field_no);
dfield->data = vector->fields[i].data;
dfield->len = vector->fields[i].len;
}
......
......@@ -187,7 +187,7 @@ ibool
dtype_validate(
/*===========*/
/* out: TRUE if ok */
dtype_t* type) /* in: type struct to validate */
const dtype_t* type) /* in: type struct to validate */
{
ut_a(type);
ut_a((type->mtype >= DATA_VARCHAR) && (type->mtype <= DATA_MYSQL));
......@@ -207,7 +207,7 @@ Prints a data type structure. */
void
dtype_print(
/*========*/
dtype_t* type) /* in: type */
const dtype_t* type) /* in: type */
{
ulint mtype;
ulint prtype;
......
......@@ -50,18 +50,18 @@ dict_create_sys_tables_tuple(
entry = dtuple_create(heap, 8 + DATA_N_SYS_COLS);
/* 0: NAME -----------------------------*/
dfield = dtuple_get_nth_field(entry, 0);
dfield = (dfield_t*) dtuple_get_nth_field(entry, 0);
dfield_set_data(dfield, table->name, ut_strlen(table->name));
/* 3: ID -------------------------------*/
dfield = dtuple_get_nth_field(entry, 1);
dfield = (dfield_t*) dtuple_get_nth_field(entry, 1);
ptr = mem_heap_alloc(heap, 8);
mach_write_to_8(ptr, table->id);
dfield_set_data(dfield, ptr, 8);
/* 4: N_COLS ---------------------------*/
dfield = dtuple_get_nth_field(entry, 2);
dfield = (dfield_t*) dtuple_get_nth_field(entry, 2);
#if DICT_TF_COMPACT != 1
#error
......@@ -72,7 +72,7 @@ dict_create_sys_tables_tuple(
| ((table->flags & DICT_TF_COMPACT) << 31));
dfield_set_data(dfield, ptr, 4);
/* 5: TYPE -----------------------------*/
dfield = dtuple_get_nth_field(entry, 3);
dfield = (dfield_t*) dtuple_get_nth_field(entry, 3);
ptr = mem_heap_alloc(heap, 4);
if (table->flags & DICT_TF_COMPRESSED_MASK) {
......@@ -86,7 +86,7 @@ dict_create_sys_tables_tuple(
dfield_set_data(dfield, ptr, 4);
/* 6: MIX_ID (obsolete) ---------------------------*/
dfield = dtuple_get_nth_field(entry, 4);
dfield = (dfield_t*) dtuple_get_nth_field(entry, 4);
ptr = mem_heap_alloc(heap, 8);
memset(ptr, 0, 8);
......@@ -94,18 +94,18 @@ dict_create_sys_tables_tuple(
dfield_set_data(dfield, ptr, 8);
/* 7: MIX_LEN (obsolete) --------------------------*/
dfield = dtuple_get_nth_field(entry, 5);
dfield = (dfield_t*) dtuple_get_nth_field(entry, 5);
ptr = mem_heap_alloc(heap, 4);
memset(ptr, 0, 4);
dfield_set_data(dfield, ptr, 4);
/* 8: CLUSTER_NAME ---------------------*/
dfield = dtuple_get_nth_field(entry, 6);
dfield = (dfield_t*) dtuple_get_nth_field(entry, 6);
dfield_set_data(dfield, NULL, UNIV_SQL_NULL); /* not supported */
/* 9: SPACE ----------------------------*/
dfield = dtuple_get_nth_field(entry, 7);
dfield = (dfield_t*) dtuple_get_nth_field(entry, 7);
ptr = mem_heap_alloc(heap, 4);
mach_write_to_4(ptr, table->space);
......@@ -147,47 +147,47 @@ dict_create_sys_columns_tuple(
entry = dtuple_create(heap, 7 + DATA_N_SYS_COLS);
/* 0: TABLE_ID -----------------------*/
dfield = dtuple_get_nth_field(entry, 0);
dfield = (dfield_t*) dtuple_get_nth_field(entry, 0);
ptr = mem_heap_alloc(heap, 8);
mach_write_to_8(ptr, table->id);
dfield_set_data(dfield, ptr, 8);
/* 1: POS ----------------------------*/
dfield = dtuple_get_nth_field(entry, 1);
dfield = (dfield_t*) dtuple_get_nth_field(entry, 1);
ptr = mem_heap_alloc(heap, 4);
mach_write_to_4(ptr, i);
dfield_set_data(dfield, ptr, 4);
/* 4: NAME ---------------------------*/
dfield = dtuple_get_nth_field(entry, 2);
dfield = (dfield_t*) dtuple_get_nth_field(entry, 2);
col_name = dict_table_get_col_name(table, i);
dfield_set_data(dfield, col_name, ut_strlen(col_name));
/* 5: MTYPE --------------------------*/
dfield = dtuple_get_nth_field(entry, 3);
dfield = (dfield_t*) dtuple_get_nth_field(entry, 3);
ptr = mem_heap_alloc(heap, 4);
mach_write_to_4(ptr, column->mtype);
dfield_set_data(dfield, ptr, 4);
/* 6: PRTYPE -------------------------*/
dfield = dtuple_get_nth_field(entry, 4);
dfield = (dfield_t*) dtuple_get_nth_field(entry, 4);
ptr = mem_heap_alloc(heap, 4);
mach_write_to_4(ptr, column->prtype);
dfield_set_data(dfield, ptr, 4);
/* 7: LEN ----------------------------*/
dfield = dtuple_get_nth_field(entry, 5);
dfield = (dfield_t*) dtuple_get_nth_field(entry, 5);
ptr = mem_heap_alloc(heap, 4);
mach_write_to_4(ptr, column->len);
dfield_set_data(dfield, ptr, 4);
/* 8: PREC ---------------------------*/
dfield = dtuple_get_nth_field(entry, 6);
dfield = (dfield_t*) dtuple_get_nth_field(entry, 6);
ptr = mem_heap_alloc(heap, 4);
mach_write_to_4(ptr, 0/* unused */);
......@@ -338,32 +338,32 @@ dict_create_sys_indexes_tuple(
entry = dtuple_create(heap, 7 + DATA_N_SYS_COLS);
/* 0: TABLE_ID -----------------------*/
dfield = dtuple_get_nth_field(entry, 0);
dfield = (dfield_t*) dtuple_get_nth_field(entry, 0);
ptr = mem_heap_alloc(heap, 8);
mach_write_to_8(ptr, table->id);
dfield_set_data(dfield, ptr, 8);
/* 1: ID ----------------------------*/
dfield = dtuple_get_nth_field(entry, 1);
dfield = (dfield_t*) dtuple_get_nth_field(entry, 1);
ptr = mem_heap_alloc(heap, 8);
mach_write_to_8(ptr, index->id);
dfield_set_data(dfield, ptr, 8);
/* 4: NAME --------------------------*/
dfield = dtuple_get_nth_field(entry, 2);
dfield = (dfield_t*) dtuple_get_nth_field(entry, 2);
dfield_set_data(dfield, index->name, ut_strlen(index->name));
/* 5: N_FIELDS ----------------------*/
dfield = dtuple_get_nth_field(entry, 3);
dfield = (dfield_t*) dtuple_get_nth_field(entry, 3);
ptr = mem_heap_alloc(heap, 4);
mach_write_to_4(ptr, index->n_fields);
dfield_set_data(dfield, ptr, 4);
/* 6: TYPE --------------------------*/
dfield = dtuple_get_nth_field(entry, 4);
dfield = (dfield_t*) dtuple_get_nth_field(entry, 4);
ptr = mem_heap_alloc(heap, 4);
mach_write_to_4(ptr, index->type);
......@@ -375,7 +375,7 @@ dict_create_sys_indexes_tuple(
#error "DICT_SYS_INDEXES_SPACE_NO_FIELD != 7"
#endif
dfield = dtuple_get_nth_field(entry, 5);
dfield = (dfield_t*) dtuple_get_nth_field(entry, 5);
ptr = mem_heap_alloc(heap, 4);
mach_write_to_4(ptr, index->space);
......@@ -387,7 +387,7 @@ dict_create_sys_indexes_tuple(
#error "DICT_SYS_INDEXES_PAGE_NO_FIELD != 8"
#endif
dfield = dtuple_get_nth_field(entry, 6);
dfield = (dfield_t*) dtuple_get_nth_field(entry, 6);
ptr = mem_heap_alloc(heap, 4);
mach_write_to_4(ptr, FIL_NULL);
......@@ -436,7 +436,7 @@ dict_create_sys_fields_tuple(
entry = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
/* 0: INDEX_ID -----------------------*/
dfield = dtuple_get_nth_field(entry, 0);
dfield = (dfield_t*) dtuple_get_nth_field(entry, 0);
ptr = mem_heap_alloc(heap, 8);
mach_write_to_8(ptr, index->id);
......@@ -444,7 +444,7 @@ dict_create_sys_fields_tuple(
dfield_set_data(dfield, ptr, 8);
/* 1: POS + PREFIX LENGTH ----------------------------*/
dfield = dtuple_get_nth_field(entry, 1);
dfield = (dfield_t*) dtuple_get_nth_field(entry, 1);
ptr = mem_heap_alloc(heap, 4);
......@@ -464,7 +464,7 @@ dict_create_sys_fields_tuple(
dfield_set_data(dfield, ptr, 4);
/* 4: COL_NAME -------------------------*/
dfield = dtuple_get_nth_field(entry, 2);
dfield = (dfield_t*) dtuple_get_nth_field(entry, 2);
dfield_set_data(dfield, field->name,
ut_strlen(field->name));
......@@ -483,13 +483,13 @@ dtuple_t*
dict_create_search_tuple(
/*=====================*/
/* out: the tuple for search */
dtuple_t* tuple, /* in: the tuple inserted in the SYS_INDEXES
const dtuple_t* tuple, /* in: the tuple inserted in the SYS_INDEXES
table */
mem_heap_t* heap) /* in: memory heap from which the memory for
the built tuple is allocated */
{
dtuple_t* search_tuple;
dfield_t* field1;
const dfield_t* field1;
dfield_t* field2;
ut_ad(tuple && heap);
......@@ -497,12 +497,12 @@ dict_create_search_tuple(
search_tuple = dtuple_create(heap, 2);
field1 = dtuple_get_nth_field(tuple, 0);
field2 = dtuple_get_nth_field(search_tuple, 0);
field2 = (dfield_t*) dtuple_get_nth_field(search_tuple, 0);
dfield_copy(field2, field1);
field1 = dtuple_get_nth_field(tuple, 1);
field2 = dtuple_get_nth_field(search_tuple, 1);
field2 = (dfield_t*) dtuple_get_nth_field(search_tuple, 1);
dfield_copy(field2, field1);
......
......@@ -1622,7 +1622,8 @@ dict_index_copy_types(
dtype_t* dfield_type;
ifield = dict_index_get_nth_field(index, i);
dfield_type = dfield_get_type(dtuple_get_nth_field(tuple, i));
dfield_type = (dtype_t*)
dfield_get_type(dtuple_get_nth_field(tuple, i));
dict_col_copy_type(dict_field_get_col(ifield), dfield_type);
if (UNIV_UNLIKELY(ifield->prefix_len)) {
dfield_type->len = ifield->prefix_len;
......@@ -1644,7 +1645,8 @@ dict_table_copy_types(
for (i = 0; i < dtuple_get_n_fields(tuple); i++) {
dfield_type = dfield_get_type(dtuple_get_nth_field(tuple, i));
dfield_type = (dtype_t*)
dfield_get_type(dtuple_get_nth_field(tuple, i));
dict_col_copy_type(dict_table_get_nth_col(table, i),
dfield_type);
}
......@@ -3683,10 +3685,11 @@ dict_index_build_node_ptr(
mach_write_to_4(buf, page_no);
field = dtuple_get_nth_field(tuple, n_unique);
field = (dfield_t*) dtuple_get_nth_field(tuple, n_unique);
dfield_set_data(field, buf, 4);
dtype_set(dfield_get_type(field), DATA_SYS_CHILD, DATA_NOT_NULL, 4);
dtype_set((dtype_t*) dfield_get_type(field),
DATA_SYS_CHILD, DATA_NOT_NULL, 4);
rec_copy_prefix_to_dtuple(tuple, rec, index, n_unique, heap);
dtuple_set_info_bits(tuple, dtuple_get_info_bits(tuple)
......
......@@ -80,7 +80,7 @@ dict_get_first_table_name_in_db(
ut_a(!dict_table_is_comp(sys_tables));
tuple = dtuple_create(heap, 1);
dfield = dtuple_get_nth_field(tuple, 0);
dfield = (dfield_t*) dtuple_get_nth_field(tuple, 0);
dfield_set_data(dfield, name, ut_strlen(name));
dict_index_copy_types(tuple, sys_index, 1);
......@@ -408,7 +408,7 @@ dict_load_columns(
ut_a(!dict_table_is_comp(sys_columns));
tuple = dtuple_create(heap, 1);
dfield = dtuple_get_nth_field(tuple, 0);
dfield = (dfield_t*) dtuple_get_nth_field(tuple, 0);
buf = mem_heap_alloc(heap, 8);
mach_write_to_8(buf, table->id);
......@@ -535,7 +535,7 @@ dict_load_fields(
ut_a(!dict_table_is_comp(sys_fields));
tuple = dtuple_create(heap, 1);
dfield = dtuple_get_nth_field(tuple, 0);
dfield = (dfield_t*) dtuple_get_nth_field(tuple, 0);
buf = mem_heap_alloc(heap, 8);
mach_write_to_8(buf, index->id);
......@@ -648,7 +648,7 @@ dict_load_indexes(
ut_a(!dict_table_is_comp(sys_indexes));
tuple = dtuple_create(heap, 1);
dfield = dtuple_get_nth_field(tuple, 0);
dfield = (dfield_t*) dtuple_get_nth_field(tuple, 0);
buf = mem_heap_alloc(heap, 8);
mach_write_to_8(buf, table->id);
......@@ -812,7 +812,7 @@ dict_load_table(
ut_a(!dict_table_is_comp(sys_tables));
tuple = dtuple_create(heap, 1);
dfield = dtuple_get_nth_field(tuple, 0);
dfield = (dfield_t*) dtuple_get_nth_field(tuple, 0);
dfield_set_data(dfield, name, ut_strlen(name));
dict_index_copy_types(tuple, sys_index, 1);
......@@ -991,7 +991,7 @@ dict_load_table_on_id(
heap = mem_heap_create(256);
tuple = dtuple_create(heap, 1);
dfield = dtuple_get_nth_field(tuple, 0);
dfield = (dfield_t*) dtuple_get_nth_field(tuple, 0);
/* Write the table id in byte format to id_buf */
mach_write_to_8(id_buf, table_id);
......@@ -1105,7 +1105,7 @@ dict_load_foreign_cols(
ut_a(!dict_table_is_comp(sys_foreign_cols));
tuple = dtuple_create(foreign->heap, 1);
dfield = dtuple_get_nth_field(tuple, 0);
dfield = (dfield_t*) dtuple_get_nth_field(tuple, 0);
dfield_set_data(dfield, id, ut_strlen(id));
dict_index_copy_types(tuple, sys_index, 1);
......@@ -1179,7 +1179,7 @@ dict_load_foreign(
ut_a(!dict_table_is_comp(sys_foreign));
tuple = dtuple_create(heap2, 1);
dfield = dtuple_get_nth_field(tuple, 0);
dfield = (dfield_t*) dtuple_get_nth_field(tuple, 0);
dfield_set_data(dfield, id, ut_strlen(id));
dict_index_copy_types(tuple, sys_index, 1);
......@@ -1324,7 +1324,7 @@ start_load:
heap = mem_heap_create(256);
tuple = dtuple_create(heap, 1);
dfield = dtuple_get_nth_field(tuple, 0);
dfield = (dfield_t*) dtuple_get_nth_field(tuple, 0);
dfield_set_data(dfield, table_name, ut_strlen(table_name));
dict_index_copy_types(tuple, sec_index, 1);
......
......@@ -2570,10 +2570,10 @@ innobase_mysql_cmp(
equal, less than b, respectively */
int mysql_type, /* in: MySQL type */
uint charset_number, /* in: number of the charset */
unsigned char* a, /* in: data field */
const unsigned char* a, /* in: data field */
unsigned int a_length, /* in: data field length,
not UNIV_SQL_NULL */
unsigned char* b, /* in: data field */
const unsigned char* b, /* in: data field */
unsigned int b_length) /* in: data field length,
not UNIV_SQL_NULL */
{
......
......@@ -1173,7 +1173,7 @@ void
ibuf_dummy_index_add_col(
/*=====================*/
dict_index_t* index, /* in: dummy index */
dtype_t* type, /* in: the data type of the column */
const dtype_t* type, /* in: the data type of the column */
ulint len) /* in: length of the column */
{
ulint i = index->table->n_def;
......@@ -1246,14 +1246,14 @@ ibuf_build_entry_from_ibuf_rec(
ut_a(len == n_fields * DATA_ORDER_NULL_TYPE_BUF_SIZE);
for (i = 0; i < n_fields; i++) {
field = dtuple_get_nth_field(tuple, i);
field = (dfield_t*) dtuple_get_nth_field(tuple, i);
data = rec_get_nth_field_old(ibuf_rec, i + 2, &len);
dfield_set_data(field, data, len);
dtype_read_for_order_and_null_size(
dfield_get_type(field),
(dtype_t*) dfield_get_type(field),
types + i * DATA_ORDER_NULL_TYPE_BUF_SIZE);
}
......@@ -1287,14 +1287,14 @@ ibuf_build_entry_from_ibuf_rec(
ut_a(len == n_fields * DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE);
for (i = 0; i < n_fields; i++) {
field = dtuple_get_nth_field(tuple, i);
field = (dfield_t*) dtuple_get_nth_field(tuple, i);
data = rec_get_nth_field_old(ibuf_rec, i + 4, &len);
dfield_set_data(field, data, len);
dtype_new_read_for_order_and_null_size(
dfield_get_type(field),
(dtype_t*) dfield_get_type(field),
types + i * DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE);
ibuf_dummy_index_add_col(index, dfield_get_type(field), len);
......@@ -1414,7 +1414,7 @@ ibuf_entry_build(
{
dtuple_t* tuple;
dfield_t* field;
dfield_t* entry_field;
const dfield_t* entry_field;
ulint n_fields;
byte* buf;
byte* buf2;
......@@ -1440,7 +1440,7 @@ ibuf_entry_build(
/* Store the space id in tuple */
field = dtuple_get_nth_field(tuple, 0);
field = (dfield_t*) dtuple_get_nth_field(tuple, 0);
buf = mem_heap_alloc(heap, 4);
......@@ -1450,7 +1450,7 @@ ibuf_entry_build(
/* Store the marker byte field in tuple */
field = dtuple_get_nth_field(tuple, 1);
field = (dfield_t*) dtuple_get_nth_field(tuple, 1);
buf = mem_heap_alloc(heap, 1);
......@@ -1462,7 +1462,7 @@ ibuf_entry_build(
/* Store the page number in tuple */
field = dtuple_get_nth_field(tuple, 2);
field = (dfield_t*) dtuple_get_nth_field(tuple, 2);
buf = mem_heap_alloc(heap, 4);
......@@ -1482,7 +1482,7 @@ ibuf_entry_build(
/* We add 4 below because we have the 4 extra fields at the
start of an ibuf record */
field = dtuple_get_nth_field(tuple, i + 4);
field = (dfield_t*) dtuple_get_nth_field(tuple, i + 4);
entry_field = dtuple_get_nth_field(entry, i);
dfield_copy(field, entry_field);
......@@ -1494,7 +1494,7 @@ ibuf_entry_build(
/* Store the type info in buf2 to field 3 of tuple */
field = dtuple_get_nth_field(tuple, 3);
field = (dfield_t*) dtuple_get_nth_field(tuple, 3);
if (dict_table_is_comp(index->table)) {
buf2--;
......@@ -1534,7 +1534,7 @@ ibuf_search_tuple_build(
/* Store the page number in tuple */
field = dtuple_get_nth_field(tuple, 0);
field = (dfield_t*) dtuple_get_nth_field(tuple, 0);
buf = mem_heap_alloc(heap, 4);
......@@ -1569,7 +1569,7 @@ ibuf_new_search_tuple_build(
/* Store the space id in tuple */
field = dtuple_get_nth_field(tuple, 0);
field = (dfield_t*) dtuple_get_nth_field(tuple, 0);
buf = mem_heap_alloc(heap, 4);
......@@ -1579,7 +1579,7 @@ ibuf_new_search_tuple_build(
/* Store the new format record marker byte */
field = dtuple_get_nth_field(tuple, 1);
field = (dfield_t*) dtuple_get_nth_field(tuple, 1);
buf = mem_heap_alloc(heap, 1);
......@@ -1589,7 +1589,7 @@ ibuf_new_search_tuple_build(
/* Store the page number in tuple */
field = dtuple_get_nth_field(tuple, 2);
field = (dfield_t*) dtuple_get_nth_field(tuple, 2);
buf = mem_heap_alloc(heap, 4);
......
......@@ -29,23 +29,23 @@ dfield_get_data_noninline(
dfield_t* field); /* in: field */
ulint
dfield_get_len_noninline(
dfield_t* field); /* in: field */
const dfield_t* field); /* in: field */
ulint
dtuple_get_n_fields_noninline(
dtuple_t* tuple); /* in: tuple */
dfield_t*
const dtuple_t* tuple); /* in: tuple */
const dfield_t*
dtuple_get_nth_field_noninline(
dtuple_t* tuple, /* in: tuple */
const dtuple_t* tuple, /* in: tuple */
ulint n); /* in: index of field */
/*************************************************************************
Gets pointer to the type struct of SQL data field. */
UNIV_INLINE
dtype_t*
const dtype_t*
dfield_get_type(
/*============*/
/* out: pointer to the type struct */
dfield_t* field); /* in: SQL data field */
const dfield_t* field); /* in: SQL data field */
/*************************************************************************
Sets the type struct of SQL data field. */
UNIV_INLINE
......@@ -70,7 +70,7 @@ dfield_get_len(
/*===========*/
/* out: length of data; UNIV_SQL_NULL if
SQL null data */
dfield_t* field); /* in: field */
const dfield_t* field); /* in: field */
/*************************************************************************
Sets length in a field. */
UNIV_INLINE
......@@ -111,7 +111,7 @@ void
dfield_copy(
/*========*/
dfield_t* field1, /* in: field to copy to */
dfield_t* field2);/* in: field to copy from */
const dfield_t* field2);/* in: field to copy from */
/*************************************************************************
Tests if data length and content is equal for two dfields. */
UNIV_INLINE
......@@ -119,8 +119,8 @@ ibool
dfield_datas_are_binary_equal(
/*==========================*/
/* out: TRUE if equal */
dfield_t* field1, /* in: field */
dfield_t* field2);/* in: field */
const dfield_t* field1, /* in: field */
const dfield_t* field2);/* in: field */
/*************************************************************************
Tests if dfield data length and content is equal to the given. */
......@@ -128,9 +128,9 @@ ibool
dfield_data_is_binary_equal(
/*========================*/
/* out: TRUE if equal */
dfield_t* field, /* in: field */
const dfield_t* field, /* in: field */
ulint len, /* in: data length or UNIV_SQL_NULL */
byte* data); /* in: data */
const byte* data); /* in: data */
/*************************************************************************
Gets number of fields in a data tuple. */
UNIV_INLINE
......@@ -138,15 +138,15 @@ ulint
dtuple_get_n_fields(
/*================*/
/* out: number of fields */
dtuple_t* tuple); /* in: tuple */
const dtuple_t* tuple); /* in: tuple */
/*************************************************************************
Gets nth field of a tuple. */
UNIV_INLINE
dfield_t*
const dfield_t*
dtuple_get_nth_field(
/*=================*/
/* out: nth field */
dtuple_t* tuple, /* in: tuple */
const dtuple_t* tuple, /* in: tuple */
ulint n); /* in: index of field */
/*************************************************************************
Gets info bits in a data tuple. */
......@@ -155,7 +155,7 @@ ulint
dtuple_get_info_bits(
/*=================*/
/* out: info bits */
dtuple_t* tuple); /* in: tuple */
const dtuple_t* tuple); /* in: tuple */
/*************************************************************************
Sets info bits in a data tuple. */
UNIV_INLINE
......@@ -172,7 +172,7 @@ dtuple_get_n_fields_cmp(
/*====================*/
/* out: number of fields used in comparisons
in rem0cmp.* */
dtuple_t* tuple); /* in: tuple */
const dtuple_t* tuple); /* in: tuple */
/*************************************************************************
Gets number of fields used in record comparisons. */
UNIV_INLINE
......@@ -227,7 +227,7 @@ ulint
dtuple_get_data_size(
/*=================*/
/* out: sum of data lens */
dtuple_t* tuple); /* in: typed data tuple */
const dtuple_t* tuple); /* in: typed data tuple */
/****************************************************************
Returns TRUE if lengths of two dtuples are equal and respective data fields
in them are equal when compared with collation in char fields (not as binary
......@@ -240,8 +240,8 @@ dtuple_datas_are_ordering_equal(
when compared with cmp_data_data:
NOTE: in character type fields some letters
are identified with others! (collation) */
dtuple_t* tuple1, /* in: tuple 1 */
dtuple_t* tuple2);/* in: tuple 2 */
const dtuple_t* tuple1, /* in: tuple 1 */
const dtuple_t* tuple2);/* in: tuple 2 */
/****************************************************************
Folds a prefix given as the number of fields of a tuple. */
UNIV_INLINE
......@@ -249,7 +249,7 @@ ulint
dtuple_fold(
/*========*/
/* out: the folded value */
dtuple_t* tuple, /* in: the tuple */
const dtuple_t* tuple, /* in: the tuple */
ulint n_fields,/* in: number of complete fields to fold */
ulint n_bytes,/* in: number of bytes to fold in an
incomplete last field */
......@@ -269,7 +269,7 @@ ibool
dtuple_contains_null(
/*=================*/
/* out: TRUE if some field is SQL null */
dtuple_t* tuple); /* in: dtuple */
const dtuple_t* tuple); /* in: dtuple */
/**************************************************************
Checks that a data field is typed. Asserts an error if not. */
......@@ -277,7 +277,7 @@ ibool
dfield_check_typed(
/*===============*/
/* out: TRUE if ok */
dfield_t* field); /* in: data field */
const dfield_t* field); /* in: data field */
/**************************************************************
Checks that a data tuple is typed. Asserts an error if not. */
......@@ -285,7 +285,7 @@ ibool
dtuple_check_typed(
/*===============*/
/* out: TRUE if ok */
dtuple_t* tuple); /* in: tuple */
const dtuple_t* tuple); /* in: tuple */
/**************************************************************
Checks that a data tuple is typed. */
......@@ -293,7 +293,7 @@ ibool
dtuple_check_typed_no_assert(
/*=========================*/
/* out: TRUE if ok */
dtuple_t* tuple); /* in: tuple */
const dtuple_t* tuple); /* in: tuple */
#ifdef UNIV_DEBUG
/**************************************************************
Validates the consistency of a tuple which must be complete, i.e,
......@@ -303,7 +303,7 @@ ibool
dtuple_validate(
/*============*/
/* out: TRUE if ok */
dtuple_t* tuple); /* in: tuple */
const dtuple_t* tuple); /* in: tuple */
#endif /* UNIV_DEBUG */
/*****************************************************************
Pretty prints a dfield value according to its data type. */
......@@ -311,7 +311,7 @@ Pretty prints a dfield value according to its data type. */
void
dfield_print(
/*=========*/
dfield_t* dfield);/* in: dfield */
const dfield_t* dfield);/* in: dfield */
/*****************************************************************
Pretty prints a dfield value according to its data type. Also the hex string
is printed if a string contains non-printable characters. */
......@@ -319,7 +319,7 @@ is printed if a string contains non-printable characters. */
void
dfield_print_also_hex(
/*==================*/
dfield_t* dfield); /* in: dfield */
const dfield_t* dfield); /* in: dfield */
/**************************************************************
The following function prints the contents of a tuple. */
......@@ -327,7 +327,7 @@ void
dtuple_print(
/*=========*/
FILE* f, /* in: output stream */
dtuple_t* tuple); /* in: tuple */
const dtuple_t* tuple); /* in: tuple */
/******************************************************************
Moves parts of long fields in entry to the big record vector so that
the size of tuple drops below the maximum record size allowed in the
......
......@@ -16,11 +16,11 @@ extern byte data_error;
/*************************************************************************
Gets pointer to the type struct of SQL data field. */
UNIV_INLINE
dtype_t*
const dtype_t*
dfield_get_type(
/*============*/
/* out: pointer to the type struct */
dfield_t* field) /* in: SQL data field */
const dfield_t* field) /* in: SQL data field */
{
ut_ad(field);
......@@ -65,7 +65,7 @@ dfield_get_len(
/*===========*/
/* out: length of data; UNIV_SQL_NULL if
SQL null data */
dfield_t* field) /* in: field */
const dfield_t* field) /* in: field */
{
ut_ad(field);
ut_ad((field->len == UNIV_SQL_NULL)
......@@ -126,7 +126,7 @@ void
dfield_copy(
/*========*/
dfield_t* field1, /* in: field to copy to */
dfield_t* field2) /* in: field to copy from */
const dfield_t* field2) /* in: field to copy from */
{
*field1 = *field2;
}
......@@ -138,8 +138,8 @@ ibool
dfield_datas_are_binary_equal(
/*==========================*/
/* out: TRUE if equal */
dfield_t* field1, /* in: field */
dfield_t* field2) /* in: field */
const dfield_t* field1, /* in: field */
const dfield_t* field2) /* in: field */
{
ulint len;
......@@ -163,7 +163,7 @@ ulint
dtuple_get_info_bits(
/*=================*/
/* out: info bits */
dtuple_t* tuple) /* in: tuple */
const dtuple_t* tuple) /* in: tuple */
{
ut_ad(tuple);
......@@ -192,7 +192,7 @@ dtuple_get_n_fields_cmp(
/*====================*/
/* out: number of fields used in comparisons
in rem0cmp.* */
dtuple_t* tuple) /* in: tuple */
const dtuple_t* tuple) /* in: tuple */
{
ut_ad(tuple);
......@@ -222,7 +222,7 @@ ulint
dtuple_get_n_fields(
/*================*/
/* out: number of fields */
dtuple_t* tuple) /* in: tuple */
const dtuple_t* tuple) /* in: tuple */
{
ut_ad(tuple);
......@@ -232,11 +232,11 @@ dtuple_get_n_fields(
/*************************************************************************
Gets nth field of a tuple. */
UNIV_INLINE
dfield_t*
const dfield_t*
dtuple_get_nth_field(
/*=================*/
/* out: nth field */
dtuple_t* tuple, /* in: tuple */
const dtuple_t* tuple, /* in: tuple */
ulint n) /* in: index of field */
{
ut_ad(tuple);
......@@ -276,7 +276,7 @@ dtuple_create(
for (i = 0; i < n_fields; i++) {
(tuple->fields + i)->data = &data_error;
dfield_get_type(tuple->fields + i)->mtype = DATA_ERROR;
(tuple->fields + i)->type.mtype = DATA_ERROR;
}
}
#endif
......@@ -292,9 +292,9 @@ ulint
dtuple_get_data_size(
/*=================*/
/* out: sum of data lengths */
dtuple_t* tuple) /* in: typed data tuple */
const dtuple_t* tuple) /* in: typed data tuple */
{
dfield_t* field;
const dfield_t* field;
ulint n_fields;
ulint len;
ulint i;
......@@ -333,7 +333,8 @@ dtuple_set_types_binary(
ulint i;
for (i = 0; i < n; i++) {
dfield_type = dfield_get_type(dtuple_get_nth_field(tuple, i));
dfield_type = (dtype_t*)
dfield_get_type(dtuple_get_nth_field(tuple, i));
dtype_set(dfield_type, DATA_BINARY, 0, 0);
}
}
......@@ -345,15 +346,15 @@ ulint
dtuple_fold(
/*========*/
/* out: the folded value */
dtuple_t* tuple, /* in: the tuple */
const dtuple_t* tuple, /* in: the tuple */
ulint n_fields,/* in: number of complete fields to fold */
ulint n_bytes,/* in: number of bytes to fold in an
incomplete last field */
dulint tree_id)/* in: index tree id */
{
dfield_t* field;
const dfield_t* field;
ulint i;
byte* data;
const byte* data;
ulint len;
ulint fold;
......@@ -366,7 +367,7 @@ dtuple_fold(
for (i = 0; i < n_fields; i++) {
field = dtuple_get_nth_field(tuple, i);
data = (byte*) dfield_get_data(field);
data = (const byte*) dfield_get_data((dfield_t*) field);
len = dfield_get_len(field);
if (len != UNIV_SQL_NULL) {
......@@ -378,7 +379,7 @@ dtuple_fold(
if (n_bytes > 0) {
field = dtuple_get_nth_field(tuple, i);
data = (byte*) dfield_get_data(field);
data = (const byte*) dfield_get_data((dfield_t*) field);
len = dfield_get_len(field);
if (len != UNIV_SQL_NULL) {
......@@ -417,7 +418,7 @@ ibool
dtuple_contains_null(
/*=================*/
/* out: TRUE if some field is SQL null */
dtuple_t* tuple) /* in: dtuple */
const dtuple_t* tuple) /* in: dtuple */
{
ulint n;
ulint i;
......
......@@ -157,7 +157,7 @@ dtype_get_mysql_type(
/*=================*/
/* out: MySQL type code; this is NOT an InnoDB
type code! */
dtype_t* type); /* in: type struct */
const dtype_t* type); /* in: type struct */
/*************************************************************************
Determine how many bytes the first n characters of the given string occupy.
If the string is shorter than n characters, returns the number of bytes
......@@ -235,14 +235,14 @@ UNIV_INLINE
ulint
dtype_get_mtype(
/*============*/
dtype_t* type);
const dtype_t* type);
/*************************************************************************
Gets the precise data type. */
UNIV_INLINE
ulint
dtype_get_prtype(
/*=============*/
dtype_t* type);
const dtype_t* type);
/*************************************************************************
Compute the mbminlen and mbmaxlen members of a data type structure. */
UNIV_INLINE
......@@ -285,7 +285,7 @@ UNIV_INLINE
ulint
dtype_get_len(
/*==========*/
dtype_t* type);
const dtype_t* type);
/*************************************************************************
Gets the minimum length of a character, in bytes. */
UNIV_INLINE
......@@ -366,7 +366,7 @@ void
dtype_read_for_order_and_null_size(
/*===============================*/
dtype_t* type, /* in: type struct */
byte* buf); /* in: buffer for the stored order info */
const byte* buf); /* in: buffer for the stored order info */
/**************************************************************************
Stores for a type the information which determines its alphabetical ordering
and the storage size of an SQL NULL value. This is the >= 4.1.x storage
......@@ -378,7 +378,7 @@ dtype_new_store_for_order_and_null_size(
byte* buf, /* in: buffer for
DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE
bytes where we store the info */
dtype_t* type, /* in: type struct */
const dtype_t* type, /* in: type struct */
ulint prefix_len);/* in: prefix length to
replace type->len, or 0 */
/**************************************************************************
......@@ -390,7 +390,7 @@ void
dtype_new_read_for_order_and_null_size(
/*===================================*/
dtype_t* type, /* in: type struct */
byte* buf); /* in: buffer for stored type order info */
const byte* buf); /* in: buffer for stored type order info */
/*************************************************************************
Validates a data type structure. */
......@@ -399,14 +399,14 @@ ibool
dtype_validate(
/*===========*/
/* out: TRUE if ok */
dtype_t* type); /* in: type struct to validate */
const dtype_t* type); /* in: type struct to validate */
/*************************************************************************
Prints a data type structure. */
void
dtype_print(
/*========*/
dtype_t* type); /* in: type */
const dtype_t* type); /* in: type */
/* Structure for an SQL data type.
If you add fields to this structure, be sure to initialize them everywhere.
......
......@@ -42,7 +42,7 @@ dtype_get_mysql_type(
/*=================*/
/* out: MySQL type code; this is NOT an InnoDB
type code! */
dtype_t* type) /* in: type struct */
const dtype_t* type) /* in: type struct */
{
return(type->prtype & 0xFFUL);
}
......@@ -135,7 +135,7 @@ UNIV_INLINE
ulint
dtype_get_mtype(
/*============*/
dtype_t* type)
const dtype_t* type)
{
ut_ad(type);
......@@ -148,7 +148,7 @@ UNIV_INLINE
ulint
dtype_get_prtype(
/*=============*/
dtype_t* type)
const dtype_t* type)
{
ut_ad(type);
......@@ -161,7 +161,7 @@ UNIV_INLINE
ulint
dtype_get_len(
/*==========*/
dtype_t* type)
const dtype_t* type)
{
ut_ad(type);
......@@ -246,7 +246,7 @@ dtype_new_store_for_order_and_null_size(
byte* buf, /* in: buffer for
DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE
bytes where we store the info */
dtype_t* type, /* in: type struct */
const dtype_t* type, /* in: type struct */
ulint prefix_len)/* in: prefix length to
replace type->len, or 0 */
{
......@@ -289,7 +289,7 @@ void
dtype_read_for_order_and_null_size(
/*===============================*/
dtype_t* type, /* in: type struct */
byte* buf) /* in: buffer for stored type order info */
const byte* buf) /* in: buffer for stored type order info */
{
#if 4 != DATA_ORDER_NULL_TYPE_BUF_SIZE
# error "4 != DATA_ORDER_NULL_TYPE_BUF_SIZE"
......@@ -318,7 +318,7 @@ void
dtype_new_read_for_order_and_null_size(
/*===================================*/
dtype_t* type, /* in: type struct */
byte* buf) /* in: buffer for stored type order info */
const byte* buf) /* in: buffer for stored type order info */
{
ulint charset_coll;
......
......@@ -38,10 +38,10 @@ cmp_data_data(
less than data2, respectively */
ulint mtype, /* in: main type */
ulint prtype, /* in: precise type */
byte* data1, /* in: data field (== a pointer to a memory
const byte* data1, /* in: data field (== a pointer to a memory
buffer) */
ulint len1, /* in: data field length or UNIV_SQL_NULL */
byte* data2, /* in: data field (== a pointer to a memory
const byte* data2, /* in: data field (== a pointer to a memory
buffer) */
ulint len2); /* in: data field length or UNIV_SQL_NULL */
/*****************************************************************
......@@ -55,10 +55,10 @@ cmp_data_data_slow(
less than data2, respectively */
ulint mtype, /* in: main type */
ulint prtype, /* in: precise type */
byte* data1, /* in: data field (== a pointer to a memory
const byte* data1, /* in: data field (== a pointer to a memory
buffer) */
ulint len1, /* in: data field length or UNIV_SQL_NULL */
byte* data2, /* in: data field (== a pointer to a memory
const byte* data2, /* in: data field (== a pointer to a memory
buffer) */
ulint len2); /* in: data field length or UNIV_SQL_NULL */
/*****************************************************************
......@@ -70,8 +70,8 @@ cmp_dfield_dfield(
/*==============*/
/* out: 1, 0, -1, if dfield1 is greater, equal,
less than dfield2, respectively */
dfield_t* dfield1,/* in: data field; must have type field set */
dfield_t* dfield2);/* in: data field */
const dfield_t* dfield1,/* in: data field; must have type field set */
const dfield_t* dfield2);/* in: data field */
/*****************************************************************
This function is used to compare a data tuple to a physical record.
Only dtuple->n_fields_cmp first fields are taken into account for
......@@ -89,8 +89,8 @@ cmp_dtuple_rec_with_match(
common first fields are compared, or
until the first externally stored field in
rec */
dtuple_t* dtuple, /* in: data tuple */
rec_t* rec, /* in: physical record which differs from
const dtuple_t* dtuple, /* in: data tuple */
const rec_t* rec, /* in: physical record which differs from
dtuple in some of the common fields, or which
has an equal number or more fields than
dtuple */
......@@ -111,8 +111,8 @@ cmp_dtuple_rec(
/* out: 1, 0, -1, if dtuple is greater, equal,
less than rec, respectively; see the comments
for cmp_dtuple_rec_with_match */
dtuple_t* dtuple, /* in: data tuple */
rec_t* rec, /* in: physical record */
const dtuple_t* dtuple, /* in: data tuple */
const rec_t* rec, /* in: physical record */
const ulint* offsets);/* in: array returned by rec_get_offsets() */
/******************************************************************
Checks if a dtuple is a prefix of a record. The last field in dtuple
......@@ -122,8 +122,8 @@ ibool
cmp_dtuple_is_prefix_of_rec(
/*========================*/
/* out: TRUE if prefix */
dtuple_t* dtuple, /* in: data tuple */
rec_t* rec, /* in: physical record */
const dtuple_t* dtuple, /* in: data tuple */
const rec_t* rec, /* in: physical record */
const ulint* offsets);/* in: array returned by rec_get_offsets() */
/*****************************************************************
This function is used to compare two physical records. Only the common
......@@ -136,8 +136,8 @@ cmp_rec_rec_with_match(
/* out: 1, 0 , -1 if rec1 is greater, equal,
less, respectively, than rec2; only the common
first fields are compared */
rec_t* rec1, /* in: physical record */
rec_t* rec2, /* in: physical record */
const rec_t* rec1, /* in: physical record */
const rec_t* rec2, /* in: physical record */
const ulint* offsets1,/* in: rec_get_offsets(rec1, index) */
const ulint* offsets2,/* in: rec_get_offsets(rec2, index) */
dict_index_t* index, /* in: data dictionary index */
......@@ -159,8 +159,8 @@ cmp_rec_rec(
/* out: 1, 0 , -1 if rec1 is greater, equal,
less, respectively, than rec2; only the common
first fields are compared */
rec_t* rec1, /* in: physical record */
rec_t* rec2, /* in: physical record */
const rec_t* rec1, /* in: physical record */
const rec_t* rec2, /* in: physical record */
const ulint* offsets1,/* in: rec_get_offsets(rec1, index) */
const ulint* offsets2,/* in: rec_get_offsets(rec2, index) */
dict_index_t* index); /* in: data dictionary index */
......
......@@ -17,10 +17,10 @@ cmp_data_data(
less than data2, respectively */
ulint mtype, /* in: main type */
ulint prtype, /* in: precise type */
byte* data1, /* in: data field (== a pointer to a memory
const byte* data1, /* in: data field (== a pointer to a memory
buffer) */
ulint len1, /* in: data field length or UNIV_SQL_NULL */
byte* data2, /* in: data field (== a pointer to a memory
const byte* data2, /* in: data field (== a pointer to a memory
buffer) */
ulint len2) /* in: data field length or UNIV_SQL_NULL */
{
......@@ -36,8 +36,8 @@ cmp_dfield_dfield(
/*==============*/
/* out: 1, 0, -1, if dfield1 is greater, equal,
less than dfield2, respectively */
dfield_t* dfield1,/* in: data field; must have type field set */
dfield_t* dfield2)/* in: data field */
const dfield_t* dfield1,/* in: data field; must have type field set */
const dfield_t* dfield2)/* in: data field */
{
const dtype_t* type;
......@@ -46,9 +46,9 @@ cmp_dfield_dfield(
type = dfield_get_type(dfield1);
return(cmp_data_data(type->mtype, type->prtype,
dfield_get_data(dfield1),
dfield_get_data((dfield_t*) dfield1),
dfield_get_len(dfield1),
dfield_get_data(dfield2),
dfield_get_data((dfield_t*) dfield2),
dfield_get_len(dfield2)));
}
......@@ -62,8 +62,8 @@ cmp_rec_rec(
/* out: 1, 0 , -1 if rec1 is greater, equal,
less, respectively, than rec2; only the common
first fields are compared */
rec_t* rec1, /* in: physical record */
rec_t* rec2, /* in: physical record */
const rec_t* rec1, /* in: physical record */
const rec_t* rec2, /* in: physical record */
const ulint* offsets1,/* in: rec_get_offsets(rec1, index) */
const ulint* offsets2,/* in: rec_get_offsets(rec2, index) */
dict_index_t* index) /* in: data dictionary index */
......
......@@ -596,7 +596,7 @@ rec_convert_dtuple_to_rec(
byte* buf, /* in: start address of the
physical record */
dict_index_t* index, /* in: record descriptor */
dtuple_t* dtuple, /* in: data tuple */
const dtuple_t* dtuple, /* in: data tuple */
const ulint* ext, /* in: array of extern field numbers,
in ascending order */
ulint n_ext); /* in: number of elements in ext */
......
......@@ -59,7 +59,7 @@ dtuple_t*
row_build_index_entry(
/*==================*/
/* out: index entry which should be inserted */
dtuple_t* row, /* in: row which should be inserted to the
const dtuple_t* row, /* in: row which should be inserted to the
table */
row_ext_t* ext, /* in: externally stored column prefixes,
or NULL */
......
......@@ -88,7 +88,7 @@ row_build_row_ref_fast(
ref_len = dtuple_get_n_fields(ref);
for (i = 0; i < ref_len; i++) {
dfield = dtuple_get_nth_field(ref, i);
dfield = (dfield_t*) dtuple_get_nth_field(ref, i);
field_no = *(map + i);
......
......@@ -154,8 +154,8 @@ row_upd_build_sec_rec_difference_binary(
/* out, own: update vector of differing
fields */
dict_index_t* index, /* in: index */
dtuple_t* entry, /* in: entry to insert */
rec_t* rec, /* in: secondary index record */
const dtuple_t* entry, /* in: entry to insert */
const rec_t* rec, /* in: secondary index record */
trx_t* trx, /* in: transaction */
mem_heap_t* heap); /* in: memory heap from which allocated */
/*******************************************************************
......@@ -169,8 +169,8 @@ row_upd_build_difference_binary(
/* out, own: update vector of differing
fields, excluding roll ptr and trx id */
dict_index_t* index, /* in: clustered index */
dtuple_t* entry, /* in: entry to insert */
ulint* ext_vec,/* in: array containing field numbers of
const dtuple_t* entry, /* in: entry to insert */
const ulint* ext_vec,/* in: array containing field numbers of
externally stored fields in entry, or NULL */
ulint n_ext_vec,/* in: number of fields in ext_vec */
rec_t* rec, /* in: clustered index record */
......
......@@ -95,7 +95,7 @@ upd_field_set_field_no(
}
dict_col_copy_type(dict_index_get_nth_col(index, field_no),
dfield_get_type(&(upd_field->new_val)));
(dtype_t*) dfield_get_type(&(upd_field->new_val)));
}
/*************************************************************************
......
......@@ -350,10 +350,10 @@ page_create_low(
/* Create first a data tuple for infimum record */
tuple = dtuple_create(heap, 1);
dtuple_set_info_bits(tuple, REC_STATUS_INFIMUM);
field = dtuple_get_nth_field(tuple, 0);
field = (dfield_t*) dtuple_get_nth_field(tuple, 0);
dfield_set_data(field, "infimum", 8);
dtype_set(dfield_get_type(field),
dtype_set((dtype_t*) dfield_get_type(field),
DATA_VARCHAR, DATA_ENGLISH | DATA_NOT_NULL, 8);
/* Set the corresponding physical record to its place in the page
record heap */
......@@ -384,10 +384,10 @@ page_create_low(
tuple = dtuple_create(heap, 1);
dtuple_set_info_bits(tuple, REC_STATUS_SUPREMUM);
field = dtuple_get_nth_field(tuple, 0);
field = (dfield_t*) dtuple_get_nth_field(tuple, 0);
dfield_set_data(field, "supremum", comp ? 8 : 9);
dtype_set(dfield_get_type(field),
dtype_set((dtype_t*) dfield_get_type(field),
DATA_VARCHAR, DATA_ENGLISH | DATA_NOT_NULL, comp ? 8 : 9);
supremum_rec = rec_convert_dtuple_to_rec(heap_top, index,
......
......@@ -505,7 +505,7 @@ pars_resolve_exp_columns(
sym_node->prefetch_buf = NULL;
dict_col_copy_type(
col,
col, (dtype_t*)
dfield_get_type(&sym_node
->common.val));
......@@ -1132,23 +1132,24 @@ pars_set_dfield_type(
if (type == &pars_int_token) {
ut_a(len == 0);
dtype_set(dfield_get_type(dfield), DATA_INT, flags, 4);
dtype_set((dtype_t*) dfield_get_type(dfield),
DATA_INT, flags, 4);
} else if (type == &pars_char_token) {
ut_a(len == 0);
dtype_set(dfield_get_type(dfield), DATA_VARCHAR,
DATA_ENGLISH | flags, 0);
dtype_set((dtype_t*) dfield_get_type(dfield),
DATA_VARCHAR, DATA_ENGLISH | flags, 0);
} else if (type == &pars_binary_token) {
ut_a(len != 0);
dtype_set(dfield_get_type(dfield), DATA_FIXBINARY,
DATA_BINARY_TYPE | flags, len);
dtype_set((dtype_t*) dfield_get_type(dfield),
DATA_FIXBINARY, DATA_BINARY_TYPE | flags, len);
} else if (type == &pars_blob_token) {
ut_a(len == 0);
dtype_set(dfield_get_type(dfield), DATA_BLOB,
DATA_BINARY_TYPE | flags, 0);
dtype_set((dtype_t*) dfield_get_type(dfield),
DATA_BLOB, DATA_BINARY_TYPE | flags, 0);
} else {
ut_error;
}
......@@ -1620,7 +1621,7 @@ pars_create_table(
dict_table_t* table;
sym_node_t* column;
tab_node_t* node;
dtype_t* dtype;
const dtype_t* dtype;
ulint n_cols;
n_cols = que_node_list_get_len(column_defs);
......
......@@ -46,8 +46,8 @@ cmp_debug_dtuple_rec_with_match(
/* out: 1, 0, -1, if dtuple is greater, equal,
less than rec, respectively, when only the
common first fields are compared */
dtuple_t* dtuple, /* in: data tuple */
rec_t* rec, /* in: physical record which differs from
const dtuple_t* dtuple, /* in: data tuple */
const rec_t* rec, /* in: physical record which differs from
dtuple in some of the common fields, or which
has an equal number or more fields than
dtuple */
......@@ -70,10 +70,10 @@ innobase_mysql_cmp(
equal, less than b, respectively */
int mysql_type, /* in: MySQL type */
uint charset_number, /* in: number of the charset */
unsigned char* a, /* in: data field */
const unsigned char* a, /* in: data field */
unsigned int a_length, /* in: data field length,
not UNIV_SQL_NULL */
unsigned char* b, /* in: data field */
const unsigned char* b, /* in: data field */
unsigned int b_length); /* in: data field length,
not UNIV_SQL_NULL */
#endif /* !UNIV_HOTBACKUP */
......@@ -157,10 +157,10 @@ cmp_whole_field(
equal, less than b, respectively */
ulint mtype, /* in: main type */
ulint prtype, /* in: precise type */
unsigned char* a, /* in: data field */
const byte* a, /* in: data field */
unsigned int a_length, /* in: data field length,
not UNIV_SQL_NULL */
unsigned char* b, /* in: data field */
const byte* b, /* in: data field */
unsigned int b_length) /* in: data field length,
not UNIV_SQL_NULL */
{
......@@ -285,10 +285,10 @@ cmp_data_data_slow(
less than data2, respectively */
ulint mtype, /* in: main type */
ulint prtype, /* in: precise type */
byte* data1, /* in: data field (== a pointer to a memory
const byte* data1, /* in: data field (== a pointer to a memory
buffer) */
ulint len1, /* in: data field length or UNIV_SQL_NULL */
byte* data2, /* in: data field (== a pointer to a memory
const byte* data2, /* in: data field (== a pointer to a memory
buffer) */
ulint len2) /* in: data field length or UNIV_SQL_NULL */
{
......@@ -412,8 +412,8 @@ cmp_dtuple_rec_with_match(
common first fields are compared, or
until the first externally stored field in
rec */
dtuple_t* dtuple, /* in: data tuple */
rec_t* rec, /* in: physical record which differs from
const dtuple_t* dtuple, /* in: data tuple */
const rec_t* rec, /* in: physical record which differs from
dtuple in some of the common fields, or which
has an equal number or more fields than
dtuple */
......@@ -427,15 +427,15 @@ cmp_dtuple_rec_with_match(
value for current comparison */
{
#ifndef UNIV_HOTBACKUP
dfield_t* dtuple_field; /* current field in logical record */
const dfield_t* dtuple_field; /* current field in logical record */
ulint dtuple_f_len; /* the length of the current field
in the logical record */
byte* dtuple_b_ptr; /* pointer to the current byte in
const byte* dtuple_b_ptr; /* pointer to the current byte in
logical field data */
ulint dtuple_byte; /* value of current byte to be compared
in dtuple*/
ulint rec_f_len; /* length of current field in rec */
byte* rec_b_ptr; /* pointer to the current byte in
const byte* rec_b_ptr; /* pointer to the current byte in
rec field */
ulint rec_byte; /* value of current byte to be
compared in rec */
......@@ -487,7 +487,7 @@ cmp_dtuple_rec_with_match(
dtuple_f_len = dfield_get_len(dtuple_field);
rec_b_ptr = rec_get_nth_field(rec, offsets,
rec_b_ptr = rec_get_nth_field((rec_t*) rec, offsets,
cur_field, &rec_f_len);
/* If we have matched yet 0 bytes, it may be that one or
......@@ -530,7 +530,7 @@ cmp_dtuple_rec_with_match(
!= DATA_MYSQL_LATIN1_SWEDISH_CHARSET_COLL)) {
ret = cmp_whole_field(mtype, prtype,
dfield_get_data(dtuple_field),
dtuple_field->data,
(unsigned) dtuple_f_len,
rec_b_ptr, (unsigned) rec_f_len);
......@@ -546,8 +546,7 @@ cmp_dtuple_rec_with_match(
/* Set the pointers at the current byte */
rec_b_ptr = rec_b_ptr + cur_bytes;
dtuple_b_ptr = (byte*)dfield_get_data(dtuple_field)
+ cur_bytes;
dtuple_b_ptr = (byte*) dtuple_field->data + cur_bytes;
/* Compare then the fields */
for (;;) {
......@@ -652,8 +651,8 @@ cmp_dtuple_rec(
/* out: 1, 0, -1, if dtuple is greater, equal,
less than rec, respectively; see the comments
for cmp_dtuple_rec_with_match */
dtuple_t* dtuple, /* in: data tuple */
rec_t* rec, /* in: physical record */
const dtuple_t* dtuple, /* in: data tuple */
const rec_t* rec, /* in: physical record */
const ulint* offsets)/* in: array returned by rec_get_offsets() */
{
ulint matched_fields = 0;
......@@ -672,8 +671,8 @@ ibool
cmp_dtuple_is_prefix_of_rec(
/*========================*/
/* out: TRUE if prefix */
dtuple_t* dtuple, /* in: data tuple */
rec_t* rec, /* in: physical record */
const dtuple_t* dtuple, /* in: data tuple */
const rec_t* rec, /* in: physical record */
const ulint* offsets)/* in: array returned by rec_get_offsets() */
{
ulint n_fields;
......@@ -715,8 +714,8 @@ cmp_rec_rec_with_match(
/* out: 1, 0 , -1 if rec1 is greater, equal,
less, respectively, than rec2; only the common
first fields are compared */
rec_t* rec1, /* in: physical record */
rec_t* rec2, /* in: physical record */
const rec_t* rec1, /* in: physical record */
const rec_t* rec2, /* in: physical record */
const ulint* offsets1,/* in: rec_get_offsets(rec1, index) */
const ulint* offsets2,/* in: rec_get_offsets(rec2, index) */
dict_index_t* index, /* in: data dictionary index */
......@@ -730,21 +729,23 @@ cmp_rec_rec_with_match(
the value for the current comparison */
{
#ifndef UNIV_HOTBACKUP
ulint rec1_n_fields; /* the number of fields in rec */
ulint rec1_f_len; /* length of current field in rec */
byte* rec1_b_ptr; /* pointer to the current byte in rec field */
ulint rec1_byte; /* value of current byte to be compared in
rec */
ulint rec2_n_fields; /* the number of fields in rec */
ulint rec2_f_len; /* length of current field in rec */
byte* rec2_b_ptr; /* pointer to the current byte in rec field */
ulint rec2_byte; /* value of current byte to be compared in
rec */
ulint cur_field; /* current field number */
ulint cur_bytes; /* number of already matched bytes in current
field */
int ret = 3333; /* return value */
ulint comp;
ulint rec1_n_fields; /* the number of fields in rec */
ulint rec1_f_len; /* length of current field in rec */
const byte* rec1_b_ptr; /* pointer to the current byte
in rec field */
ulint rec1_byte; /* value of current byte to be
compared in rec */
ulint rec2_n_fields; /* the number of fields in rec */
ulint rec2_f_len; /* length of current field in rec */
const byte* rec2_b_ptr; /* pointer to the current byte
in rec field */
ulint rec2_byte; /* value of current byte to be
compared in rec */
ulint cur_field; /* current field number */
ulint cur_bytes; /* number of already matched
bytes in current field */
int ret = 3333; /* return value */
ulint comp;
ut_ad(rec1 && rec2 && index);
ut_ad(rec_offs_validate(rec1, index, offsets1));
......@@ -777,9 +778,9 @@ cmp_rec_rec_with_match(
prtype = col->prtype;
}
rec1_b_ptr = rec_get_nth_field(rec1, offsets1,
rec1_b_ptr = rec_get_nth_field((rec_t*) rec1, offsets1,
cur_field, &rec1_f_len);
rec2_b_ptr = rec_get_nth_field(rec2, offsets2,
rec2_b_ptr = rec_get_nth_field((rec_t*) rec2, offsets2,
cur_field, &rec2_f_len);
if (cur_bytes == 0) {
......@@ -966,8 +967,8 @@ cmp_debug_dtuple_rec_with_match(
/* out: 1, 0, -1, if dtuple is greater, equal,
less than rec, respectively, when only the
common first fields are compared */
dtuple_t* dtuple, /* in: data tuple */
rec_t* rec, /* in: physical record which differs from
const dtuple_t* dtuple, /* in: data tuple */
const rec_t* rec, /* in: physical record which differs from
dtuple in some of the common fields, or which
has an equal number or more fields than
dtuple */
......@@ -977,13 +978,13 @@ cmp_debug_dtuple_rec_with_match(
returns, contains the value for current
comparison */
{
dfield_t* dtuple_field; /* current field in logical record */
const dfield_t* dtuple_field; /* current field in logical record */
ulint dtuple_f_len; /* the length of the current field
in the logical record */
byte* dtuple_f_data; /* pointer to the current logical
const byte* dtuple_f_data; /* pointer to the current logical
field data */
ulint rec_f_len; /* length of current field in rec */
byte* rec_f_data; /* pointer to the current rec field */
const byte* rec_f_data; /* pointer to the current rec field */
int ret = 3333; /* return value */
ulint cur_field; /* current field number */
......@@ -1029,10 +1030,10 @@ cmp_debug_dtuple_rec_with_match(
prtype = type->prtype;
}
dtuple_f_data = dfield_get_data(dtuple_field);
dtuple_f_data = dtuple_field->data;
dtuple_f_len = dfield_get_len(dtuple_field);
rec_f_data = rec_get_nth_field(rec, offsets,
rec_f_data = rec_get_nth_field((rec_t*) rec, offsets,
cur_field, &rec_f_len);
if (rec_offs_nth_extern(offsets, cur_field)) {
......
......@@ -761,18 +761,18 @@ rec_convert_dtuple_to_rec_old(
/* out: pointer to the origin of
physical record */
byte* buf, /* in: start address of the physical record */
dtuple_t* dtuple, /* in: data tuple */
const dtuple_t* dtuple, /* in: data tuple */
const ulint* ext, /* in: array of extern field numbers,
in ascending order */
ulint n_ext) /* in: number of externally stored columns */
{
dfield_t* field;
const dfield_t* field;
ulint n_fields;
ulint data_size;
rec_t* rec;
ulint end_offset;
ulint ored_offset;
byte* data;
const byte* data;
ulint len;
ulint i;
......@@ -812,7 +812,7 @@ rec_convert_dtuple_to_rec_old(
field = dtuple_get_nth_field(dtuple, i);
data = dfield_get_data(field);
data = dfield_get_data((dfield_t*) field);
len = dfield_get_len(field);
if (len == UNIV_SQL_NULL) {
......@@ -842,7 +842,7 @@ rec_convert_dtuple_to_rec_old(
field = dtuple_get_nth_field(dtuple, i);
data = dfield_get_data(field);
data = dfield_get_data((dfield_t*) field);
len = dfield_get_len(field);
if (len == UNIV_SQL_NULL) {
......@@ -886,13 +886,13 @@ rec_convert_dtuple_to_rec_new(
of physical record */
byte* buf, /* in: start address of the physical record */
dict_index_t* index, /* in: record descriptor */
dtuple_t* dtuple, /* in: data tuple */
const dtuple_t* dtuple, /* in: data tuple */
const ulint* ext, /* in: array of extern field numbers,
in ascending order */
ulint n_ext) /* in: number of elements in ext */
{
dfield_t* field;
dtype_t* type;
const dfield_t* field;
const dtype_t* type;
rec_t* rec = buf + REC_N_NEW_EXTRA_BYTES;
byte* end;
byte* nulls;
......@@ -997,7 +997,7 @@ init:
if (UNIV_UNLIKELY(i == n_node_ptr_field)) {
ut_ad(dtype_get_prtype(type) & DATA_NOT_NULL);
ut_ad(len == 4);
memcpy(end, dfield_get_data(field), len);
memcpy(end, dfield_get_data((dfield_t*) field), len);
end += 4;
break;
}
......@@ -1047,7 +1047,7 @@ init:
}
}
memcpy(end, dfield_get_data(field), len);
memcpy(end, dfield_get_data((dfield_t*) field), len);
end += len;
}
......@@ -1068,7 +1068,7 @@ rec_convert_dtuple_to_rec(
byte* buf, /* in: start address of the
physical record */
dict_index_t* index, /* in: record descriptor */
dtuple_t* dtuple, /* in: data tuple */
const dtuple_t* dtuple, /* in: data tuple */
const ulint* ext, /* in: array of extern field numbers,
in ascending order */
ulint n_ext) /* in: number of elements in ext */
......@@ -1136,7 +1136,7 @@ rec_copy_prefix_to_dtuple(
for (i = 0; i < n_fields; i++) {
field = dtuple_get_nth_field(tuple, i);
field = (dfield_t*) dtuple_get_nth_field(tuple, i);
data = rec_get_nth_field((rec_t*) rec, offsets, i, &len);
if (len != UNIV_SQL_NULL) {
......
......@@ -153,7 +153,7 @@ row_ins_alloc_sys_fields(
col = dict_table_get_sys_col(table, DATA_ROW_ID);
dfield = dtuple_get_nth_field(row, dict_col_get_no(col));
dfield = (dfield_t*) dtuple_get_nth_field(row, dict_col_get_no(col));
ptr = mem_heap_alloc(heap, DATA_ROW_ID_LEN);
......@@ -165,7 +165,7 @@ row_ins_alloc_sys_fields(
col = dict_table_get_sys_col(table, DATA_TRX_ID);
dfield = dtuple_get_nth_field(row, dict_col_get_no(col));
dfield = (dfield_t*) dtuple_get_nth_field(row, dict_col_get_no(col));
ptr = mem_heap_alloc(heap, DATA_TRX_ID_LEN);
dfield_set_data(dfield, ptr, DATA_TRX_ID_LEN);
......@@ -176,7 +176,7 @@ row_ins_alloc_sys_fields(
col = dict_table_get_sys_col(table, DATA_ROLL_PTR);
dfield = dtuple_get_nth_field(row, dict_col_get_no(col));
dfield = (dfield_t*) dtuple_get_nth_field(row, dict_col_get_no(col));
ptr = mem_heap_alloc(heap, DATA_ROLL_PTR_LEN);
dfield_set_data(dfield, ptr, DATA_ROLL_PTR_LEN);
......@@ -2200,11 +2200,11 @@ row_ins_index_entry_set_vals(
/*=========================*/
dict_index_t* index, /* in: index */
dtuple_t* entry, /* in: index entry to make */
dtuple_t* row) /* in: row */
const dtuple_t* row) /* in: row */
{
dict_field_t* ind_field;
dfield_t* field;
dfield_t* row_field;
const dfield_t* row_field;
ulint n_fields;
ulint i;
......@@ -2213,7 +2213,7 @@ row_ins_index_entry_set_vals(
n_fields = dtuple_get_n_fields(entry);
for (i = 0; i < n_fields; i++) {
field = dtuple_get_nth_field(entry, i);
field = (dfield_t*) dtuple_get_nth_field(entry, i);
ind_field = dict_index_get_nth_field(index, i);
row_field = dtuple_get_nth_field(row, ind_field->col->ind);
......@@ -2312,7 +2312,7 @@ row_ins_get_row_from_values(
while (list_node) {
eval_exp(list_node);
dfield = dtuple_get_nth_field(row, i);
dfield = (dfield_t*) dtuple_get_nth_field(row, i);
dfield_copy_data(dfield, que_node_get_val(list_node));
i++;
......@@ -2343,7 +2343,7 @@ row_ins_get_row_from_select(
list_node = node->select->select_list;
while (list_node) {
dfield = dtuple_get_nth_field(row, i);
dfield = (dfield_t*) dtuple_get_nth_field(row, i);
dfield_copy_data(dfield, que_node_get_val(list_node));
i++;
......
......@@ -249,7 +249,7 @@ row_mysql_store_col_in_innobase_format(
ulint comp) /* in: nonzero=compact format */
{
byte* ptr = mysql_data;
dtype_t* dtype;
const dtype_t* dtype;
ulint type;
ulint lenlen;
......@@ -401,7 +401,7 @@ row_mysql_convert_row_to_innobase(
for (i = 0; i < prebuilt->n_template; i++) {
templ = prebuilt->mysql_template + i;
dfield = dtuple_get_nth_field(row, i);
dfield = (dfield_t*) dtuple_get_nth_field(row, i);
if (templ->mysql_null_bit_mask != 0) {
/* Column may be SQL NULL */
......@@ -825,7 +825,9 @@ row_get_prebuilt_insert_row(
for (i = 0; i < dtuple_get_n_fields(row); i++) {
dtuple_get_nth_field(row, i)->len = UNIV_SQL_NULL;
dfield_set_len((dfield_t*)
dtuple_get_nth_field(row, i),
UNIV_SQL_NULL);
}
ins_node_set_new_row(node, row);
......@@ -2783,7 +2785,7 @@ row_truncate_table_for_mysql(
heap = mem_heap_create(800);
tuple = dtuple_create(heap, 1);
dfield = dtuple_get_nth_field(tuple, 0);
dfield = (dfield_t*) dtuple_get_nth_field(tuple, 0);
buf = mem_heap_alloc(heap, 8);
mach_write_to_8(buf, table->id);
......
......@@ -63,7 +63,7 @@ dtuple_t*
row_build_index_entry(
/*==================*/
/* out: index entry which should be inserted */
dtuple_t* row, /* in: row which should be inserted to the
const dtuple_t* row, /* in: row which should be inserted to the
table */
row_ext_t* ext, /* in: externally stored column prefixes,
or NULL */
......@@ -75,7 +75,7 @@ row_build_index_entry(
ulint entry_len;
dict_field_t* ind_field;
dfield_t* dfield;
dfield_t* dfield2;
const dfield_t* dfield2;
ulint i;
ulint storage_len;
......@@ -106,7 +106,7 @@ row_build_index_entry(
col = ind_field->col;
col_no = dict_col_get_no(col);
dfield = dtuple_get_nth_field(entry, i);
dfield = (dfield_t*) dtuple_get_nth_field(entry, i);
dfield2 = dtuple_get_nth_field(row, col_no);
......@@ -137,7 +137,8 @@ row_build_index_entry(
dfield_set_len(dfield, storage_len);
}
dfield_get_type(dfield)->len = ind_field->prefix_len;
((dtype_t*) dfield_get_type(dfield))->len
= ind_field->prefix_len;
}
}
......@@ -231,10 +232,11 @@ row_build(
if (ind_field->prefix_len == 0) {
dfield_t* dfield = dtuple_get_nth_field(
row, dict_col_get_no(col));
byte* field = rec_get_nth_field(
rec, offsets, i, &len);
dfield_t* dfield
= (dfield_t*) dtuple_get_nth_field(
row, dict_col_get_no(col));
byte* field
= rec_get_nth_field(rec, offsets, i, &len);
dfield_set_data(dfield, field, len);
}
......@@ -326,7 +328,7 @@ row_rec_to_index_entry(
for (i = 0; i < rec_len; i++) {
dfield = dtuple_get_nth_field(entry, i);
dfield = (dfield_t*) dtuple_get_nth_field(entry, i);
field = rec_get_nth_field(rec, offsets, i, &len);
dfield_set_data(dfield, field, len);
......@@ -406,7 +408,7 @@ row_build_row_ref(
dict_index_copy_types(ref, clust_index, ref_len);
for (i = 0; i < ref_len; i++) {
dfield = dtuple_get_nth_field(ref, i);
dfield = (dfield_t*) dtuple_get_nth_field(ref, i);
pos = dict_index_get_nth_field_pos(index, clust_index, i);
......@@ -508,7 +510,7 @@ notfound:
dict_index_copy_types(ref, clust_index, ref_len);
for (i = 0; i < ref_len; i++) {
dfield = dtuple_get_nth_field(ref, i);
dfield = (dfield_t*) dtuple_get_nth_field(ref, i);
pos = dict_index_get_nth_field_pos(index, clust_index, i);
......@@ -580,9 +582,9 @@ row_build_row_ref_from_row(
const dict_col_t* col;
dict_field_t* field;
dfield_t* dfield;
dfield_t* dfield2;
const dfield_t* dfield2;
dfield = dtuple_get_nth_field(ref, i);
dfield = (dfield_t*) dtuple_get_nth_field(ref, i);
field = dict_index_get_nth_field(clust_index, i);
......
......@@ -966,7 +966,8 @@ row_sel_open_pcur(
for (i = 0; i < n_fields; i++) {
exp = plan->tuple_exps[i];
dfield_copy_data(dtuple_get_nth_field(plan->tuple, i),
dfield_copy_data((dfield_t*)
dtuple_get_nth_field(plan->tuple, i),
que_node_get_val(exp));
}
......@@ -2111,7 +2112,7 @@ row_fetch_print(
while (exp) {
dfield_t* dfield = que_node_get_val(exp);
dtype_t* type = dfield_get_type(dfield);
const dtype_t* type = dfield_get_type(dfield);
fprintf(stderr, " column %lu:\n", (ulong)i);
......@@ -2151,7 +2152,7 @@ row_fetch_store_uint4(
ulint tmp;
dfield_t* dfield = que_node_get_val(node->select_list);
dtype_t* type = dfield_get_type(dfield);
const dtype_t* type = dfield_get_type(dfield);
ulint len = dfield_get_len(dfield);
ut_a(dtype_get_mtype(type) == DATA_INT);
......@@ -2270,7 +2271,7 @@ row_sel_convert_mysql_key_to_innobase(
dtuple_set_n_fields(tuple, ULINT_MAX);
dfield = dtuple_get_nth_field(tuple, 0);
dfield = (dfield_t*) dtuple_get_nth_field(tuple, 0);
field = dict_index_get_nth_field(index, 0);
if (UNIV_UNLIKELY(dfield_get_type(dfield)->mtype == DATA_SYS)) {
......
......@@ -352,7 +352,7 @@ row_upd_index_entry_sys_field(
pos = dict_index_get_sys_col_pos(index, type);
dfield = dtuple_get_nth_field(entry, pos);
dfield = (dfield_t*) dtuple_get_nth_field(entry, pos);
field = dfield_get_data(dfield);
if (type == DATA_TRX_ID) {
......@@ -698,10 +698,10 @@ static
ibool
upd_ext_vec_contains(
/*=================*/
/* out: TRUE if i is in ext_vec */
ulint* ext_vec, /* in: array of indexes or NULL */
ulint n_ext_vec, /* in: number of numbers in ext_vec */
ulint i) /* in: a number */
/* out: TRUE if i is in ext_vec */
const ulint* ext_vec, /* in: array of indexes or NULL */
ulint n_ext_vec, /* in: number of numbers in ext_vec */
ulint i) /* in: a number */
{
ulint j;
......@@ -731,14 +731,14 @@ row_upd_build_sec_rec_difference_binary(
/* out, own: update vector of differing
fields */
dict_index_t* index, /* in: index */
dtuple_t* entry, /* in: entry to insert */
rec_t* rec, /* in: secondary index record */
const dtuple_t* entry, /* in: entry to insert */
const rec_t* rec, /* in: secondary index record */
trx_t* trx, /* in: transaction */
mem_heap_t* heap) /* in: memory heap from which allocated */
{
upd_field_t* upd_field;
dfield_t* dfield;
byte* data;
const dfield_t* dfield;
const byte* data;
ulint len;
upd_t* update;
ulint n_diff;
......@@ -758,7 +758,7 @@ row_upd_build_sec_rec_difference_binary(
for (i = 0; i < dtuple_get_n_fields(entry); i++) {
data = rec_get_nth_field(rec, offsets, i, &len);
data = rec_get_nth_field((rec_t*) rec, offsets, i, &len);
dfield = dtuple_get_nth_field(entry, i);
......@@ -803,8 +803,8 @@ row_upd_build_difference_binary(
/* out, own: update vector of differing
fields, excluding roll ptr and trx id */
dict_index_t* index, /* in: clustered index */
dtuple_t* entry, /* in: entry to insert */
ulint* ext_vec,/* in: array containing field numbers of
const dtuple_t* entry, /* in: entry to insert */
const ulint* ext_vec,/* in: array containing field numbers of
externally stored fields in entry, or NULL */
ulint n_ext_vec,/* in: number of fields in ext_vec */
rec_t* rec, /* in: clustered index record */
......@@ -812,8 +812,8 @@ row_upd_build_difference_binary(
mem_heap_t* heap) /* in: memory heap from which allocated */
{
upd_field_t* upd_field;
dfield_t* dfield;
byte* data;
const dfield_t* dfield;
const byte* data;
ulint len;
upd_t* update;
ulint n_diff;
......@@ -840,7 +840,7 @@ row_upd_build_difference_binary(
for (i = 0; i < dtuple_get_n_fields(entry); i++) {
data = rec_get_nth_field(rec, offsets, i, &len);
data = rec_get_nth_field((rec_t*) rec, offsets, i, &len);
dfield = dtuple_get_nth_field(entry, i);
......@@ -926,7 +926,8 @@ row_upd_index_replace_new_col_vals_index_pos(
if (upd_field->field_no == j) {
dfield = dtuple_get_nth_field(entry, j);
dfield = (dfield_t*)
dtuple_get_nth_field(entry, j);
new_val = &(upd_field->new_val);
......@@ -1002,7 +1003,8 @@ row_upd_index_replace_new_col_vals(
if (upd_field->field_no == clust_pos) {
dfield = dtuple_get_nth_field(entry, j);
dfield = (dfield_t*)
dtuple_get_nth_field(entry, j);
new_val = &(upd_field->new_val);
......
......@@ -141,14 +141,14 @@ trx_undo_page_report_insert(
page_t* undo_page, /* in: undo log page */
trx_t* trx, /* in: transaction */
dict_index_t* index, /* in: clustered index */
dtuple_t* clust_entry, /* in: index entry which will be
const dtuple_t* clust_entry, /* in: index entry which will be
inserted to the clustered index */
mtr_t* mtr) /* in: mtr */
{
ulint first_free;
byte* ptr;
ulint len;
dfield_t* field;
const dfield_t* field;
ulint flen;
ulint i;
......@@ -205,7 +205,7 @@ trx_undo_page_report_insert(
return(0);
}
ut_memcpy(ptr, dfield_get_data(field), flen);
memcpy(ptr, field->data, flen);
ptr += flen;
}
}
......@@ -349,7 +349,7 @@ trx_undo_rec_get_row_ref(
dict_index_copy_types(*ref, index, ref_len);
for (i = 0; i < ref_len; i++) {
dfield = dtuple_get_nth_field(*ref, i);
dfield = (dfield_t*) dtuple_get_nth_field(*ref, i);
ptr = trx_undo_rec_get_col_val(ptr, &field, &len);
......@@ -936,7 +936,7 @@ trx_undo_rec_get_partial_row(
ext_cols[n_ext_cols++] = col_no;
}
dfield = dtuple_get_nth_field(*row, col_no);
dfield = (dfield_t*) dtuple_get_nth_field(*row, col_no);
dfield_set_data(dfield, field, len);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment