@@ -962,7 +962,8 @@ class Field: public Proto_field, public Sql_alloc
962
962
Useful only for variable length datatypes where it's overloaded.
963
963
By default assume the length is constant.
964
964
*/
965
- virtual uint32 data_length (uint row_offset= 0 ) { return pack_length (); }
965
+ virtual uint32 data_length (uint row_offset MY_ATTRIBUTE ((unused))= 0)
966
+ { return pack_length (); }
966
967
virtual uint32 sort_length () const { return pack_length (); }
967
968
968
969
/* *
@@ -1018,7 +1019,7 @@ class Field: public Proto_field, public Sql_alloc
1018
1019
Since this interface relies on the caller to truncate the value according to this
1019
1020
Field's scale, it will work with all constructs that we currently allow.
1020
1021
*/
1021
- virtual void store_timestamp (const timeval * tm ) { DBUG_ASSERT (false ); }
1022
+ virtual void store_timestamp (const timeval * ) { DBUG_ASSERT (false ); }
1022
1023
1023
1024
virtual void set_default ()
1024
1025
{
@@ -1072,18 +1073,20 @@ class Field: public Proto_field, public Sql_alloc
1072
1073
return type ();
1073
1074
}
1074
1075
inline int cmp (const uchar *str) { return cmp (ptr,str); }
1075
- virtual int cmp_max (const uchar *a, const uchar *b, uint max_len)
1076
- { return cmp (a, b); }
1076
+ virtual int cmp_max (const uchar *a, const uchar *b,
1077
+ uint max_len MY_ATTRIBUTE ((unused)))
1078
+ { return cmp (a, b); }
1077
1079
virtual int cmp (const uchar *,const uchar *)=0;
1078
- virtual int cmp_binary (const uchar *a,const uchar *b, uint32 max_length=~0L )
1080
+ virtual int cmp_binary (const uchar *a,const uchar *b,
1081
+ uint32 max_length MY_ATTRIBUTE ((unused))=~0L)
1079
1082
{ return memcmp (a,b,pack_length ()); }
1080
1083
virtual int cmp_offset (uint row_offset)
1081
1084
{ return cmp (ptr,ptr+row_offset); }
1082
1085
virtual int cmp_binary_offset (uint row_offset)
1083
1086
{ return cmp_binary (ptr, ptr+row_offset); };
1084
1087
virtual int key_cmp (const uchar *a,const uchar *b)
1085
1088
{ return cmp (a, b); }
1086
- virtual int key_cmp (const uchar *str, uint length)
1089
+ virtual int key_cmp (const uchar *str, uint length MY_ATTRIBUTE ((unused)) )
1087
1090
{ return cmp (ptr,str); }
1088
1091
virtual uint decimals () const { return 0 ; }
1089
1092
virtual bool is_text_key_type () const { return false ; }
@@ -1307,10 +1310,10 @@ class Field: public Proto_field, public Sql_alloc
1307
1310
m_null_ptr= ADD_TO_PTR (m_null_ptr, ptr_diff, uchar*);
1308
1311
}
1309
1312
1310
- virtual void get_image (uchar *buff, size_t length, const CHARSET_INFO *cs )
1313
+ virtual void get_image (uchar *buff, size_t length, const CHARSET_INFO* )
1311
1314
{ memcpy (buff, ptr, length); }
1312
1315
1313
- virtual void set_image (const uchar *buff, size_t length, const CHARSET_INFO *cs )
1316
+ virtual void set_image (const uchar *buff, size_t length, const CHARSET_INFO* )
1314
1317
{ memcpy (ptr, buff, length); }
1315
1318
1316
1319
@@ -1340,7 +1343,8 @@ class Field: public Proto_field, public Sql_alloc
1340
1343
Number of copied bytes (excluding padded zero bytes -- see above).
1341
1344
*/
1342
1345
1343
- virtual size_t get_key_image (uchar *buff, size_t length, imagetype type)
1346
+ virtual size_t get_key_image (uchar *buff, size_t length,
1347
+ imagetype type MY_ATTRIBUTE ((unused)))
1344
1348
{
1345
1349
get_image (buff, length, &my_charset_bin);
1346
1350
return length;
@@ -1435,7 +1439,7 @@ class Field: public Proto_field, public Sql_alloc
1435
1439
virtual enum Derivation derivation (void ) const
1436
1440
{ return DERIVATION_IMPLICIT; }
1437
1441
virtual uint repertoire (void ) const { return MY_REPERTOIRE_UNICODE30; }
1438
- virtual void set_derivation (enum Derivation derivation_arg ) { }
1442
+ virtual void set_derivation (enum Derivation) { }
1439
1443
1440
1444
/* *
1441
1445
Produce warning or note about data saved into field.
@@ -1553,7 +1557,8 @@ class Field: public Proto_field, public Sql_alloc
1553
1557
}
1554
1558
1555
1559
/* Validate the value stored in a field */
1556
- virtual type_conversion_status validate_stored_val (THD *thd)
1560
+ virtual type_conversion_status
1561
+ validate_stored_val (THD *thd MY_ATTRIBUTE ((unused)))
1557
1562
{ return TYPE_OK; }
1558
1563
1559
1564
/* Hash value */
@@ -1620,12 +1625,14 @@ class Field: public Proto_field, public Sql_alloc
1620
1625
1621
1626
@returns 0 no bytes written.
1622
1627
*/
1623
- virtual int do_save_field_metadata (uchar *metadata_ptr)
1628
+ virtual int
1629
+ do_save_field_metadata (uchar *metadata_ptr MY_ATTRIBUTE ((unused)))
1624
1630
{ return 0 ; }
1625
1631
1626
1632
protected:
1627
1633
static void handle_int16 (uchar *to, const uchar *from,
1628
- bool low_byte_first_from, bool low_byte_first_to)
1634
+ bool low_byte_first_from MY_ATTRIBUTE ((unused)),
1635
+ bool low_byte_first_to MY_ATTRIBUTE((unused)))
1629
1636
{
1630
1637
int16 val;
1631
1638
#ifdef WORDS_BIGENDIAN
@@ -1644,7 +1651,8 @@ class Field: public Proto_field, public Sql_alloc
1644
1651
}
1645
1652
1646
1653
static void handle_int24 (uchar *to, const uchar *from,
1647
- bool low_byte_first_from, bool low_byte_first_to)
1654
+ bool low_byte_first_from MY_ATTRIBUTE ((unused)),
1655
+ bool low_byte_first_to MY_ATTRIBUTE((unused)))
1648
1656
{
1649
1657
int32 val;
1650
1658
#ifdef WORDS_BIGENDIAN
@@ -1670,7 +1678,8 @@ class Field: public Proto_field, public Sql_alloc
1670
1678
Helper function to pack()/unpack() int32 values
1671
1679
*/
1672
1680
static void handle_int32 (uchar *to, const uchar *from,
1673
- bool low_byte_first_from, bool low_byte_first_to)
1681
+ bool low_byte_first_from MY_ATTRIBUTE ((unused)),
1682
+ bool low_byte_first_to MY_ATTRIBUTE((unused)))
1674
1683
{
1675
1684
int32 val;
1676
1685
#ifdef WORDS_BIGENDIAN
@@ -1692,7 +1701,8 @@ class Field: public Proto_field, public Sql_alloc
1692
1701
Helper function to pack()/unpack() int64 values
1693
1702
*/
1694
1703
static void handle_int64 (uchar* to, const uchar *from,
1695
- bool low_byte_first_from, bool low_byte_first_to)
1704
+ bool low_byte_first_from MY_ATTRIBUTE ((unused)),
1705
+ bool low_byte_first_to MY_ATTRIBUTE((unused)))
1696
1706
{
1697
1707
int64 val;
1698
1708
#ifdef WORDS_BIGENDIAN
@@ -1789,12 +1799,8 @@ class Field_num :public Field {
1789
1799
bool get_time (MYSQL_TIME *ltime);
1790
1800
uint is_equal (const Create_field *new_field);
1791
1801
uint row_pack_length () const { return pack_length (); }
1792
- uint32 pack_length_from_metadata (uint field_metadata) {
1793
- uint32 length= pack_length ();
1794
- DBUG_PRINT (" result" , (" pack_length_from_metadata(%d): %u" ,
1795
- field_metadata, length));
1796
- return length;
1797
- }
1802
+ uint32 pack_length_from_metadata (uint field_metadata MY_ATTRIBUTE ((unused)))
1803
+ { return pack_length (); }
1798
1804
type_conversion_status check_int (const CHARSET_INFO *cs,
1799
1805
const char *str, size_t length,
1800
1806
const char *int_end, int error);
@@ -2054,14 +2060,16 @@ class Field_tiny :public Field_num {
2054
2060
return new Field_tiny (*this );
2055
2061
}
2056
2062
virtual uchar *pack (uchar* to, const uchar *from,
2057
- uint max_length, bool low_byte_first)
2063
+ uint max_length MY_ATTRIBUTE ((unused)),
2064
+ bool low_byte_first MY_ATTRIBUTE((unused)))
2058
2065
{
2059
2066
*to= *from;
2060
2067
return to + 1 ;
2061
2068
}
2062
2069
2063
2070
virtual const uchar *unpack (uchar* to, const uchar *from,
2064
- uint param_data, bool low_byte_first)
2071
+ uint param_data MY_ATTRIBUTE ((unused)),
2072
+ bool low_byte_first MY_ATTRIBUTE((unused)))
2065
2073
{
2066
2074
*to= *from;
2067
2075
return from + 1 ;
@@ -2116,13 +2124,15 @@ class Field_short :public Field_num {
2116
2124
return new Field_short (*this );
2117
2125
}
2118
2126
virtual uchar *pack (uchar* to, const uchar *from,
2119
- uint max_length, bool low_byte_first)
2127
+ uint max_length MY_ATTRIBUTE ((unused)),
2128
+ bool low_byte_first)
2120
2129
{
2121
2130
return pack_int16 (to, from, low_byte_first);
2122
2131
}
2123
2132
2124
2133
virtual const uchar *unpack (uchar* to, const uchar *from,
2125
- uint param_data, bool low_byte_first)
2134
+ uint param_data MY_ATTRIBUTE ((unused)),
2135
+ bool low_byte_first)
2126
2136
{
2127
2137
return unpack_int16 (to, from, low_byte_first);
2128
2138
}
@@ -2460,19 +2470,24 @@ class Field_null :public Field_str {
2460
2470
auto_flags_arg, field_name_arg, cs)
2461
2471
{}
2462
2472
enum_field_types type () const { return MYSQL_TYPE_NULL;}
2463
- type_conversion_status store (const char *to , size_t length ,
2464
- const CHARSET_INFO *cs )
2473
+ type_conversion_status store (const char * , size_t ,
2474
+ const CHARSET_INFO* )
2465
2475
{
2466
2476
null[0 ]= 1 ;
2467
2477
return TYPE_OK;
2468
2478
}
2469
- type_conversion_status store (double nr) { null[0 ]=1 ; return TYPE_OK; }
2470
- type_conversion_status store (longlong nr, bool unsigned_val)
2479
+ type_conversion_status store (double )
2471
2480
{
2472
2481
null[0 ]=1 ;
2473
2482
return TYPE_OK;
2474
2483
}
2475
- type_conversion_status store_decimal (const my_decimal *d)
2484
+ type_conversion_status store (longlong,
2485
+ bool unsigned_val MY_ATTRIBUTE ((unused)))
2486
+ {
2487
+ null[0 ]=1 ;
2488
+ return TYPE_OK;
2489
+ }
2490
+ type_conversion_status store_decimal (const my_decimal *)
2476
2491
{
2477
2492
null[0 ]=1 ;
2478
2493
return TYPE_OK;
@@ -2481,10 +2496,10 @@ class Field_null :public Field_str {
2481
2496
double val_real (void ) { return 0.0 ;}
2482
2497
longlong val_int (void ) { return 0 ;}
2483
2498
my_decimal *val_decimal (my_decimal *) { return 0 ; }
2484
- String *val_str (String *value, String *value2)
2499
+ String *val_str (String*, String *value2)
2485
2500
{ value2->length (0 ); return value2;}
2486
- int cmp (const uchar *a , const uchar *b ) { return 0 ;}
2487
- void make_sort_key (uchar *buff , size_t length ) {}
2501
+ int cmp (const uchar* , const uchar* ) { return 0 ;}
2502
+ void make_sort_key (uchar* , size_t ) {}
2488
2503
uint32 pack_length () const { return 0 ; }
2489
2504
void sql_type (String &str) const ;
2490
2505
uint32 max_display_length () { return 4 ; }
@@ -2623,7 +2638,7 @@ class Field_temporal :public Field {
2623
2638
@param thd THD
2624
2639
@retval sql_mode flags mixed with the field type flags.
2625
2640
*/
2626
- virtual my_time_flags_t date_flags (const THD *thd)
2641
+ virtual my_time_flags_t date_flags (const THD *thd MY_ATTRIBUTE ((unused)) )
2627
2642
{
2628
2643
return 0 ;
2629
2644
}
@@ -3943,7 +3958,7 @@ class Field_geom :public Field_blob {
3943
3958
field_name_arg, share, blob_pack_length, &my_charset_bin)
3944
3959
{ geom_type= geom_type_arg; }
3945
3960
Field_geom (uint32 len_arg,bool maybe_null_arg, const char *field_name_arg,
3946
- TABLE_SHARE *share, enum geometry_type geom_type_arg)
3961
+ enum geometry_type geom_type_arg)
3947
3962
:Field_blob(len_arg, maybe_null_arg, field_name_arg, &my_charset_bin, false )
3948
3963
{ geom_type= geom_type_arg; }
3949
3964
enum ha_base_keytype key_type () const { return HA_KEYTYPE_VARBINARY2; }
@@ -4135,7 +4150,9 @@ class Field_enum :public Field_str {
4135
4150
{ return (field_metadata & 0x00ff ); }
4136
4151
uint row_pack_length () const { return pack_length (); }
4137
4152
virtual bool zero_pack () const { return 0 ; }
4138
- bool optimize_range (uint idx, uint part) { return 0 ; }
4153
+ bool optimize_range (uint idx MY_ATTRIBUTE ((unused)),
4154
+ uint part MY_ATTRIBUTE((unused)))
4155
+ { return 0 ; }
4139
4156
bool eq_def (Field *field);
4140
4157
bool has_charset (void ) const { return TRUE ; }
4141
4158
/* enum and set are sorted as integers */
@@ -4260,8 +4277,8 @@ class Field_bit :public Field {
4260
4277
{ return cmp_binary ((uchar *) a, (uchar *) b); }
4261
4278
int key_cmp (const uchar *str, uint length);
4262
4279
int cmp_offset (uint row_offset);
4263
- void get_image (uchar *buff, size_t length, const CHARSET_INFO *cs )
4264
- { get_key_image (buff, length, itRAW); }
4280
+ void get_image (uchar *buff, size_t length, const CHARSET_INFO *)
4281
+ { get_key_image (buff, length, itRAW); }
4265
4282
void set_image (const uchar *buff, size_t length, const CHARSET_INFO *cs)
4266
4283
{ Field_bit::store ((char *) buff, length, cs); }
4267
4284
size_t get_key_image (uchar *buff, size_t length, imagetype type);
0 commit comments