Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Avoid Tiger-incompatible SQL syntax
The index should always exist, so just leaving out IF EXISTS is probably OK.

See: https://trac.macports.org/ticket/53421
  • Loading branch information
jmroot committed Feb 7, 2017
1 parent 014e51f commit fcdbfd4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/cregistry/sql.c
Expand Up @@ -39,6 +39,12 @@
#include <tcl.h>
#include <time.h>

/*** Keep all SQL compatible with SQLite 3.1.3 as shipped with Tiger.
*** (Conditionally doing things a better way when possible based on
*** SQLITE_VERSION_NUMBER is OK.)
***/


/**
* Executes a null-terminated list of queries. Pass it a list of queries, it'll
* execute them. This is mainly intended for initialization, when you have a
Expand Down Expand Up @@ -387,7 +393,11 @@ int update_db(sqlite3* db, reg_error* errPtr) {
/* Delete the file_binary index, since it's a low-quality index
* according to https://www.sqlite.org/queryplanner-ng.html#howtofix */
static char* version_1_201_queries[] = {
#if SQLITE_VERSION_NUMBER >= 3003000
"DROP INDEX IF EXISTS registry.file_binary",
#else
"DROP INDEX registry.file_binary",
#endif
"UPDATE registry.metadata SET value = '1.201' WHERE key = 'version'",
"COMMIT",
NULL
Expand Down

0 comments on commit fcdbfd4

Please sign in to comment.