Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Be-ing committed Aug 1, 2021
2 parents 143896d + 3272146 commit a5906c1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
6 changes: 6 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ int main(int argc, char * argv[]) {
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) && QT_VERSION < QT_VERSION_CHECK(5, 15, 1)
qputenv("QV4_FORCE_INTERPRETER", QByteArrayLiteral("1"));
#endif
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
// Follow whatever factor the user has selected in the system settings
// By default the value is always rounded to the nearest int.
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(
Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
#endif

// Setting the organization name results in a QDesktopStorage::DataLocation
// of "$HOME/Library/Application Support/Mixxx/Mixxx" on OS X. Leave the
Expand Down
36 changes: 19 additions & 17 deletions src/util/db/dbconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ const char kLexicographicalCollationFunc[] = "mixxxLexicographicalCollationFunc"
// The SQL statement 'A LIKE B' is implemented as 'like(B, A)', and if there is
// an escape character, say E, it is implemented as 'like(B, A, E)'
//static
void sqliteLike(sqlite3_context *context,
int aArgc,
sqlite3_value **aArgv) {
void sqliteLikeUtf8(sqlite3_context* context,
int aArgc,
sqlite3_value** aArgv) {
VERIFY_OR_DEBUG_ASSERT(aArgc == 2 || aArgc == 3) {
return;
}
Expand Down Expand Up @@ -277,27 +277,29 @@ bool initDatabase(const QSqlDatabase& database, mixxx::StringCollator* pCollator
}

result = sqlite3_create_function(
handle,
"like",
2,
SQLITE_ANY,
nullptr,
sqliteLike,
nullptr, nullptr);
handle,
"like",
2,
SQLITE_UTF8 | SQLITE_DETERMINISTIC,
nullptr,
sqliteLikeUtf8,
nullptr,
nullptr);
VERIFY_OR_DEBUG_ASSERT(result == SQLITE_OK) {
kLogger.warning()
<< "Failed to install custom 2-arg LIKE function for SQLite3:"
<< result;
}

result = sqlite3_create_function(
handle,
"like",
3,
SQLITE_UTF8, // No conversion, Data is stored as UTF8
nullptr,
sqliteLike,
nullptr, nullptr);
handle,
"like",
3, // 3rd arg = ESCAPE
SQLITE_UTF8 | SQLITE_DETERMINISTIC,
nullptr,
sqliteLikeUtf8,
nullptr,
nullptr);
VERIFY_OR_DEBUG_ASSERT(result == SQLITE_OK) {
kLogger.warning()
<< "Failed to install custom 3-arg LIKE function for SQLite3:"
Expand Down

0 comments on commit a5906c1

Please sign in to comment.