Skip to content

Commit 29ff6c4

Browse files
committed
decrease the requirements for SQLite version using the || operator instead of the concat builtin function available since SQLite 3.44.0+ (November 2023)
1 parent cfcc7c3 commit 29ff6c4

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/cloudsync.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ char *db_version_build_query (sqlite3 *db) {
371371
"combined_query AS ("
372372
"SELECT GROUP_CONCAT(part, ' UNION ALL ') || ' UNION SELECT value as version FROM cloudsync_settings WHERE key = ''pre_alter_dbversion''' as full_query FROM query_parts"
373373
") "
374-
"SELECT CONCAT('SELECT max(version) as version FROM (', full_query, ');') FROM combined_query;";
374+
"SELECT 'SELECT max(version) as version FROM (' || full_query || ');' FROM combined_query;";
375375
return dbutils_text_select(db, sql);
376376
}
377377

src/cloudsync.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
extern "C" {
2121
#endif
2222

23-
#define CLOUDSYNC_VERSION "0.8.24"
23+
#define CLOUDSYNC_VERSION "0.8.25"
2424

2525
int sqlite3_cloudsync_init (sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi);
2626
int cloudsync_autoinit (void);

src/vtab.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ char *build_changes_sql (sqlite3 *db, const char *idxs) {
160160
" 'SELECT tbl, pk, col_name, col_value, col_version, db_version, site_id, cl, seq FROM (' || union_query || ')' "
161161
" AS final_string FROM union_query "
162162
") "
163-
"SELECT concat(final_string, ' ";
164-
const char *final_query = ";') FROM final_query;";
163+
"SELECT final_string || ' ";
164+
const char *final_query = ";' FROM final_query;";
165165

166166
static size_t query_len = 0;
167167
static size_t final_query_len = 0;

0 commit comments

Comments
 (0)