9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] [PATCH 6/6] ndb: document attribute name and value length constraints in BUGS section of man page
@ 2023-09-28  5:47 Romano
  2023-09-28  7:06 ` unobe
  0 siblings, 1 reply; 6+ messages in thread
From: Romano @ 2023-09-28  5:47 UTC (permalink / raw)
  To: 9front

---
diff 46cf9d4eb02a3a7c2516be3053994d4fb69eb949 0b5b2d58047b698564f6b1955a31cbcc95570abb
--- a/sys/man/8/ndb
+++ b/sys/man/8/ndb
@@ -924,3 +924,5 @@
 .I Ndb
 databases are case-sensitive;
 ethernet addresses must be in lower-case hexadecimal.
+.I Ndb
+database attributes are constrained to 32-byte attribute names and 64-byte attribute values.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9front] [PATCH 6/6] ndb: document attribute name and value length constraints in BUGS section of man page
  2023-09-28  5:47 [9front] [PATCH 6/6] ndb: document attribute name and value length constraints in BUGS section of man page Romano
@ 2023-09-28  7:06 ` unobe
  2023-12-11 19:19   ` unobe
  0 siblings, 1 reply; 6+ messages in thread
From: unobe @ 2023-09-28  7:06 UTC (permalink / raw)
  To: 9front

I came across these limitations (defined in /sys/include/ndb.h as
Ndbalen and Ndbvlen, respectively) when toying around with ndb as a
simple database.  This hopefully will save someone else some head
scratching when the query isn't returning as it should.

Quoth Romano <unobe@cpan.org>:
> ---
> diff 46cf9d4eb02a3a7c2516be3053994d4fb69eb949 0b5b2d58047b698564f6b1955a31cbcc95570abb
> --- a/sys/man/8/ndb
> +++ b/sys/man/8/ndb
> @@ -924,3 +924,5 @@
>  .I Ndb
>  databases are case-sensitive;
>  ethernet addresses must be in lower-case hexadecimal.
> +.I Ndb
> +database attributes are constrained to 32-byte attribute names and 64-byte attribute values.
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9front] [PATCH 6/6] ndb: document attribute name and value length constraints in BUGS section of man page
  2023-09-28  7:06 ` unobe
@ 2023-12-11 19:19   ` unobe
  2023-12-11 19:46     ` ori
  0 siblings, 1 reply; 6+ messages in thread
From: unobe @ 2023-12-11 19:19 UTC (permalink / raw)
  To: 9front

Ping.

Quoth unobe@cpan.org:
> I came across these limitations (defined in /sys/include/ndb.h as
> Ndbalen and Ndbvlen, respectively) when toying around with ndb as a
> simple database.  This hopefully will save someone else some head
> scratching when the query isn't returning as it should.
> 
> Quoth Romano <unobe@cpan.org>:
> > ---
> > diff 46cf9d4eb02a3a7c2516be3053994d4fb69eb949 0b5b2d58047b698564f6b1955a31cbcc95570abb
> > --- a/sys/man/8/ndb
> > +++ b/sys/man/8/ndb
> > @@ -924,3 +924,5 @@
> >  .I Ndb
> >  databases are case-sensitive;
> >  ethernet addresses must be in lower-case hexadecimal.
> > +.I Ndb
> > +database attributes are constrained to 32-byte attribute names and 64-byte attribute values.
> > 
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9front] [PATCH 6/6] ndb: document attribute name and value length constraints in BUGS section of man page
  2023-12-11 19:19   ` unobe
@ 2023-12-11 19:46     ` ori
  2024-01-12  4:21       ` unobe
  0 siblings, 1 reply; 6+ messages in thread
From: ori @ 2023-12-11 19:46 UTC (permalink / raw)
  To: 9front

Looking at the code, Ndbvlen seems to be a soft limit; it's only
the initial allocation to save a malloc, but we can grow past it;
see ndbsetval in /sys/src/libndb/ndbfree.c:29. There is a soft limit
coming from Brdline, which depends on the size of the buffer in the
NDB struct; maybe we should document that a line must be no longer
than 8k. (This was bumped not so long ago to support the large TXT
records needed by DKIM).

That said, I think documenting the attribute size is a good idea.


Quoth unobe@cpan.org:
> Ping.
> 
> Quoth unobe@cpan.org:
> > I came across these limitations (defined in /sys/include/ndb.h as
> > Ndbalen and Ndbvlen, respectively) when toying around with ndb as a
> > simple database.  This hopefully will save someone else some head
> > scratching when the query isn't returning as it should.
> > 
> > Quoth Romano <unobe@cpan.org>:
> > > ---
> > > diff 46cf9d4eb02a3a7c2516be3053994d4fb69eb949 0b5b2d58047b698564f6b1955a31cbcc95570abb
> > > --- a/sys/man/8/ndb
> > > +++ b/sys/man/8/ndb
> > > @@ -924,3 +924,5 @@
> > >  .I Ndb
> > >  databases are case-sensitive;
> > >  ethernet addresses must be in lower-case hexadecimal.
> > > +.I Ndb
> > > +database attributes are constrained to 32-byte attribute names and 64-byte attribute values.
> > > 
> > 
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9front] [PATCH 6/6] ndb: document attribute name and value length constraints in BUGS section of man page
  2023-12-11 19:46     ` ori
@ 2024-01-12  4:21       ` unobe
  2024-01-12 16:31         ` ori
  0 siblings, 1 reply; 6+ messages in thread
From: unobe @ 2024-01-12  4:21 UTC (permalink / raw)
  To: 9front

Thanks, ori.  I hadn't noticed that!  But I don't see any
corresponding soft limit for the attribute.  Do I understand correctly
that /sys/src/libndb/ndbaux.c:34 just clips the attribute down to 32
bytes?

Quoth ori@eigenstate.org:
> Looking at the code, Ndbvlen seems to be a soft limit; it's only
> the initial allocation to save a malloc, but we can grow past it;
> see ndbsetval in /sys/src/libndb/ndbfree.c:29. There is a soft limit
> coming from Brdline, which depends on the size of the buffer in the
> NDB struct; maybe we should document that a line must be no longer
> than 8k. (This was bumped not so long ago to support the large TXT
> records needed by DKIM).
> 
> That said, I think documenting the attribute size is a good idea.
> 
> 
> Quoth unobe@cpan.org:
> > Ping.
> > 
> > Quoth unobe@cpan.org:
> > > I came across these limitations (defined in /sys/include/ndb.h as
> > > Ndbalen and Ndbvlen, respectively) when toying around with ndb as a
> > > simple database.  This hopefully will save someone else some head
> > > scratching when the query isn't returning as it should.
> > > 
> > > Quoth Romano <unobe@cpan.org>:
> > > > ---
> > > > diff 46cf9d4eb02a3a7c2516be3053994d4fb69eb949 0b5b2d58047b698564f6b1955a31cbcc95570abb
> > > > --- a/sys/man/8/ndb
> > > > +++ b/sys/man/8/ndb
> > > > @@ -924,3 +924,5 @@
> > > >  .I Ndb
> > > >  databases are case-sensitive;
> > > >  ethernet addresses must be in lower-case hexadecimal.
> > > > +.I Ndb
> > > > +database attributes are constrained to 32-byte attribute names and 64-byte attribute values.
> > > > 
> > > 
> > 
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9front] [PATCH 6/6] ndb: document attribute name and value length constraints in BUGS section of man page
  2024-01-12  4:21       ` unobe
@ 2024-01-12 16:31         ` ori
  0 siblings, 0 replies; 6+ messages in thread
From: ori @ 2024-01-12 16:31 UTC (permalink / raw)
  To: 9front

Quoth unobe@cpan.org:
> Thanks, ori.  I hadn't noticed that!  But I don't see any
> corresponding soft limit for the attribute.  Do I understand correctly
> that /sys/src/libndb/ndbaux.c:34 just clips the attribute down to 32
> bytes?

That seems like a bad idea; we should almost certainly return an error.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-01-12 16:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-28  5:47 [9front] [PATCH 6/6] ndb: document attribute name and value length constraints in BUGS section of man page Romano
2023-09-28  7:06 ` unobe
2023-12-11 19:19   ` unobe
2023-12-11 19:46     ` ori
2024-01-12  4:21       ` unobe
2024-01-12 16:31         ` ori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).