Documentation Source Text

Check-in [d3fa7ece9a]
Login

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

Overview
Comment:Enhance the chronology.html page so that the table columns are sortable.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d3fa7ece9a2fdc58689eb4ae546f7819e7f314c76b274fb32492444e2fbbd60d
User & Date: drh 2017-07-31 14:16:44
Context
2017-07-31
20:19
Mention the column-name fix in the change log for 3.20.0. check-in: 86057a37ce user: drh tags: trunk
14:16
Enhance the chronology.html page so that the table columns are sortable. check-in: d3fa7ece9a user: drh tags: trunk
2017-07-30
20:28
Fix a broken link to the A350 on the Well-Known users page. check-in: aa249826dc user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pages/changes.in.

17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
...
104
105
106
107
108
109
110



111
112
113
114
115
116
117
proc chng {date desc {options {}}} {
  global nChng aChng xrefChng
  set aChng($nChng) [list $date $desc $options]
  set xrefChng($date) $nChng
  incr nChng
}

chng {2017-07-26 (3.20.0)} {
<li> Update the text of error messages returned by [sqlite3_errmsg()] for some
     error codes.
<li> Add new [pointer passing interfaces].
<li> Backwards-incompatible changes to some extensions in order to take 
     advantage of the improved security offered by the new 
     [pointer passing interfaces]:
     <ul>
................................................................................
<li> Ensure that the query planner knows that any column of a 
     [flattening optimization|flattened] LEFT JOIN can be NULL even 
     if that column is labeled with "NOT NULL". Fix for ticket 
     [https://sqlite.org/src/info/892fc34f173e99d8|892fc34f173e99d8].
<li> Fix rare false-positives in [PRAGMA integrity_check] when run on a database connection
     with [ATTACH|attached databases]. Ticket
     [https://sqlite.org/src/info/a4e06e75a9ab61a12|a4e06e75a9ab61a12]



}

chng {2017-06-17 (3.18.2)} {
<li>Fix a bug that might cause duplicate output rows when an IN operator is
    used in the WHERE clause.
    Ticket [https://sqlite.org/src/info/61fe9745|61fe9745].
<p><b>Hashes:</b>







|







 







>
>
>







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
...
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
proc chng {date desc {options {}}} {
  global nChng aChng xrefChng
  set aChng($nChng) [list $date $desc $options]
  set xrefChng($date) $nChng
  incr nChng
}

chng {2017-08-01 (3.20.0)} {
<li> Update the text of error messages returned by [sqlite3_errmsg()] for some
     error codes.
<li> Add new [pointer passing interfaces].
<li> Backwards-incompatible changes to some extensions in order to take 
     advantage of the improved security offered by the new 
     [pointer passing interfaces]:
     <ul>
................................................................................
<li> Ensure that the query planner knows that any column of a 
     [flattening optimization|flattened] LEFT JOIN can be NULL even 
     if that column is labeled with "NOT NULL". Fix for ticket 
     [https://sqlite.org/src/info/892fc34f173e99d8|892fc34f173e99d8].
<li> Fix rare false-positives in [PRAGMA integrity_check] when run on a database connection
     with [ATTACH|attached databases]. Ticket
     [https://sqlite.org/src/info/a4e06e75a9ab61a12|a4e06e75a9ab61a12]
<li> Fix a bug (discovered by OSSFuzz) that causes an assertion fault if certain
     dodgy CREATE TABLE declarations are used.  Ticket
     [https://sqlite.org/src/info/bc115541132dad136|bc115541132dad136]
}

chng {2017-06-17 (3.18.2)} {
<li>Fix a bug that might cause duplicate output rows when an IN operator is
    used in the WHERE clause.
    Ticket [https://sqlite.org/src/info/61fe9745|61fe9745].
<p><b>Hashes:</b>

Changes to pages/chronology.in.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
..
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
...
313
314
315
316
317
318
319








320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339

340
























































































































341
342
343
344
345
346
<title>History Of SQLite Releases</title>
<tcl>hd_keywords {chronology} {prior releases}</tcl>
<h1 align=center>History Of SQLite Releases</h1>

<center>
<table border=0 cellspacing=0>
<thead>
<tr><th>Date<th><th align='left'>Version
</thead>
<tbody>
<tcl>
set nRelease 0
set mxDate {1970-01-01}
set mnDate {2999-12-31}
# The following data was originally generated on 2016-09-03 using an
................................................................................
#    ORDER BY mtime DESC;
#
# A small amount of manual editing and de-duplication followed.
#
# Manually edit the list for each subsequent release.
#      
foreach line [split {
xxxxxxxxxx|pending|version 3.20.0
036ebf729e|2017-06-17|version 3.18.2
77bb46233d|2017-06-16|version 3.18.1
0ee482a1e0|2017-06-08|version 3.19.3
edb4e819b0|2017-05-25|version 3.19.2
f6d7b988f4|2017-05-24|version 3.19.1
28a94eb282|2017-05-22|version 3.19.0
424a0d3803|2017-03-28|version 3.18.0
ada05cfa86|2017-02-13|version 3.17.0
a65a62893c|2017-01-06|version 3.16.2
979f043928|2017-01-03|Version 3.16.1
04ac0b75b1|2017-01-02|Version 3.16.0
bbd85d235f|2016-11-28|Version 3.15.2
1136863c76|2016-11-04|Version 3.15.1
707875582f|2016-10-14|Version 3.15.0
29dbef4b85|2016-09-12|Version 3.14.2
a12d805977|2016-08-11|Version 3.14.1
................................................................................
e8521fc10d|2000-08-18|Version 1.0.1 (CVS 498)
f37dd18e3f|2000-08-17|Version 1.0 (CVS 499)
} \n] {
  if {[string trim $line]==""} continue
  foreach {uuid date vers1} [split $line |] break
  regexp {[123]\.[0-9.]+} $vers1 vers
  set vers [string trim $vers .]








  set dateofversion($vers) $date
  hd_puts "<tr>"
  if {[regexp {\d\d\d\d-\d\d-\d\d} $date]} {
    set url https://www.sqlite.org/src/timeline
    append url ?c=$uuid&y=ci
    hd_puts "<td><a href='$url'>$date</a></td>\n"
    if {$date>$mxDate} {set mxDate $date}
    if {$date<$mnDate} {set mnDate $date}
  } else {
    hd_puts "<td>$date</td>\n"
  }
  incr nRelease
  hd_puts "<td width='20'></td>\n"
  if {[info exists "glink(version $vers)"]} {
    hd_resolve "<td>\[version $vers|$vers\]</td></tr>\n"
  } else {
    hd_puts "<td>$vers</td></tr>\n"
  }
}
</tcl>

</table>
























































































































<p>
<tcl>
set nDay [db eval {SELECT julianday($mxDate)-julianday($mnDate)}]
hd_putsnl "<i>$nRelease releases"
hd_putsnl "over [format %.1f [expr {$nDay/365.24}]] years.</i>"
</tcl>





|

|







 







|
|
|
|
|
|
|
|
|
|







 







>
>
>
>
>
>
>
>





|



|


|

|

|



>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>






1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
..
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
...
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
<title>History Of SQLite Releases</title>
<tcl>hd_keywords {chronology} {prior releases}</tcl>
<h1 align=center>History Of SQLite Releases</h1>

<center>
<table border=0 cellspacing=0 id='chrontab'>
<thead>
<tr><th class='sort desc'>Date<th class='sort none'>Version
</thead>
<tbody>
<tcl>
set nRelease 0
set mxDate {1970-01-01}
set mnDate {2999-12-31}
# The following data was originally generated on 2016-09-03 using an
................................................................................
#    ORDER BY mtime DESC;
#
# A small amount of manual editing and de-duplication followed.
#
# Manually edit the list for each subsequent release.
#      
foreach line [split {
xxxxxxxxxx|pending|Version 3.20.0
036ebf729e|2017-06-17|Version 3.18.2
77bb46233d|2017-06-16|Version 3.18.1
0ee482a1e0|2017-06-08|Version 3.19.3
edb4e819b0|2017-05-25|Version 3.19.2
f6d7b988f4|2017-05-24|Version 3.19.1
28a94eb282|2017-05-22|Version 3.19.0
424a0d3803|2017-03-28|Version 3.18.0
ada05cfa86|2017-02-13|Version 3.17.0
a65a62893c|2017-01-06|Version 3.16.2
979f043928|2017-01-03|Version 3.16.1
04ac0b75b1|2017-01-02|Version 3.16.0
bbd85d235f|2016-11-28|Version 3.15.2
1136863c76|2016-11-04|Version 3.15.1
707875582f|2016-10-14|Version 3.15.0
29dbef4b85|2016-09-12|Version 3.14.2
a12d805977|2016-08-11|Version 3.14.1
................................................................................
e8521fc10d|2000-08-18|Version 1.0.1 (CVS 498)
f37dd18e3f|2000-08-17|Version 1.0 (CVS 499)
} \n] {
  if {[string trim $line]==""} continue
  foreach {uuid date vers1} [split $line |] break
  regexp {[123]\.[0-9.]+} $vers1 vers
  set vers [string trim $vers .]
  set vlist [split $vers .]
  set vnum [expr {1000000*[lindex $vlist 0]+10000*[lindex $vlist 1]}]
  if {[lindex $vlist 2]!=""} {
    incr vnum [expr {100*[lindex $vlist 2]}]
    if {[lindex $vlist 3]!=""} {
      incr vnum [lindex $vlist 3]
    }
  }
  set dateofversion($vers) $date
  hd_puts "<tr>"
  if {[regexp {\d\d\d\d-\d\d-\d\d} $date]} {
    set url https://www.sqlite.org/src/timeline
    append url ?c=$uuid&y=ci
    hd_puts "<td width='100' align='center'><a href='$url'>$date</a></td>\n"
    if {$date>$mxDate} {set mxDate $date}
    if {$date<$mnDate} {set mnDate $date}
  } else {
    hd_puts "<td width='100' align='center'>$date</td>\n"
  }
  incr nRelease
  hd_puts "<td width='100' align='center' data-sortkey='$vnum'>"
  if {[info exists "glink(version $vers)"]} {
    hd_resolve "\[version $vers|$vers\]</td></tr>\n"
  } else {
    hd_puts "$vers</td></tr>\n"
  }
}
</tcl>
</tbody>
</table>
<tcl>
hd_puts {<script>
function SortableTable(tableEl,columnTypes,initSort){
  this.tbody = tableEl.getElementsByTagName('tbody');
  this.columnTypes = columnTypes;
  var ncols = tableEl.rows[0].cells.length;
  for(var i = columnTypes.length; i<=ncols; i++){this.columnTypes += 't';}
  this.sort = function (cell) {
    var column = cell.cellIndex;
    var sortFn;
    switch( cell.sortType ){
      case "n": sortFn = this.sortNumeric;  break;
      case "t": sortFn = this.sortText;  break;
      case "T": sortFn = this.sortReverseText;  break;
      case "k": sortFn = this.sortKey;  break;
      case "K": sortFn = this.sortReverseKey;  break;
      default:  return;
    }
    this.sortIndex = column;
    var newRows = new Array();
    for (j = 0; j < this.tbody[0].rows.length; j++) {
       newRows[j] = this.tbody[0].rows[j];
    }
    if( this.sortIndex==Math.abs(this.prevColumn)-1 ){
      newRows.reverse();
      this.prevColumn = -this.prevColumn;
    }else{
      newRows.sort(sortFn);
      this.prevColumn = this.sortIndex+1;
    }
    for (i=0;i<newRows.length;i++) {
      this.tbody[0].appendChild(newRows[i]);
    }
    this.setHdrIcons();
  }
  this.setHdrIcons = function() {
    for (var i=0; i<this.hdrRow.cells.length; i++) {
      if( this.columnTypes[i]=='x' ) continue;
      var sortType;
      if( this.prevColumn==i+1 ){
        sortType = 'asc';
      }else if( this.prevColumn==(-1-i) ){
        sortType = 'desc'
      }else{
        sortType = 'none';
      }
      var hdrCell = this.hdrRow.cells[i];
      var clsName = hdrCell.className.replace(/\s*\bsort\s*\w+/, '');
      clsName += ' sort ' + sortType;
      hdrCell.className = clsName;
    }
  }
  this.sortText = function(a,b) {
    var i = thisObject.sortIndex;
    aa = a.cells[i].textContent.replace(/^\W+/,'').toLowerCase();
    bb = b.cells[i].textContent.replace(/^\W+/,'').toLowerCase();
    if(aa<bb) return -1;
    if(aa==bb) return a.rowIndex-b.rowIndex;
    return 1;
  }
  this.sortReverseText = function(a,b) {
    var i = thisObject.sortIndex;
    aa = a.cells[i].textContent.replace(/^\W+/,'').toLowerCase();
    bb = b.cells[i].textContent.replace(/^\W+/,'').toLowerCase();
    if(aa<bb) return +1;
    if(aa==bb) return a.rowIndex-b.rowIndex;
    return -1;
  }
  this.sortNumeric = function(a,b) {
    var i = thisObject.sortIndex;
    aa = parseFloat(a.cells[i].textContent);
    if (isNaN(aa)) aa = 0;
    bb = parseFloat(b.cells[i].textContent);
    if (isNaN(bb)) bb = 0;
    if(aa==bb) return a.rowIndex-b.rowIndex;
    return aa-bb;
  }
  this.sortKey = function(a,b) {
    var i = thisObject.sortIndex;
    aa = a.cells[i].getAttribute("data-sortkey");
    bb = b.cells[i].getAttribute("data-sortkey");
    if(aa<bb) return -1;
    if(aa==bb) return a.rowIndex-b.rowIndex;
    return 1;
  }
  this.sortReverseKey = function(a,b) {
    var i = thisObject.sortIndex;
    aa = a.cells[i].getAttribute("data-sortkey");
    bb = b.cells[i].getAttribute("data-sortkey");
    if(aa<bb) return +1;
    if(aa==bb) return a.rowIndex-b.rowIndex;
    return -1;
  }
  var x = tableEl.getElementsByTagName('thead');
  if(!(this.tbody && this.tbody[0].rows && this.tbody[0].rows.length>0)){
    return;
  }
  if(x && x[0].rows && x[0].rows.length > 0) {
    this.hdrRow = x[0].rows[0];
  } else {
    return;
  }
  var thisObject = this;
  this.prevColumn = initSort;
  for (var i=0; i<this.hdrRow.cells.length; i++) {
    if( columnTypes[i]=='x' ) continue;
    var hdrcell = this.hdrRow.cells[i];
    hdrcell.sTable = this;
    hdrcell.style.cursor = "pointer";
    hdrcell.sortType = columnTypes[i] || 't';
    hdrcell.onclick = function () {
      this.sTable.sort(this);
      return false;
    }
  }
  this.setHdrIcons()
}
var t = new SortableTable(document.getElementById("chrontab"),"TK",1);
</script>
}</tcl>
<p>
<tcl>
set nDay [db eval {SELECT julianday($mxDate)-julianday($mnDate)}]
hd_putsnl "<i>$nRelease releases"
hd_putsnl "over [format %.1f [expr {$nDay/365.24}]] years.</i>"
</tcl>

Changes to rawpages/sqlite.css.

260
261
262
263
264
265
266















}

.footer {
  padding-top: 2px;
  padding-bottom: 1px;
  border-top: 2px solid #044a64;
}






















>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
}

.footer {
  padding-top: 2px;
  padding-bottom: 1px;
  border-top: 2px solid #044a64;
}

th.sort:after {
  margin-left: .4em;
  cursor: pointer;
  text-shadow: 0 0 0 #000; /* Makes arrow darker */
}
th.sort.none:after {
  content: '\2666';
}
th.sort.asc:after {
  content: '\2193';
}
th.sort.desc:after {
  content: '\2191'
}