@@ -315,7 +315,7 @@ String *Item::val_string_from_decimal(String *str) {
315
315
}
316
316
317
317
String *Item::val_string_from_datetime (String *str) {
318
- assert (fixed == 1 );
318
+ assert (fixed);
319
319
MYSQL_TIME ltime;
320
320
if (get_date (<ime, TIME_FUZZY_DATE) ||
321
321
(null_value = str->alloc (MAX_DATE_STRING_REP_LENGTH)))
@@ -325,7 +325,7 @@ String *Item::val_string_from_datetime(String *str) {
325
325
}
326
326
327
327
String *Item::val_string_from_date (String *str) {
328
- assert (fixed == 1 );
328
+ assert (fixed);
329
329
MYSQL_TIME ltime;
330
330
if (get_date (<ime, TIME_FUZZY_DATE) ||
331
331
(null_value = str->alloc (MAX_DATE_STRING_REP_LENGTH)))
@@ -335,7 +335,7 @@ String *Item::val_string_from_date(String *str) {
335
335
}
336
336
337
337
String *Item::val_string_from_time (String *str) {
338
- assert (fixed == 1 );
338
+ assert (fixed);
339
339
MYSQL_TIME ltime;
340
340
if (get_time (<ime) || (null_value = str->alloc (MAX_DATE_STRING_REP_LENGTH)))
341
341
return error_str ();
@@ -378,7 +378,7 @@ my_decimal *Item::val_decimal_from_string(my_decimal *decimal_value) {
378
378
}
379
379
380
380
my_decimal *Item::val_decimal_from_date (my_decimal *decimal_value) {
381
- assert (fixed == 1 );
381
+ assert (fixed);
382
382
MYSQL_TIME ltime;
383
383
if (get_date (<ime, TIME_FUZZY_DATE)) {
384
384
return error_decimal (decimal_value);
@@ -387,7 +387,7 @@ my_decimal *Item::val_decimal_from_date(my_decimal *decimal_value) {
387
387
}
388
388
389
389
my_decimal *Item::val_decimal_from_time (my_decimal *decimal_value) {
390
- assert (fixed == 1 );
390
+ assert (fixed);
391
391
MYSQL_TIME ltime;
392
392
if (get_time (<ime)) {
393
393
return error_decimal (decimal_value);
@@ -480,7 +480,7 @@ longlong Item::val_int_from_decimal() {
480
480
}
481
481
482
482
longlong Item::val_int_from_time () {
483
- assert (fixed == 1 );
483
+ assert (fixed);
484
484
MYSQL_TIME ltime;
485
485
ulonglong value = 0 ;
486
486
if (get_time (<ime)) return 0LL ;
@@ -494,15 +494,15 @@ longlong Item::val_int_from_time() {
494
494
}
495
495
496
496
longlong Item::val_int_from_date () {
497
- assert (fixed == 1 );
497
+ assert (fixed);
498
498
MYSQL_TIME ltime;
499
499
return get_date (<ime, TIME_FUZZY_DATE)
500
500
? 0LL
501
501
: (longlong)TIME_to_ulonglong_date (ltime);
502
502
}
503
503
504
504
longlong Item::val_int_from_datetime () {
505
- assert (fixed == 1 );
505
+ assert (fixed);
506
506
MYSQL_TIME ltime;
507
507
if (get_date (<ime, TIME_FUZZY_DATE)) return 0LL ;
508
508
@@ -1704,15 +1704,15 @@ bool Item::get_time_from_int(MYSQL_TIME *ltime) {
1704
1704
}
1705
1705
1706
1706
bool Item::get_time_from_date (MYSQL_TIME *ltime) {
1707
- assert (fixed == 1 );
1707
+ assert (fixed);
1708
1708
if (get_date (ltime, TIME_FUZZY_DATE)) // Need this check if NULL value
1709
1709
return true ;
1710
1710
set_zero_time (ltime, MYSQL_TIMESTAMP_TIME);
1711
1711
return false ;
1712
1712
}
1713
1713
1714
1714
bool Item::get_time_from_datetime (MYSQL_TIME *ltime) {
1715
- assert (fixed == 1 );
1715
+ assert (fixed);
1716
1716
if (get_date (ltime, TIME_FUZZY_DATE)) return true ;
1717
1717
datetime_to_time (ltime);
1718
1718
return false ;
@@ -3139,7 +3139,7 @@ TYPELIB *Item_field::get_typelib() const {
3139
3139
}
3140
3140
3141
3141
String *Item_field::val_str (String *str) {
3142
- assert (fixed == 1 );
3142
+ assert (fixed);
3143
3143
if ((null_value = field->is_null ())) return nullptr ;
3144
3144
str->set_charset (str_value.charset ());
3145
3145
return field->val_str (str, &str_value);
@@ -3154,37 +3154,37 @@ bool Item_field::val_json(Json_wrapper *result) {
3154
3154
}
3155
3155
3156
3156
double Item_field::val_real () {
3157
- assert (fixed == 1 );
3157
+ assert (fixed);
3158
3158
if ((null_value = field->is_null ())) return 0.0 ;
3159
3159
return field->val_real ();
3160
3160
}
3161
3161
3162
3162
longlong Item_field::val_int () {
3163
- assert (fixed == 1 );
3163
+ assert (fixed);
3164
3164
if ((null_value = field->is_null ())) return 0 ;
3165
3165
return field->val_int ();
3166
3166
}
3167
3167
3168
3168
longlong Item_field::val_time_temporal () {
3169
- assert (fixed == 1 );
3169
+ assert (fixed);
3170
3170
if ((null_value = field->is_null ())) return 0 ;
3171
3171
return field->val_time_temporal ();
3172
3172
}
3173
3173
3174
3174
longlong Item_field::val_date_temporal () {
3175
- assert (fixed == 1 );
3175
+ assert (fixed);
3176
3176
if ((null_value = field->is_null ())) return 0 ;
3177
3177
return field->val_date_temporal ();
3178
3178
}
3179
3179
3180
3180
longlong Item_field::val_time_temporal_at_utc () {
3181
- assert (fixed == 1 );
3181
+ assert (fixed);
3182
3182
if ((null_value = field->is_null ())) return 0 ;
3183
3183
return field->val_time_temporal_at_utc ();
3184
3184
}
3185
3185
3186
3186
longlong Item_field::val_date_temporal_at_utc () {
3187
- assert (fixed == 1 );
3187
+ assert (fixed);
3188
3188
if ((null_value = field->is_null ())) return 0 ;
3189
3189
return field->val_date_temporal_at_utc ();
3190
3190
}
@@ -3381,7 +3381,7 @@ my_decimal *Item_int::val_decimal(my_decimal *decimal_value) {
3381
3381
3382
3382
String *Item_int::val_str (String *str) {
3383
3383
// following assert is redundant, because fixed=1 assigned in constructor
3384
- assert (fixed == 1 );
3384
+ assert (fixed);
3385
3385
str->set_int (value, unsigned_flag, collation.collation );
3386
3386
return str;
3387
3387
}
@@ -3410,7 +3410,7 @@ void Item_int::print(const THD *, String *str,
3410
3410
3411
3411
String *Item_uint::val_str (String *str) {
3412
3412
// following assert is redundant, because fixed=1 assigned in constructor
3413
- assert (fixed == 1 );
3413
+ assert (fixed);
3414
3414
str->set ((ulonglong)value, collation.collation );
3415
3415
return str;
3416
3416
}
@@ -3537,14 +3537,14 @@ void Item_decimal::set_decimal_value(const my_decimal *value_par) {
3537
3537
3538
3538
String *Item_float::val_str (String *str) {
3539
3539
// following assert is redundant, because fixed=1 assigned in constructor
3540
- assert (fixed == 1 );
3540
+ assert (fixed);
3541
3541
str->set_real (value, decimals, &my_charset_bin);
3542
3542
return str;
3543
3543
}
3544
3544
3545
3545
my_decimal *Item_float::val_decimal (my_decimal *decimal_value) {
3546
3546
// following assert is redundant, because fixed=1 assigned in constructor
3547
- assert (fixed == 1 );
3547
+ assert (fixed);
3548
3548
double2my_decimal (E_DEC_FATAL_ERROR, value, decimal_value);
3549
3549
return (decimal_value);
3550
3550
}
@@ -3645,7 +3645,7 @@ double double_from_string_with_check(const CHARSET_INFO *cs, const char *cptr,
3645
3645
}
3646
3646
3647
3647
double Item_string::val_real () {
3648
- assert (fixed == 1 );
3648
+ assert (fixed);
3649
3649
return double_from_string_with_check (str_value.charset (), str_value.ptr (),
3650
3650
str_value.ptr () + str_value.length ());
3651
3651
}
@@ -3710,20 +3710,20 @@ bool Item_null::eq(const Item *item, bool) const {
3710
3710
3711
3711
double Item_null::val_real () {
3712
3712
// following assert is redundant, because fixed=1 assigned in constructor
3713
- assert (fixed == 1 );
3713
+ assert (fixed);
3714
3714
null_value = true ;
3715
3715
return 0.0 ;
3716
3716
}
3717
3717
longlong Item_null::val_int () {
3718
3718
// following assert is redundant, because fixed=1 assigned in constructor
3719
- assert (fixed == 1 );
3719
+ assert (fixed);
3720
3720
null_value = true ;
3721
3721
return 0 ;
3722
3722
}
3723
3723
3724
3724
String *Item_null::val_str (String *) {
3725
3725
// following assert is redundant, because fixed=1 assigned in constructor
3726
- assert (fixed == 1 );
3726
+ assert (fixed);
3727
3727
null_value = true ;
3728
3728
return nullptr ;
3729
3729
}
@@ -5021,7 +5021,7 @@ bool Item::fix_fields(THD *, Item **) {
5021
5021
assert (is_contextualized ());
5022
5022
5023
5023
// We do not check fields which are fixed during construction
5024
- assert (fixed == 0 || basic_const_item ());
5024
+ assert (! fixed || basic_const_item ());
5025
5025
fixed = true ;
5026
5026
return false ;
5027
5027
}
@@ -7218,7 +7218,7 @@ void Item_hex_string::hex_string_init(const char *str, uint str_length) {
7218
7218
7219
7219
longlong Item_hex_string::val_int () {
7220
7220
// following assert is redundant, because fixed=1 assigned in constructor
7221
- assert (fixed == 1 );
7221
+ assert (fixed);
7222
7222
const char *end = str_value.ptr () + str_value.length ();
7223
7223
const char *ptr;
7224
7224
@@ -7257,7 +7257,7 @@ longlong Item_hex_string::val_int() {
7257
7257
7258
7258
my_decimal *Item_hex_string::val_decimal (my_decimal *decimal_value) {
7259
7259
// following assert is redundant, because fixed=1 assigned in constructor
7260
- assert (fixed == 1 );
7260
+ assert (fixed);
7261
7261
const ulonglong value = (ulonglong)val_int ();
7262
7262
int2my_decimal (E_DEC_FATAL_ERROR, value, true , decimal_value);
7263
7263
return (decimal_value);
@@ -9316,7 +9316,7 @@ bool Item_trigger_field::fix_fields(THD *thd, Item **) {
9316
9316
parsing! So we have little to do in fix_fields. :)
9317
9317
*/
9318
9318
9319
- assert (fixed == 0 );
9319
+ assert (! fixed);
9320
9320
9321
9321
/* Set field. */
9322
9322
@@ -9736,28 +9736,28 @@ void Item_cache_int::store_value(Item *item, longlong val_arg) {
9736
9736
}
9737
9737
9738
9738
String *Item_cache_int::val_str (String *str) {
9739
- assert (fixed == 1 );
9739
+ assert (fixed);
9740
9740
if (!has_value ()) return nullptr ;
9741
9741
str->set_int (value, unsigned_flag, default_charset ());
9742
9742
return str;
9743
9743
}
9744
9744
9745
9745
my_decimal *Item_cache_int::val_decimal (my_decimal *decimal_val) {
9746
- assert (fixed == 1 );
9746
+ assert (fixed);
9747
9747
if (!has_value ()) return nullptr ;
9748
9748
int2my_decimal (E_DEC_FATAL_ERROR, value, unsigned_flag, decimal_val);
9749
9749
return decimal_val;
9750
9750
}
9751
9751
9752
9752
double Item_cache_int::val_real () {
9753
- assert (fixed == 1 );
9753
+ assert (fixed);
9754
9754
if (!has_value ()) return 0.0 ;
9755
9755
if (unsigned_flag) return static_cast <unsigned long long >(value);
9756
9756
return value;
9757
9757
}
9758
9758
9759
9759
longlong Item_cache_int::val_int () {
9760
- assert (fixed == 1 );
9760
+ assert (fixed);
9761
9761
if (!has_value ()) return 0 ;
9762
9762
return value;
9763
9763
}
@@ -9823,7 +9823,7 @@ void Item_cache_datetime::store(Item *item) {
9823
9823
}
9824
9824
9825
9825
String *Item_cache_datetime::val_str (String *) {
9826
- assert (fixed == 1 );
9826
+ assert (fixed);
9827
9827
9828
9828
if ((value_cached || str_value_cached) && null_value) return nullptr ;
9829
9829
@@ -9851,7 +9851,7 @@ String *Item_cache_datetime::val_str(String *) {
9851
9851
}
9852
9852
9853
9853
my_decimal *Item_cache_datetime::val_decimal (my_decimal *decimal_val) {
9854
- assert (fixed == 1 );
9854
+ assert (fixed);
9855
9855
9856
9856
if (str_value_cached) {
9857
9857
switch (data_type ()) {
@@ -9934,7 +9934,7 @@ bool Item_cache_datetime::get_time(MYSQL_TIME *ltime) {
9934
9934
double Item_cache_datetime::val_real () { return val_real_from_decimal (); }
9935
9935
9936
9936
longlong Item_cache_datetime::val_time_temporal () {
9937
- assert (fixed == 1 );
9937
+ assert (fixed);
9938
9938
if ((!value_cached && !cache_value_int ()) || null_value) return 0 ;
9939
9939
if (is_temporal_with_date ()) {
9940
9940
/* Convert packed date to packed time */
@@ -9947,7 +9947,7 @@ longlong Item_cache_datetime::val_time_temporal() {
9947
9947
}
9948
9948
9949
9949
longlong Item_cache_datetime::val_date_temporal () {
9950
- assert (fixed == 1 );
9950
+ assert (fixed);
9951
9951
if ((!value_cached && !cache_value_int ()) || null_value) return 0 ;
9952
9952
if (data_type () == MYSQL_TYPE_TIME) {
9953
9953
/* Convert packed time to packed date */
@@ -10096,26 +10096,26 @@ void Item_cache_real::store_value(Item *expr, double d) {
10096
10096
}
10097
10097
10098
10098
double Item_cache_real::val_real () {
10099
- assert (fixed == 1 );
10099
+ assert (fixed);
10100
10100
if (!has_value ()) return 0.0 ;
10101
10101
return value;
10102
10102
}
10103
10103
10104
10104
longlong Item_cache_real::val_int () {
10105
- assert (fixed == 1 );
10105
+ assert (fixed);
10106
10106
if (!has_value ()) return 0 ;
10107
10107
return (longlong)rint (value);
10108
10108
}
10109
10109
10110
10110
String *Item_cache_real::val_str (String *str) {
10111
- assert (fixed == 1 );
10111
+ assert (fixed);
10112
10112
if (!has_value ()) return nullptr ;
10113
10113
str->set_real (value, decimals, default_charset ());
10114
10114
return str;
10115
10115
}
10116
10116
10117
10117
my_decimal *Item_cache_real::val_decimal (my_decimal *decimal_val) {
10118
- assert (fixed == 1 );
10118
+ assert (fixed);
10119
10119
if (!has_value ()) return nullptr ;
10120
10120
double2my_decimal (E_DEC_FATAL_ERROR, value, decimal_val);
10121
10121
return decimal_val;
@@ -10201,7 +10201,7 @@ void Item_cache_str::store_value(Item *expr, String &s) {
10201
10201
}
10202
10202
10203
10203
double Item_cache_str::val_real () {
10204
- assert (fixed == 1 );
10204
+ assert (fixed);
10205
10205
int err_not_used;
10206
10206
const char *end_not_used;
10207
10207
if (!has_value ()) return 0.0 ;
@@ -10212,7 +10212,7 @@ double Item_cache_str::val_real() {
10212
10212
}
10213
10213
10214
10214
longlong Item_cache_str::val_int () {
10215
- assert (fixed == 1 );
10215
+ assert (fixed);
10216
10216
int err;
10217
10217
if (!has_value ()) return 0 ;
10218
10218
if (value)
@@ -10223,13 +10223,13 @@ longlong Item_cache_str::val_int() {
10223
10223
}
10224
10224
10225
10225
String *Item_cache_str::val_str (String *) {
10226
- assert (fixed == 1 );
10226
+ assert (fixed);
10227
10227
if (!has_value ()) return nullptr ;
10228
10228
return value;
10229
10229
}
10230
10230
10231
10231
my_decimal *Item_cache_str::val_decimal (my_decimal *decimal_val) {
10232
- assert (fixed == 1 );
10232
+ assert (fixed);
10233
10233
if (!has_value ()) return nullptr ;
10234
10234
if (value)
10235
10235
str2my_decimal (E_DEC_FATAL_ERROR, value->ptr (), value->length (),
0 commit comments