Check-in [e07a8747a8]
Not logged in

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

Overview
Comment:Fix a bug where fts3 was not being used. (CVS 1264)
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:e07a8747a81505e2bc284fbee7d2813c33bbdeba
User & Date: danielk1977 2008-02-10 07:50:01
Context
2008-02-14
08:39
Fix a crash in the code for handling malformed html tables. (CVS 1265) check-in: 1566da3fee user: danielk1977 tags: trunk
2008-02-10
07:50
Fix a bug where fts3 was not being used. (CVS 1264) check-in: e07a8747a8 user: danielk1977 tags: trunk
2008-02-09
18:14
Work around the problems with tls by not writing to the socket until the SSL connection has been established. Detect this by polling. (CVS 1263) check-in: c009d97cdd user: danielk1977 tags: trunk
Changes

Changes to hv/hv3_bookmarks.tcl.

1
2
3
4
5
6
7
8
..
67
68
69
70
71
72
73
74
75
76













77
78
79
80
81
82
83
84
85
86

87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
namespace eval hv3 { set {version($Id: hv3_bookmarks.tcl,v 1.21 2008/01/31 05:57:46 danielk1977 Exp $)} 1 }

namespace eval ::hv3::bookmarks {

  set INSTRUCTIONS {
BASICS:

This set of frames is Hv3's bookmarks-system-slash-homepage. Initially,
................................................................................

You can search the bookmarks database using SQLite's FTS3 extension by 
entering a string in the search box at the top of this frame and 
pressing enter.
  }

  set fts3_warning ""
  set ::hv3::have_fts3 0

  proc noop {args} {}














  proc ensure_initialized {} {
    set db ::hv3::sqlitedb
    $db transaction {
	if {![$db exists {select * from sqlite_master
	    where name = 'bm_bookmark2'}]} {
	    puts stderr "initializing bookmark database.."
	    initialise_database
	}
    }

  }

  proc initialise_database {} {
    set rc [catch {
      ::hv3::sqlitedb eval {
        CREATE VIRTUAL TABLE bm_fulltext2 USING fts3(
          caption, description, snapshot
        );
      }
    }]

    # Test if fts3 is present.
    #
    set ::hv3::have_fts3 [expr {![catch {::hv3::sqlitedb eval {
      SELECT * FROM bm_fulltext2 WHERE 0
    }} msg]}]
    if {$::hv3::have_fts3 == 0} {
      puts "WARNING: fts3 not loaded ($msg)"
      set ::hv3::bookmarks::save_snapshot_variable 0
    }

    set rc [catch {
      ::hv3::sqlitedb eval {

        -- has_snapshot interpretation:
        --
        --     0 -> There is no snapshot (snapshot column is NULL)
|







 







<


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










>











<
<
<
<
<
|
<
<
<







1
2
3
4
5
6
7
8
..
67
68
69
70
71
72
73

74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110





111



112
113
114
115
116
117
118
namespace eval hv3 { set {version($Id: hv3_bookmarks.tcl,v 1.22 2008/02/10 07:50:01 danielk1977 Exp $)} 1 }

namespace eval ::hv3::bookmarks {

  set INSTRUCTIONS {
BASICS:

This set of frames is Hv3's bookmarks-system-slash-homepage. Initially,
................................................................................

You can search the bookmarks database using SQLite's FTS3 extension by 
entering a string in the search box at the top of this frame and 
pressing enter.
  }

  set fts3_warning ""


  proc noop {args} {}

  proc have_fts3 {} {
    if {[info exists ::hv3::have_fts3]} {return $::hv3::have_fts3}
    # Test if fts3 is present.
    #
    set ::hv3::have_fts3 [expr {![catch {::hv3::sqlitedb eval {
      SELECT * FROM bm_fulltext2 WHERE 0
    }} msg]}]
    if {$::hv3::have_fts3 == 0} {
      puts "WARNING: fts3 not loaded ($msg)"
      set ::hv3::bookmarks::save_snapshot_variable 0
    }
  }

  proc ensure_initialized {} {
    set db ::hv3::sqlitedb
    $db transaction {
	if {![$db exists {select * from sqlite_master
	    where name = 'bm_bookmark2'}]} {
	    puts stderr "initializing bookmark database.."
	    initialise_database
	}
    }
    have_fts3
  }

  proc initialise_database {} {
    set rc [catch {
      ::hv3::sqlitedb eval {
        CREATE VIRTUAL TABLE bm_fulltext2 USING fts3(
          caption, description, snapshot
        );
      }
    }]






    have_fts3




    set rc [catch {
      ::hv3::sqlitedb eval {

        -- has_snapshot interpretation:
        --
        --     0 -> There is no snapshot (snapshot column is NULL)