CONCPP-46 Addition - fix of the build with gcc on macos

Some travis congig fixes for macos

Errors and warnings.
Fix of one testcase failing aginst 10.2
This commit is contained in:
Lawrin Novitsky
2020-11-15 23:20:22 +01:00
parent a9c0c852c4
commit 2704acd7f4
7 changed files with 14 additions and 15 deletions

View File

@ -6,7 +6,7 @@ set -e
export TEST_SERVER=localhost
export TEST_SOCKET=
export TEST_SCHEMA=test
export TEST_UID=root
export TEST_UID=bob
export TEST_PASSWORD=
# for some reason brew upgrades postgresql, so let's remove it
@ -30,9 +30,8 @@ cmake --build . --config RelWithDebInfo
# check users of MariaDB and create test database
mysql --version
mysql -u root -e "SELECT user, host FROM mysql.user"
mysql -u root -e "CREATE DATABASE test"
mysql -u root -e "SHOW DATABASES"
#mysql -u bob -e "CREATE DATABASE test"
mysql -u bob -e "SHOW DATABASES"
echo "Running tests"
cd test

View File

@ -92,13 +92,13 @@ namespace mariadb
UrlParser* UrlParser::parse(const SQLString& url) {
Properties emptyProps;
return parse(url, emptyProps);
}
}
UrlParser* UrlParser::parse(const SQLString& url, Properties& prop)
{
if ((url.startsWith("jdbc:mariadb:")
|| url.startsWith("jdbc:mysql:") && url.find_first_of(DISABLE_MYSQL_URL) == std::string::npos)
|| (url.startsWith("jdbc:mysql:") && url.find_first_of(DISABLE_MYSQL_URL) == std::string::npos))
|| isLegacyUriFormat(url))
{
UrlParser *urlParser= new UrlParser();

View File

@ -182,7 +182,7 @@ namespace mariadb
return false;
}
if (len == 5 || len > 5 && str[5] == '\0') {
if (len == 5 || (len > 5 && str[5] == '\0')) {
SQLString rawVal(str, 5);
return (rawVal.toLowerCase().compare("false") != 0);
}
@ -212,7 +212,7 @@ namespace mariadb
void RowProtocol::rangeCheck(const sql::SQLString& className, int64_t minValue, int64_t maxValue, int64_t value, ColumnDefinition* columnInfo)
{
if (value < 0 && !columnInfo->isSigned() || value < minValue || value > maxValue) {
if ((value < 0 && !columnInfo->isSigned()) || value < minValue || value > maxValue) {
throw SQLException(
"Out of range value for column '"
+ columnInfo->getName()

View File

@ -927,7 +927,7 @@ namespace sql
int32_t maxValue= o->maxValue;
if (value < minValue
|| maxValue != INT32_MAX && value > maxValue)
|| (maxValue != INT32_MAX && value > maxValue))
{
throw IllegalArgumentException(
"Optional parameter "
@ -966,7 +966,7 @@ namespace sql
int64_t maxValue= o->maxValue;
if (value < minValue
|| maxValue != INT64_MAX && value > maxValue)
|| (maxValue != INT64_MAX && value > maxValue))
{
throw IllegalArgumentException(
"Optional parameter "

View File

@ -545,7 +545,7 @@ void bugs::bug72700()
res.reset(stmt->getResultSet());
checkResultSetScrolling(res);
ResultSetMetaData meta(res->getMetaData());
ASSERT_EQUALS(sql::Types::LONGVARCHAR, meta->getColumnType(1));
ASSERT_EQUALS((getServerVersion(con) < 102000 || getServerVersion(con) > 103000) ? sql::Types::LONGVARCHAR : sql::Types::VARCHAR, meta->getColumnType(1));
ASSERT_EQUALS("LONGTEXT", meta->getColumnTypeName(1));
}
catch (::sql::SQLException & /*e*/)

View File

@ -2447,7 +2447,7 @@ void connectionmetadata::bugCpp25()
// More to test connector's split
sql::mariadb::Tokens verParts(sql::mariadb::split(verFromServer, "."));
ASSERT_EQUALS(std::size_t(3), verParts->size());
ASSERT_EQUALS(3ULL, static_cast<uint64_t>(verParts->size()));
ASSERT_EQUALS(major, std::stoul((*verParts)[0].c_str()));
ASSERT_EQUALS(minor, std::stoul((*verParts)[1].c_str()));
@ -2456,7 +2456,7 @@ void connectionmetadata::bugCpp25()
// And even some more testing of the internal split
sql::mariadb::Tokens csv(sql::mariadb::split("575,1,,22,,", ","));
ASSERT_EQUALS(std::size_t(6), csv->size());
ASSERT_EQUALS(6ULL, static_cast<uint64_t>(csv->size()));
ASSERT_EQUALS("575", (*csv)[0]);
ASSERT_EQUALS("1", (*csv)[1]);
ASSERT_EQUALS("", (*csv)[2]);

View File

@ -370,7 +370,7 @@ void resultset::getTypes()
it->name.compare("TINYBLOB") != 0 && it->name.compare("TINYTEXT") != 0 && it->name.compare("TEXT") != 0 && it->name.compare("BLOB") != 0 &&
it->name.compare("MEDIUMTEXT") != 0 && it->name.compare("MEDIUMBLOB") != 0 && it->name.compare("LONGBLOB") != 0 &&
it->name.compare("LONGTEXT") != 0 && it->name.compare("ENUM") && it->name.compare("SET"))
|| !e.getMessage().startsWith("getDouble not available for data field type Types::") && !e.getMessage().startsWith("Incorrect format "))
|| (!e.getMessage().startsWith("getDouble not available for data field type Types::") && !e.getMessage().startsWith("Incorrect format ")))
{
throw e;
}
@ -457,7 +457,7 @@ void resultset::getTypes()
isNumber = false;
}
if (!it->is_negative && intValue < 0 || intValue < INT32_MIN || intValue > INT32_MAX)
if ((!it->is_negative && intValue < 0) || intValue < INT32_MIN || intValue > INT32_MAX)
{
inIntRange = false;
try