@@ -535,13 +535,13 @@ int ha_ibmdb2i::getFieldTypeMapping(Field* field,
535535 {
536536 if (field->type () == MYSQL_TYPE_STRING)
537537 {
538- sprintf (stringBuildBuffer, " BINARY(%d )" , max (fieldLength, 1 ));
538+ sprintf (stringBuildBuffer, " BINARY(%u )" , std:: max (fieldLength, 1u ));
539539 }
540540 else
541541 {
542542 if (fieldLength <= MAX_VARCHAR_LENGTH)
543543 {
544- sprintf (stringBuildBuffer, " VARBINARY(%d )" , max (fieldLength, 1 ));
544+ sprintf (stringBuildBuffer, " VARBINARY(%u )" , std:: max (fieldLength, 1u ));
545545 }
546546 else if (blobMapping == AS_VARCHAR &&
547547 (field->flags & PART_KEY_FLAG))
@@ -550,8 +550,8 @@ int ha_ibmdb2i::getFieldTypeMapping(Field* field,
550550 }
551551 else
552552 {
553- fieldLength = min (MAX_BLOB_LENGTH, fieldLength);
554- sprintf (stringBuildBuffer, " BLOB(%d )" , max (fieldLength, 1 ));
553+ fieldLength = std:: min (MAX_BLOB_LENGTH, fieldLength);
554+ sprintf (stringBuildBuffer, " BLOB(%u )" , std:: max (fieldLength, 1u ));
555555 }
556556 }
557557 mapping.append (stringBuildBuffer);
@@ -586,14 +586,14 @@ int ha_ibmdb2i::getFieldTypeMapping(Field* field,
586586 return 1 ;
587587 if (fieldCharSet->mbmaxlen > 1 && (!is_utf8 || is_utf8_general_ci))
588588 {
589- sprintf (stringBuildBuffer, " GRAPHIC(%d )" , max (fieldLength / fieldCharSet->mbmaxlen , 1 )); // Number of characters
589+ sprintf (stringBuildBuffer, " GRAPHIC(%u )" , std:: max (fieldLength / fieldCharSet->mbmaxlen , 1u )); // Number of characters
590590 // Need to set CCSID to 1200 (UTF-16) when using multi-byte charsets
591591 // As well as when the collation is utf*_general_ci because of sort sequence issues
592592 db2Ccsid = 1200 ;
593593 }
594594 else
595595 {
596- sprintf (stringBuildBuffer, " CHAR(%d )" , max (fieldLength, 1 ));
596+ sprintf (stringBuildBuffer, " CHAR(%u )" , std:: max (fieldLength, 1u ));
597597 }
598598 mapping.append (stringBuildBuffer);
599599 }
@@ -603,14 +603,14 @@ int ha_ibmdb2i::getFieldTypeMapping(Field* field,
603603 {
604604 if (fieldCharSet->mbmaxlen > 1 && (!is_utf8 || is_utf8_general_ci))
605605 {
606- sprintf (stringBuildBuffer, " VARGRAPHIC(%d )" , max (fieldLength / fieldCharSet->mbmaxlen , 1 )); // Number of characters
606+ sprintf (stringBuildBuffer, " VARGRAPHIC(%u )" , std:: max (fieldLength / fieldCharSet->mbmaxlen , 1u )); // Number of characters
607607 // Need to set CCSID to 1200 (UTF-16) when using multi-byte charsets
608608 // As well as when the collation is utf*_general_ci because of sort sequence issues
609609 db2Ccsid = 1200 ;
610610 }
611611 else
612612 {
613- sprintf (stringBuildBuffer, " VARCHAR(%d )" , max (fieldLength, 1 ));
613+ sprintf (stringBuildBuffer, " VARCHAR(%u )" , std:: max (fieldLength, 1u ));
614614 }
615615 }
616616 else if (blobMapping == AS_VARCHAR &&
@@ -630,18 +630,18 @@ int ha_ibmdb2i::getFieldTypeMapping(Field* field,
630630 }
631631 else
632632 {
633- fieldLength = min (MAX_BLOB_LENGTH, fieldLength);
633+ fieldLength = std:: min (MAX_BLOB_LENGTH, fieldLength);
634634
635635 if (fieldCharSet->mbmaxlen > 1 && (!is_utf8 || is_utf8_general_ci))
636636 {
637- sprintf (stringBuildBuffer, " DBCLOB(%d )" , max (fieldLength / fieldCharSet->mbmaxlen , 1 )); // Number of characters
637+ sprintf (stringBuildBuffer, " DBCLOB(%u )" , std:: max (fieldLength / fieldCharSet->mbmaxlen ,1u )); // Number of characters
638638 // Need to set CCSID to 1200 (UTF-16) when using multi-byte charsets
639639 // As well as when the collation is utf*_general_ci because of sort sequence issues
640640 db2Ccsid = 1200 ;
641641 }
642642 else
643643 {
644- sprintf (stringBuildBuffer, " CLOB(%d )" , max (fieldLength, 1 )); // Number of characters
644+ sprintf (stringBuildBuffer, " CLOB(%u )" , std:: max (fieldLength, 1u )); // Number of characters
645645 }
646646 }
647647
@@ -689,7 +689,7 @@ int32 ha_ibmdb2i::convertMySQLtoDB2(Field* field, const DB2Field& db2Field, char
689689 {
690690 uint precision= ((Field_new_decimal*)field)->precision ;
691691 uint scale= field->decimals ();
692- uint db2Precision = min (precision, MAX_DEC_PRECISION);
692+ uint db2Precision = std:: min (precision, MAX_DEC_PRECISION);
693693 uint truncationAmount = precision - db2Precision;
694694
695695 if (scale >= truncationAmount)
@@ -1160,8 +1160,8 @@ int32 ha_ibmdb2i::convertMySQLtoDB2(Field* field, const DB2Field& db2Field, char
11601160 if (maxDisplayLength == 0 && db2FieldType == QMY_GRAPHIC)
11611161 maxDb2BytesToStore = 2 ;
11621162 else
1163- maxDb2BytesToStore = min ((( bytesToStore * 2 ) / fieldCharSet->mbminlen ) ,
1164- (( maxDisplayLength * 2 ) / fieldCharSet->mbmaxlen ) );
1163+ maxDb2BytesToStore = std:: min (bytesToStore * 2 / fieldCharSet->mbminlen ,
1164+ maxDisplayLength * 2 / fieldCharSet->mbmaxlen );
11651165
11661166 if (bytesToStore == 0 )
11671167 db2BytesToStore = 0 ;
@@ -1205,8 +1205,8 @@ int32 ha_ibmdb2i::convertMySQLtoDB2(Field* field, const DB2Field& db2Field, char
12051205 else // Else Far East, special UTF8 or non-special UTF8/UCS2
12061206 {
12071207 size_t maxDb2BytesToStore;
1208- maxDb2BytesToStore = min ((( bytesToStore * 2 ) / fieldCharSet->mbminlen ) ,
1209- (( maxDisplayLength * 2 ) / fieldCharSet->mbmaxlen ) );
1208+ maxDb2BytesToStore = std:: min (bytesToStore * 2 / fieldCharSet->mbminlen ,
1209+ maxDisplayLength * 2 / fieldCharSet->mbmaxlen );
12101210 temp = getCharacterConversionBuffer (field->field_index , maxDb2BytesToStore);
12111211 rc = convertFieldChars (toDB2, field->field_index , (char *)dataToStore,temp,bytesToStore, maxDb2BytesToStore, &db2BytesToStore);
12121212 if (rc)
@@ -1258,7 +1258,7 @@ int32 ha_ibmdb2i::convertDB2toMySQL(const DB2Field& db2Field, Field* field, cons
12581258 {
12591259 uint precision= ((Field_new_decimal*)field)->precision ;
12601260 uint scale= field->decimals ();
1261- uint db2Precision = min (precision, MAX_DEC_PRECISION);
1261+ uint db2Precision = std:: min (precision, MAX_DEC_PRECISION);
12621262 uint decimalPlace = precision-scale+1 ;
12631263 char temp[80 ];
12641264
0 commit comments