Fossil

Check-in [0a8fad6a]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Changes to the design of the alias table.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fossil-2.0
Files: files | file ages | folders
SHA1:0a8fad6a5d7bdeb97e75d8ca76690402a53ddba8
User & Date: drh 2017-02-27 23:17:46
Context
2017-02-28
00:56
Relax size constraints on artifact hash parsing. check-in: 65c59711 user: drh tags: fossil-2.0
2017-02-27
23:17
Changes to the design of the alias table. check-in: 0a8fad6a user: drh tags: fossil-2.0
22:33
Back out the change to the cluster artifact M-card that added an alias name. The plan is to transmit alias information by new cards in the sync protocol. check-in: a6ee563c user: drh tags: fossil-2.0
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/rebuild.c.

79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
...
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
@    cols TEXT,               -- A color-key specification
@    sqlcode TEXT             -- An SQL SELECT statement for this report
@ );
;
static const char zSchemaUpdate3[] =
@ -- Make sure the alias table exists.
@ --
@ CREATE TABLE alias(
@   hval TEXT,                      -- Hex-encoded hash value
@   htype ANY,                      -- Type of hash.
@   rid INTEGER REFERENCES blob,    -- Blob that this hash names
@   PRIMARY KEY(hval,htype)
@ ) WITHOUT ROWID;
@ CREATE INDEX alias_rid ON alias(rid,htype)
;

/*
** Update the schema as necessary
*/
static void rebuild_update_schema(void){
  int rc;
................................................................................
    percent_complete(0);
  }
  rebuild_update_schema();
  blob_init(&sql, 0, 0);
  db_prepare(&q,
     "SELECT name FROM sqlite_master /*scan*/"
     " WHERE type='table'"
     " AND name NOT IN ('admin_log', 'blob','delta','rcvfrom','user','hname',"
                       "'config','shun','private','reportfmt',"
                       "'concealed','accesslog','modreq',"
                       "'purgeevent','purgeitem','unversioned')"
     " AND name NOT GLOB 'sqlite_*'"
     " AND name NOT GLOB 'fx_*'"
  );
  while( db_step(&q)==SQLITE_ROW ){







|



|

|







 







|







79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
...
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
@    cols TEXT,               -- A color-key specification
@    sqlcode TEXT             -- An SQL SELECT statement for this report
@ );
;
static const char zSchemaUpdate3[] =
@ -- Make sure the alias table exists.
@ --
@ CREATE TABLE repository.alias(
@   hval TEXT,                      -- Hex-encoded hash value
@   htype ANY,                      -- Type of hash.
@   rid INTEGER REFERENCES blob,    -- Blob that this hash names
@   PRIMARY KEY(hval,htype,rid)
@ ) WITHOUT ROWID;
@ CREATE INDEX alias_rid ON alias(rid);
;

/*
** Update the schema as necessary
*/
static void rebuild_update_schema(void){
  int rc;
................................................................................
    percent_complete(0);
  }
  rebuild_update_schema();
  blob_init(&sql, 0, 0);
  db_prepare(&q,
     "SELECT name FROM sqlite_master /*scan*/"
     " WHERE type='table'"
     " AND name NOT IN ('admin_log', 'blob','delta','rcvfrom','user','alias',"
                       "'config','shun','private','reportfmt',"
                       "'concealed','accesslog','modreq',"
                       "'purgeevent','purgeitem','unversioned')"
     " AND name NOT GLOB 'sqlite_*'"
     " AND name NOT GLOB 'fx_*'"
  );
  while( db_step(&q)==SQLITE_ROW ){

Changes to src/schema.c.

117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
@ -- Each entry in the ALIAS table provides an alternative name by which an
@ -- artifact can be called.
@ --
@ CREATE TABLE alias(
@   hval TEXT,                      -- Hex-encoded hash value
@   htype ANY,                      -- Type of hash.
@   rid INTEGER REFERENCES blob,    -- Blob that this hash names
@   PRIMARY KEY(hval,htype)
@ ) WITHOUT ROWID;
@ CREATE INDEX alias_rid ON alias(rid,htype)
@
@ -- Information about users
@ --
@ -- The user.pw field can be either cleartext of the password, or
@ -- a SHA1 hash of the password.  If the user.pw field is exactly 40
@ -- characters long we assume it is a SHA1 hash.  Otherwise, it is
@ -- cleartext.  The sha1_shared_secret() routine computes the password







|

|







117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
@ -- Each entry in the ALIAS table provides an alternative name by which an
@ -- artifact can be called.
@ --
@ CREATE TABLE alias(
@   hval TEXT,                      -- Hex-encoded hash value
@   htype ANY,                      -- Type of hash.
@   rid INTEGER REFERENCES blob,    -- Blob that this hash names
@   PRIMARY KEY(hval,htype,id)
@ ) WITHOUT ROWID;
@ CREATE INDEX alias_rid ON alias(rid);
@
@ -- Information about users
@ --
@ -- The user.pw field can be either cleartext of the password, or
@ -- a SHA1 hash of the password.  If the user.pw field is exactly 40
@ -- characters long we assume it is a SHA1 hash.  Otherwise, it is
@ -- cleartext.  The sha1_shared_secret() routine computes the password