Kaydet (Commit) ab76a889 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Various loplugin warnings in mysql

I assume the "0 == " around columnStringValue.equalsIgnoreAsciiCase in
ODatabaseMetaData::getSchemas (mysqlc/source/mysqlc_databasemetadata.cxx) was
just a thinko, as the latter already returns sal_Bool, not a <0 / 0 / >0 integer
value.

(Rebased atop ce24919c "loplugin, various in
mysqlc", which covered the same warnings, but didn't consider the negated call
to equalsIgnoreAsciiCase to be an accident as I do here (see above), and
accidentally reversed the logic of OResultSetMetaData::isNullable in
mysqlc/source/mysqlc_resultsetmetadata.cxx, I think.)

Change-Id: Ie89cc8ef7c7638d28307a4b240930d387d75b8f2
Reviewed-on: https://gerrit.libreoffice.org/58908
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst fbc0524e
......@@ -89,7 +89,7 @@ TerminalCheck TypeCheck::AnyBoolean() const {
n == "sal_Bool" || n == "BOOL" || n == "Boolean" || n == "FT_Bool"
|| n == "FcBool" || n == "GLboolean" || n == "NPBool" || n == "TW_BOOL"
|| n == "UBool" || n == "boolean" || n == "dbus_bool_t"
|| n == "gboolean" || n == "hb_bool_t" || n == "jboolean");
|| n == "gboolean" || n == "hb_bool_t" || n == "jboolean" || n == "my_bool");
}
TypeCheck TypeCheck::LvalueReference() const {
......
......@@ -277,7 +277,7 @@ void SAL_CALL OConnection::setAutoCommit(sal_Bool autoCommit)
{
MutexGuard aGuard(m_aMutex);
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
if(!mysql_autocommit(&m_mysql, static_cast<my_bool>(autoCommit)))
if(!mysql_autocommit(&m_mysql, autoCommit))
mysqlc_sdbc_driver::throwSQLExceptionWithMsg(mysql_error(&m_mysql), mysql_errno(&m_mysql), *this, getConnectionEncoding());
}
......
......@@ -909,7 +909,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getSchemas()
for (sal_uInt32 i = 1; i <= columns; i++) {
rtl::OUString columnStringValue = xRow->getString(i);
if (i == 1) { // TABLE_SCHEM
informationSchema = !columnStringValue.equalsIgnoreAsciiCase("information_schema");
informationSchema = columnStringValue.equalsIgnoreAsciiCase("information_schema");
}
aRow.push_back(makeAny(columnStringValue));
}
......
......@@ -165,7 +165,7 @@ sal_Int32 SAL_CALL OResultSetMetaData::isNullable(sal_Int32 column)
{
checkColumnIndex(column);
MYSQL_FIELD* pField = getField(column);
return sal_Int32((pField->flags & NOT_NULL_FLAG) != 0);
return (pField->flags & NOT_NULL_FLAG) ? 0 : 1;
}
sal_Bool SAL_CALL OResultSetMetaData::isSearchable(sal_Int32 /*column*/)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment