@@ -675,21 +675,21 @@ bool fill_dd_columns_from_create_fields(THD *thd, dd::Abstract_table *tab_obj,
675
675
to handle correctly columns which were created before this change.
676
676
*/
677
677
if (field->sql_type == MYSQL_TYPE_BIT)
678
- col_options->set_bool (" treat_bit_as_char" , field->treat_bit_as_char );
678
+ col_options->set (" treat_bit_as_char" , field->treat_bit_as_char );
679
679
680
680
// Store geometry sub type
681
681
if (field->sql_type == MYSQL_TYPE_GEOMETRY) {
682
- col_options->set_uint32 (" geom_type" , field->geom_type );
682
+ col_options->set (" geom_type" , field->geom_type );
683
683
}
684
684
685
685
// Field storage media and column format options
686
686
if (field->field_storage_type () != HA_SM_DEFAULT)
687
- col_options->set_uint32 (" storage" ,
688
- static_cast <uint32>(field->field_storage_type ()));
687
+ col_options->set (" storage" ,
688
+ static_cast <uint32>(field->field_storage_type ()));
689
689
690
690
if (field->column_format () != COLUMN_FORMAT_TYPE_DEFAULT)
691
- col_options->set_uint32 (" column_format" ,
692
- static_cast <uint32>(field->column_format ()));
691
+ col_options->set (" column_format" ,
692
+ static_cast <uint32>(field->column_format ()));
693
693
694
694
//
695
695
// Write intervals
@@ -722,11 +722,11 @@ bool fill_dd_columns_from_create_fields(THD *thd, dd::Abstract_table *tab_obj,
722
722
col_obj->set_column_type_utf8 (get_sql_type_by_create_field (&table, field));
723
723
724
724
// Store element count in dd::Column
725
- col_options->set_uint32 (" interval_count" , i);
725
+ col_options->set (" interval_count" , i);
726
726
727
727
// Store geometry sub type
728
728
if (field->sql_type == MYSQL_TYPE_GEOMETRY) {
729
- col_options->set_uint32 (" geom_type" , field->geom_type );
729
+ col_options->set (" geom_type" , field->geom_type );
730
730
}
731
731
732
732
// Reset the buffer and assign the column's default value.
@@ -1065,10 +1065,10 @@ static void fill_dd_indexes_from_keyinfo(
1065
1065
in DD in order to avoid problems with binary compatibility if we decide
1066
1066
to change conditions in which optimization is applied in future releases.
1067
1067
*/
1068
- idx_options->set_uint32 (" flags" ,
1069
- (key->flags & (HA_PACK_KEY | HA_BINARY_PACK_KEY)));
1068
+ idx_options->set (" flags" ,
1069
+ (key->flags & (HA_PACK_KEY | HA_BINARY_PACK_KEY)));
1070
1070
1071
- if (key->block_size ) idx_options->set_uint32 (" block_size" , key->block_size );
1071
+ if (key->block_size ) idx_options->set (" block_size" , key->block_size );
1072
1072
1073
1073
if (key->parser_name .str )
1074
1074
idx_options->set (" parser_name" , key->parser_name .str );
@@ -1276,7 +1276,7 @@ static bool fill_dd_tablespace_id_or_name(THD *thd, T *obj, handlerton *hton,
1276
1276
This is required in order for SHOW CREATE and CREATE LIKE to ignore
1277
1277
implicitly assumed tablespace, e.g., 'innodb_system'
1278
1278
*/
1279
- options->set_bool (" explicit_tablespace" , true );
1279
+ options->set (" explicit_tablespace" , true );
1280
1280
1281
1281
DBUG_RETURN (false );
1282
1282
}
@@ -1308,15 +1308,15 @@ static bool get_field_list_str(dd::String_type &str, List<char> *name_list) {
1308
1308
static void set_partition_options (partition_element *part_elem,
1309
1309
dd::Properties *part_options) {
1310
1310
if (part_elem->part_max_rows )
1311
- part_options->set_uint64 (" max_rows" , part_elem->part_max_rows );
1311
+ part_options->set (" max_rows" , part_elem->part_max_rows );
1312
1312
if (part_elem->part_min_rows )
1313
- part_options->set_uint64 (" min_rows" , part_elem->part_min_rows );
1313
+ part_options->set (" min_rows" , part_elem->part_min_rows );
1314
1314
if (part_elem->data_file_name && part_elem->data_file_name [0 ])
1315
1315
part_options->set (" data_file_name" , part_elem->data_file_name );
1316
1316
if (part_elem->index_file_name && part_elem->index_file_name [0 ])
1317
1317
part_options->set (" index_file_name" , part_elem->index_file_name );
1318
1318
if (part_elem->nodegroup_id != UNDEF_NODEGROUP)
1319
- part_options->set_uint32 (" nodegroup_id" , part_elem->nodegroup_id );
1319
+ part_options->set (" nodegroup_id" , part_elem->nodegroup_id );
1320
1320
}
1321
1321
1322
1322
/*
@@ -1620,10 +1620,10 @@ static bool fill_dd_partition_from_create_info(
1620
1620
} else {
1621
1621
if (part_elem->signed_flag ) {
1622
1622
val_obj->set_value_utf8 (
1623
- dd::Properties::from_int64 (part_elem->range_value ));
1623
+ dd::Properties::to_str (part_elem->range_value ));
1624
1624
} else {
1625
- val_obj->set_value_utf8 (dd::Properties::from_uint64 (
1626
- (ulonglong)part_elem->range_value ));
1625
+ val_obj->set_value_utf8 (
1626
+ dd::Properties::to_str ( (ulonglong)part_elem->range_value ));
1627
1627
}
1628
1628
}
1629
1629
@@ -1672,11 +1672,11 @@ static bool fill_dd_partition_from_create_info(
1672
1672
val_obj->set_list_num (list_index);
1673
1673
if (list_value->unsigned_flag ) {
1674
1674
val_obj->set_value_utf8 (
1675
- dd::Properties::from_uint64 ((ulonglong)list_value->value ));
1675
+ dd::Properties::to_str ((ulonglong)list_value->value ));
1676
1676
part_desc_res.set ((ulonglong)list_value->value , cs);
1677
1677
} else {
1678
1678
val_obj->set_value_utf8 (
1679
- dd::Properties::from_int64 (list_value->value ));
1679
+ dd::Properties::to_str (list_value->value ));
1680
1680
part_desc_res.set (list_value->value , cs);
1681
1681
}
1682
1682
part_desc_str.append (part_desc_res);
@@ -1920,10 +1920,10 @@ static bool fill_dd_table_from_create_info(
1920
1920
dd::Properties *table_options = &tab_obj->options ();
1921
1921
1922
1922
if (create_info->max_rows )
1923
- table_options->set_uint64 (" max_rows" , create_info->max_rows );
1923
+ table_options->set (" max_rows" , create_info->max_rows );
1924
1924
1925
1925
if (create_info->min_rows )
1926
- table_options->set_uint64 (" min_rows" , create_info->min_rows );
1926
+ table_options->set (" min_rows" , create_info->min_rows );
1927
1927
1928
1928
//
1929
1929
// Options encoded in HA_CREATE_INFO::table_options.
@@ -1945,8 +1945,8 @@ static bool fill_dd_table_from_create_info(
1945
1945
problems with binary compatibility if we decide to change rules for
1946
1946
applying this optimization in future releases.
1947
1947
*/
1948
- table_options->set_bool (" pack_record" ,
1949
- create_info->table_options & HA_OPTION_PACK_RECORD);
1948
+ table_options->set (" pack_record" ,
1949
+ create_info->table_options & HA_OPTION_PACK_RECORD);
1950
1950
1951
1951
/*
1952
1952
PACK_KEYS=# clause. Absence of PACK_KEYS option/PACK_KEYS=DEFAULT is
@@ -1958,8 +1958,8 @@ static bool fill_dd_table_from_create_info(
1958
1958
(HA_OPTION_PACK_KEYS | HA_OPTION_NO_PACK_KEYS)) !=
1959
1959
(HA_OPTION_PACK_KEYS | HA_OPTION_NO_PACK_KEYS));
1960
1960
1961
- table_options->set_bool (" pack_keys" ,
1962
- create_info->table_options & HA_OPTION_PACK_KEYS);
1961
+ table_options->set (" pack_keys" ,
1962
+ create_info->table_options & HA_OPTION_PACK_KEYS);
1963
1963
}
1964
1964
1965
1965
/*
@@ -1969,16 +1969,16 @@ static bool fill_dd_table_from_create_info(
1969
1969
DBUG_ASSERT (!((create_info->table_options & HA_OPTION_CHECKSUM) &&
1970
1970
(create_info->table_options & HA_OPTION_NO_CHECKSUM)));
1971
1971
if (create_info->table_options & (HA_OPTION_CHECKSUM | HA_OPTION_NO_CHECKSUM))
1972
- table_options->set_bool (" checksum" ,
1973
- create_info->table_options & HA_OPTION_CHECKSUM);
1972
+ table_options->set (" checksum" ,
1973
+ create_info->table_options & HA_OPTION_CHECKSUM);
1974
1974
1975
1975
/* DELAY_KEY_WRITE=# clause. Same situation as for CHECKSUM option. */
1976
1976
DBUG_ASSERT (!((create_info->table_options & HA_OPTION_DELAY_KEY_WRITE) &&
1977
1977
(create_info->table_options & HA_OPTION_NO_DELAY_KEY_WRITE)));
1978
1978
if (create_info->table_options &
1979
1979
(HA_OPTION_DELAY_KEY_WRITE | HA_OPTION_NO_DELAY_KEY_WRITE))
1980
- table_options->set_bool (" delay_key_write" , create_info-> table_options &
1981
- HA_OPTION_DELAY_KEY_WRITE);
1980
+ table_options->set (" delay_key_write" ,
1981
+ create_info-> table_options & HA_OPTION_DELAY_KEY_WRITE);
1982
1982
1983
1983
/*
1984
1984
STATS_PERSISTENT=# clause. Absence option in dd::Properties represents
@@ -1992,35 +1992,34 @@ static bool fill_dd_table_from_create_info(
1992
1992
(HA_OPTION_STATS_PERSISTENT | HA_OPTION_NO_STATS_PERSISTENT)) !=
1993
1993
(HA_OPTION_STATS_PERSISTENT | HA_OPTION_NO_STATS_PERSISTENT));
1994
1994
1995
- table_options->set_bool (" stats_persistent" , (create_info->table_options &
1996
- HA_OPTION_STATS_PERSISTENT));
1995
+ table_options->set (" stats_persistent" , (create_info->table_options &
1996
+ HA_OPTION_STATS_PERSISTENT));
1997
1997
}
1998
1998
1999
1999
//
2000
2000
// Set other table options.
2001
2001
//
2002
2002
2003
- table_options->set_uint32 (" avg_row_length" , create_info->avg_row_length );
2003
+ table_options->set (" avg_row_length" , create_info->avg_row_length );
2004
2004
2005
2005
if (create_info->row_type != ROW_TYPE_DEFAULT)
2006
- table_options->set_uint32 (" row_type" , create_info->row_type );
2006
+ table_options->set (" row_type" , create_info->row_type );
2007
2007
2008
2008
// ROW_FORMAT which was explicitly specified by user (if any).
2009
2009
if (create_info->row_type != ROW_TYPE_DEFAULT)
2010
- table_options->set_uint32 (" row_type" ,
2011
- dd_get_new_row_format (create_info->row_type ));
2010
+ table_options->set (" row_type" ,
2011
+ dd_get_new_row_format (create_info->row_type ));
2012
2012
2013
2013
// ROW_FORMAT which is really used for the table by SE (perhaps implicitly).
2014
2014
tab_obj->set_row_format (
2015
2015
dd_get_new_row_format (file->get_real_row_type (create_info)));
2016
2016
2017
- table_options->set_uint32 (" stats_sample_pages" ,
2018
- create_info->stats_sample_pages & 0xffff );
2017
+ table_options->set (" stats_sample_pages" ,
2018
+ create_info->stats_sample_pages & 0xffff );
2019
2019
2020
- table_options->set_uint32 (" stats_auto_recalc" ,
2021
- create_info->stats_auto_recalc );
2020
+ table_options->set (" stats_auto_recalc" , create_info->stats_auto_recalc );
2022
2021
2023
- table_options->set_uint32 (" key_block_size" , create_info->key_block_size );
2022
+ table_options->set (" key_block_size" , create_info->key_block_size );
2024
2023
2025
2024
if (create_info->connect_string .str && create_info->connect_string .length ) {
2026
2025
dd::String_type connect_string;
@@ -2043,11 +2042,11 @@ static bool fill_dd_table_from_create_info(
2043
2042
}
2044
2043
// Storage media
2045
2044
if (create_info->storage_media > HA_SM_DEFAULT)
2046
- table_options->set_uint32 (" storage" , create_info->storage_media );
2045
+ table_options->set (" storage" , create_info->storage_media );
2047
2046
2048
2047
// Update option keys_disabled
2049
- table_options->set_uint32 (" keys_disabled" ,
2050
- (keys_onoff == Alter_info::DISABLE ? 1 : 0 ));
2048
+ table_options->set (" keys_disabled" ,
2049
+ (keys_onoff == Alter_info::DISABLE ? 1 : 0 ));
2051
2050
2052
2051
// Collation ID
2053
2052
DBUG_ASSERT (create_info->default_table_charset );
@@ -2140,7 +2139,7 @@ static bool get_se_private_data(THD *thd, dd::Table *tab_obj) {
2140
2139
String_type tbl_prop_str;
2141
2140
if (dd::tables::DD_properties::instance ().get (thd, " SYSTEM_TABLES" ,
2142
2141
&sys_tbl_props, &exists) ||
2143
- !exists || sys_tbl_props->get (tab_obj->name (), tbl_prop_str)) {
2142
+ !exists || sys_tbl_props->get (tab_obj->name (), & tbl_prop_str)) {
2144
2143
my_error (ER_DD_METADATA_NOT_FOUND, MYF (0 ), tab_obj->name ().c_str ());
2145
2144
return true ;
2146
2145
}
@@ -2151,31 +2150,31 @@ static bool get_se_private_data(THD *thd, dd::Table *tab_obj) {
2151
2150
Object_id space_id = INVALID_OBJECT_ID;
2152
2151
String_type se_data;
2153
2152
2154
- if (tbl_props->get_uint64 (
2155
- DD_properties::dd_key (DD_properties::DD_property::ID), &se_id) ||
2156
- tbl_props->get_uint64 (
2153
+ if (tbl_props->get ( DD_properties::dd_key (DD_properties::DD_property::ID),
2154
+ &se_id) ||
2155
+ tbl_props->get (
2157
2156
DD_properties::dd_key (DD_properties::DD_property::SPACE_ID),
2158
2157
&space_id) ||
2159
2158
tbl_props->get (DD_properties::dd_key (DD_properties::DD_property::DATA),
2160
- se_data)) {
2159
+ & se_data)) {
2161
2160
my_error (ER_DD_METADATA_NOT_FOUND, MYF (0 ), tab_obj->name ().c_str ());
2162
2161
return true ;
2163
2162
}
2164
2163
2165
2164
tab_obj->set_se_private_id (se_id);
2166
2165
tab_obj->set_tablespace_id (space_id);
2167
- tab_obj->set_se_private_data_raw (se_data);
2166
+ tab_obj->set_se_private_data (se_data);
2168
2167
2169
2168
// Assign SE private data for indexes.
2170
2169
int count = 0 ;
2171
2170
for (auto idx : *tab_obj->indexes ()) {
2172
2171
std::stringstream ss;
2173
2172
ss << DD_properties::dd_key (DD_properties::DD_property::IDX) << count++;
2174
- if (tbl_props->get (ss.str ().c_str (), se_data)) {
2173
+ if (tbl_props->get (ss.str ().c_str (), & se_data)) {
2175
2174
my_error (ER_DD_METADATA_NOT_FOUND, MYF (0 ), tab_obj->name ().c_str ());
2176
2175
return true ;
2177
2176
}
2178
- idx->set_se_private_data_raw (se_data);
2177
+ idx->set_se_private_data (se_data);
2179
2178
// Assign the same tablespace id for the indexes as for the table.
2180
2179
idx->set_tablespace_id (space_id);
2181
2180
}
@@ -2185,11 +2184,11 @@ static bool get_se_private_data(THD *thd, dd::Table *tab_obj) {
2185
2184
for (auto col : *tab_obj->columns ()) {
2186
2185
std::stringstream ss;
2187
2186
ss << DD_properties::dd_key (DD_properties::DD_property::COL) << count++;
2188
- if (tbl_props->get (ss.str ().c_str (), se_data)) {
2187
+ if (tbl_props->get (ss.str ().c_str (), & se_data)) {
2189
2188
my_error (ER_DD_METADATA_NOT_FOUND, MYF (0 ), tab_obj->name ().c_str ());
2190
2189
return true ;
2191
2190
}
2192
- col->set_se_private_data_raw (se_data);
2191
+ col->set_se_private_data (se_data);
2193
2192
}
2194
2193
return false ;
2195
2194
}
@@ -2593,7 +2592,8 @@ static void copy_tablespace_ids(const Table &t, IT it) {
2593
2592
*/
2594
2593
Encrypt_result is_tablespace_encrypted (THD *thd, const Table &t) {
2595
2594
if (t.options ().exists (" encrypt_type" )) {
2596
- const String_type &et = t.options ().value (" encrypt_type" );
2595
+ String_type et;
2596
+ (void )t.options ().get (" encrypt_type" , &et);
2597
2597
DBUG_ASSERT (et.empty () == false );
2598
2598
if (et == " Y" || et == " y" ) {
2599
2599
return {false , true };
@@ -2626,7 +2626,8 @@ Encrypt_result is_tablespace_encrypted(THD *thd, const Table &t) {
2626
2626
return false ;
2627
2627
}
2628
2628
2629
- const String_type &e = tsp->options ().value (" encryption" );
2629
+ String_type e;
2630
+ (void )tsp->options ().get (" encryption" , &e);
2630
2631
DBUG_ASSERT (e.empty () == false );
2631
2632
if (e == " Y" || e == " y" ) {
2632
2633
return true ;
0 commit comments