Index on identity sync
authorKrista 'DarthMama' Bennett <krista@pep.foundation>
Mon, 03 Jun 2019 14:56:29 +0200
branchsync
changeset 3806b9c98a86b791
parent 3802 f653ae6d73ea
child 3807 9c8a6cc4eb8d
child 3809 d40dc7086275
child 3828 8b28b328fd1b
Index on identity
src/pEpEngine.c
test/src/SuiteMaker.cc
     1.1 --- a/src/pEpEngine.c	Mon Jun 03 13:58:16 2019 +0200
     1.2 +++ b/src/pEpEngine.c	Mon Jun 03 14:56:29 2019 +0200
     1.3 @@ -968,6 +968,7 @@
     1.4                  "   timestamp integer default (datetime('now')),\n"
     1.5                  "   primary key (address, user_id)\n"
     1.6                  ");\n"
     1.7 +                "create index if not exists identity_userid_addr on identity(address, user_id);\n"
     1.8                  "create table if not exists trust (\n"
     1.9                  "   user_id text not null\n"
    1.10                  "       references person (id)\n"
    1.11 @@ -1423,6 +1424,17 @@
    1.12                  if (status != PEP_STATUS_OK)
    1.13                      return status;
    1.14              }
    1.15 +            if (version < 12) {
    1.16 +                int_result = sqlite3_exec(
    1.17 +                    _session->db,
    1.18 +                    "create index if not exists identity_userid_addr on identity(address, user_id);\n"
    1.19 +                    ,
    1.20 +                    NULL,
    1.21 +                    NULL,
    1.22 +                    NULL
    1.23 +                );
    1.24 +                assert(int_result == SQLITE_OK);                
    1.25 +            }
    1.26          }        
    1.27          else { 
    1.28              // Version from DB was 0, it means this is initial setup.
     2.1 --- a/test/src/SuiteMaker.cc	Mon Jun 03 13:58:16 2019 +0200
     2.2 +++ b/test/src/SuiteMaker.cc	Mon Jun 03 14:56:29 2019 +0200
     2.3 @@ -24,6 +24,7 @@
     2.4  #include "NoOwnIdentWritesOnDecryptTests.h"
     2.5  #include "LiteralFilenameTests.h"
     2.6  #include "I18nTests.h"
     2.7 +#include "Message2_1Tests.h"
     2.8  #include "IdentityListTests.h"
     2.9  #include "PgpBinaryTests.h"
    2.10  #include "SubkeyRatingEvalTests.h"
    2.11 @@ -39,6 +40,7 @@
    2.12  #include "KeyringImportTests.h"
    2.13  #include "EnterLeaveDeviceGroupTests.h"
    2.14  #include "SignOnlyTests.h"
    2.15 +#include "LotsOfKeysTests.h"
    2.16  #include "BCCTests.h"
    2.17  #include "Engine358Tests.h"
    2.18  #include "BlacklistAcceptNewKeyTests.h"
    2.19 @@ -87,6 +89,7 @@
    2.20      "NoOwnIdentWritesOnDecryptTests",
    2.21      "LiteralFilenameTests",
    2.22      "I18nTests",
    2.23 +    "Message2_1Tests",
    2.24      "IdentityListTests",
    2.25      "PgpBinaryTests",
    2.26      "SubkeyRatingEvalTests",
    2.27 @@ -102,6 +105,7 @@
    2.28      "KeyringImportTests",
    2.29      "EnterLeaveDeviceGroupTests",
    2.30      "SignOnlyTests",
    2.31 +    "LotsOfKeysTests",
    2.32      "BCCTests",
    2.33      "Engine358Tests",
    2.34      "BlacklistAcceptNewKeyTests",
    2.35 @@ -138,7 +142,7 @@
    2.36  };
    2.37  
    2.38  // This file is generated, so magic constants are ok.
    2.39 -int SuiteMaker::num_suites = 60;
    2.40 +int SuiteMaker::num_suites = 62;
    2.41  
    2.42  void SuiteMaker::suitemaker_build(const char* test_class_name, const char* test_home, Test::Suite** test_suite) {
    2.43      if (strcmp(test_class_name, "URIAddressTests") == 0)
    2.44 @@ -165,6 +169,8 @@
    2.45          *test_suite = new LiteralFilenameTests(test_class_name, test_home);
    2.46      else if (strcmp(test_class_name, "I18nTests") == 0)
    2.47          *test_suite = new I18nTests(test_class_name, test_home);
    2.48 +    else if (strcmp(test_class_name, "Message2_1Tests") == 0)
    2.49 +        *test_suite = new Message2_1Tests(test_class_name, test_home);
    2.50      else if (strcmp(test_class_name, "IdentityListTests") == 0)
    2.51          *test_suite = new IdentityListTests(test_class_name, test_home);
    2.52      else if (strcmp(test_class_name, "PgpBinaryTests") == 0)
    2.53 @@ -195,6 +201,8 @@
    2.54          *test_suite = new EnterLeaveDeviceGroupTests(test_class_name, test_home);
    2.55      else if (strcmp(test_class_name, "SignOnlyTests") == 0)
    2.56          *test_suite = new SignOnlyTests(test_class_name, test_home);
    2.57 +    else if (strcmp(test_class_name, "LotsOfKeysTests") == 0)
    2.58 +        *test_suite = new LotsOfKeysTests(test_class_name, test_home);
    2.59      else if (strcmp(test_class_name, "BCCTests") == 0)
    2.60          *test_suite = new BCCTests(test_class_name, test_home);
    2.61      else if (strcmp(test_class_name, "Engine358Tests") == 0)