summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2022-01-19 22:42:53 +0100
committersfan5 <sfan5@live.de>2022-01-28 17:16:02 +0100
commit66e8aae9f2a28ee31ffe30694fdb61a8fdceb8d7 (patch)
treeda36f8b260a3481691d12031d9fbf24825c331b5 /src
parent91c6728eb8cebf060b5a3aaed588a7b6dbf266ad (diff)
downloadminetest-66e8aae9f2a28ee31ffe30694fdb61a8fdceb8d7.tar.gz
minetest-66e8aae9f2a28ee31ffe30694fdb61a8fdceb8d7.tar.bz2
minetest-66e8aae9f2a28ee31ffe30694fdb61a8fdceb8d7.zip
Get rid of legacy workaround in SQLite backend
tested on Android 11, fixes #11937
Diffstat (limited to 'src')
-rw-r--r--src/database/database-sqlite3.cpp17
1 files changed, 0 insertions, 17 deletions
diff --git a/src/database/database-sqlite3.cpp b/src/database/database-sqlite3.cpp
index e9442118e..1e63ae9d8 100644
--- a/src/database/database-sqlite3.cpp
+++ b/src/database/database-sqlite3.cpp
@@ -228,11 +228,7 @@ void MapDatabaseSQLite3::createDatabase()
void MapDatabaseSQLite3::initStatements()
{
PREPARE_STATEMENT(read, "SELECT `data` FROM `blocks` WHERE `pos` = ? LIMIT 1");
-#ifdef __ANDROID__
- PREPARE_STATEMENT(write, "INSERT INTO `blocks` (`pos`, `data`) VALUES (?, ?)");
-#else
PREPARE_STATEMENT(write, "REPLACE INTO `blocks` (`pos`, `data`) VALUES (?, ?)");
-#endif
PREPARE_STATEMENT(delete, "DELETE FROM `blocks` WHERE `pos` = ?");
PREPARE_STATEMENT(list, "SELECT `pos` FROM `blocks`");
@@ -265,19 +261,6 @@ bool MapDatabaseSQLite3::saveBlock(const v3s16 &pos, const std::string &data)
{
verifyDatabase();
-#ifdef __ANDROID__
- /**
- * Note: For some unknown reason SQLite3 fails to REPLACE blocks on Android,
- * deleting them and then inserting works.
- */
- bindPos(m_stmt_read, pos);
-
- if (sqlite3_step(m_stmt_read) == SQLITE_ROW) {
- deleteBlock(pos);
- }
- sqlite3_reset(m_stmt_read);
-#endif
-
bindPos(m_stmt_write, pos);
SQLOK(sqlite3_bind_blob(m_stmt_write, 2, data.data(), data.size(), NULL),
"Internal error: failed to bind query at " __FILE__ ":" TOSTRING(__LINE__));