Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Matter will be damaged in direct proportion to its value.


devel / comp.lang.tcl / Re: Incomplete sqlite query output

SubjectAuthor
* Incomplete sqlite query outputLuc
`* Incomplete sqlite query outputRich
 `- Incomplete sqlite query outputLuc

1
Incomplete sqlite query output

<20231210020818.2146a0d2@lud1.home>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=12926&group=comp.lang.tcl#12926

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!news.swapon.de!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: luc@sep.invalid (Luc)
Newsgroups: comp.lang.tcl
Subject: Incomplete sqlite query output
Date: Sun, 10 Dec 2023 02:08:18 -0300
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <20231210020818.2146a0d2@lud1.home>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="a13d18fdbd39421c5005dfdfbdad00be";
logging-data="2712961"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19jGobwJ5JR/t/TANT4lbpDvjS84/ymLvM="
Cancel-Lock: sha1:virOA5NlP6x/wjadEKz4RAjk2DI=
 by: Luc - Sun, 10 Dec 2023 05:08 UTC

I am running this query on an sqlite database using an application called
DB Browser for SQLite:

SELECT tg FROM master WHERE sc like 'Bingo!';

I get 9 lines of output:

"Win!"
"Jackpot!"
"Jackpot!"
"Jackpot!"
"Jackpot!"
"Got it!"
"Jackpot!"
"Jackpot!"
"Win!"

But in my Tcl code, I get this:

sqlDB eval "SELECT tg FROM master WHERE sc like '$searchstring';" {
if {$tg != ""} {lappend ::cleanlist [string trim $tg]; puts "master $tg"}
}

master Jackpot!
master Jackpot!
master Jackpot!
master Jackpot!

Of course there is a lot more code around it, but it is around it and
the puts command is right where it is. There is nothing in between that
could interfere with the output.

I thought that maybe some invisible space or something very subtle
could be filtering out some of the results, but the exact same query
gives 5 more lines of output in DB Browser for SQLite.

Why are all the other results missing when I use Tcl?

--
Luc
>>

Re: Incomplete sqlite query output

<ul3hl4$2itli$2@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=12927&group=comp.lang.tcl#12927

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!paganini.bofh.team!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rich@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: Incomplete sqlite query output
Date: Sun, 10 Dec 2023 05:17:24 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <ul3hl4$2itli$2@dont-email.me>
References: <20231210020818.2146a0d2@lud1.home>
Injection-Date: Sun, 10 Dec 2023 05:17:24 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="16a610a13c26b161b2b8e832894e5d06";
logging-data="2717362"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/YE6l1rWYo/wC3FwBzu/QS"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.117 (x86_64))
Cancel-Lock: sha1:b9RBEZ4VkZKZ0j4IKYJ8B6vT0qQ=
 by: Rich - Sun, 10 Dec 2023 05:17 UTC

Luc <luc@sep.invalid> wrote:
> sqlDB eval "SELECT tg FROM master WHERE sc like '$searchstring';" {
> if {$tg != ""} {lappend ::cleanlist [string trim $tg]; puts "master $tg"}
> }

What is the exact contents of $searchstring just before this statement
is executed?

> Why are all the other results missing when I use Tcl?

Unknown, although one possibility is that the 'browser' app and your
Tcl code are opening different sqlite datafiles that contain differing
data.

Re: Incomplete sqlite query output

<20231210152708.1af7030b@lud1.home>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=12929&group=comp.lang.tcl#12929

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: luc@sep.invalid (Luc)
Newsgroups: comp.lang.tcl
Subject: Re: Incomplete sqlite query output
Date: Sun, 10 Dec 2023 15:27:08 -0300
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <20231210152708.1af7030b@lud1.home>
References: <20231210020818.2146a0d2@lud1.home>
<ul3hl4$2itli$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="c30b0867e405b759531cd7c85be10be5";
logging-data="2917688"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+0Hi7SEtFG8Vkc8Crmh739bl/RfawZRS0="
Cancel-Lock: sha1:czqpEZ5JNoAgS95oDtyKzKs6Wy4=
 by: Luc - Sun, 10 Dec 2023 18:27 UTC

On Sun, 10 Dec 2023 05:17:24 -0000 (UTC), Rich wrote:

>Luc <luc@sep.invalid> wrote:
>> sqlDB eval "SELECT tg FROM master WHERE sc like '$searchstring';" {
>> if {$tg != ""} {lappend ::cleanlist [string trim $tg]; puts
>> "master $tg"} }
>
>What is the exact contents of $searchstring just before this statement
>is executed?
>
>> Why are all the other results missing when I use Tcl?
>
>Unknown, although one possibility is that the 'browser' app and your
>Tcl code are opening different sqlite datafiles that contain differing
>data.
**************************

It was my mistake and I apologize.

After some hours of much needed sleep and a new analysis, I discovered
that one side was querying "Bingo!" while the other was actually querying
"- Bingo!"

The dash may or may not be present in many lines.

I decided to run two queries every time. The second one parses the
first one to detect the first alpha character and discard everything
before it. I collect from both queries. It's a good stopgap for now.

I will look into using the sqlite regex function to cover a wider range
of possibilities.

Thank you again and sorry for the trouble.

--
Luc
>>

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor