You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Julian Foad <ju...@wandisco.com> on 2010/11/30 15:34:21 UTC

Can I add "NOT NULL" to PRISTINE table columns?

In r1040574 I noted that the 'size' and 'md5_checksum' columns in the
PRISTINE table are never currently null.  The latter is required by
current code to be non-null.

I feel it would be better to have the schema specify 'NOT NULL' for
these two columns.  Just a feeling of Goodness, no concrete reasons.

I imagine it should be possible to add 'NOT NULL' to these columns
without performing a format bump or writing any upgrade code.  Am I
right?


 CREATE TABLE PRISTINE (
[...] 
      NULL if unknown, and (thus) the pristine copy is incomplete/unusable.
+     ### We always set this; there may be no need to allow NULL. Shall we
+         add "NOT NULL" to the schema? */
   size  INTEGER,
 
[...]
+     ### We always set this and require it to be non-null. Can we add
+         "NOT NULL" to the schema? */
   md5_checksum  TEXT
   );

- Julian


Re: Can I add "NOT NULL" to PRISTINE table columns?

Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
On Tue, Nov 30, 2010 at 9:34 AM, Julian Foad <ju...@wandisco.com> wrote:
> In r1040574 I noted that the 'size' and 'md5_checksum' columns in the
> PRISTINE table are never currently null.  The latter is required by
> current code to be non-null.
>
> I feel it would be better to have the schema specify 'NOT NULL' for
> these two columns.  Just a feeling of Goodness, no concrete reasons.
>
> I imagine it should be possible to add 'NOT NULL' to these columns
> without performing a format bump or writing any upgrade code.  Am I
> right?

If we're already enforcing it in the C code, I see no problem with
doing so in the sql schema.  Additionally, I don't really see how you
could add the 'NOT NULL' clause in a format bump without doing table
duplication, which doesn't seem worth the trouble for something like
this.

-Hyrum

>
>
>  CREATE TABLE PRISTINE (
> [...]
>      NULL if unknown, and (thus) the pristine copy is incomplete/unusable.
> +     ### We always set this; there may be no need to allow NULL. Shall we
> +         add "NOT NULL" to the schema? */
>   size  INTEGER,
>
> [...]
> +     ### We always set this and require it to be non-null. Can we add
> +         "NOT NULL" to the schema? */
>   md5_checksum  TEXT
>   );
>
> - Julian
>
>
>

Re: Can I add "NOT NULL" to PRISTINE table columns?

Posted by Julian Foad <ju...@wandisco.com>.
I (Julian Foad) wrote:
> > Julian Foad <ju...@wandisco.com> writes:
> > 
> > > I imagine it should be possible to add 'NOT NULL' to these columns
> > > without performing a format bump or writing any upgrade code.  Am I
> > > right?
> 
> Hyrum Wright wrote:
> > If we're already enforcing it in the C code, I see no problem with
> > doing so in the sql schema.  Additionally, I don't really see how you
> > could add the 'NOT NULL' clause in a format bump without doing table
> > duplication, which doesn't seem worth the trouble for something like
> > this.
> 
> Right.
> 
> Philip Martin wrote:
> > Existing working copies would not be upgraded, although I suppose the
> > client would work.  Perhaps make it a format 99 step?
> 
> The software won't see any difference except it will provide a sanity
> check when we're developing and modifying Subversion code and testing
> against new WCs.  I don't think there is any need to upgrade existing
> development WCs in this respect.
> 
> I'll mention it in a comment in the format 99 step, but don't think we
> need to write any SQL for it.

Committed r1041321.

- Julian


Re: Can I add "NOT NULL" to PRISTINE table columns?

Posted by Julian Foad <ju...@wandisco.com>.
> Julian Foad <ju...@wandisco.com> writes:
> 
> > I imagine it should be possible to add 'NOT NULL' to these columns
> > without performing a format bump or writing any upgrade code.  Am I
> > right?

Hyrum Wright wrote:
> If we're already enforcing it in the C code, I see no problem with
> doing so in the sql schema.  Additionally, I don't really see how you
> could add the 'NOT NULL' clause in a format bump without doing table
> duplication, which doesn't seem worth the trouble for something like
> this.

Right.

Philip Martin wrote:
> Existing working copies would not be upgraded, although I suppose the
> client would work.  Perhaps make it a format 99 step?

The software won't see any difference except it will provide a sanity
check when we're developing and modifying Subversion code and testing
against new WCs.  I don't think there is any need to upgrade existing
development WCs in this respect.

I'll mention it in a comment in the format 99 step, but don't think we
need to write any SQL for it.

Thanks.

- Julian


Re: Can I add "NOT NULL" to PRISTINE table columns?

Posted by Philip Martin <ph...@wandisco.com>.
Julian Foad <ju...@wandisco.com> writes:

> I imagine it should be possible to add 'NOT NULL' to these columns
> without performing a format bump or writing any upgrade code.  Am I
> right?

Existing working copies would not be upgraded, although I suppose the
client would work.  Perhaps make it a format 99 step?

-- 
Philip