Skip Menu |
 

This queue is for tickets about the CGI-Uploader CPAN distribution.

Report information
The Basics
Id: 40910
Status: open
Priority: 0/
Queue: CGI-Uploader

People
Owner: MARKSTOS [...] cpan.org
Requestors: RSAVAGE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 2.15
Fixed in: (no value)



Subject: Columns width and height forced to accept nulls
MIME-Version: 1.0
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Content-Type: text/plain
Charset: utf8
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 409
Download (untitled) / with headers
text/plain 409b
The hash returned by sub extract_meta() uses width => $width, height => $height, when it should use width => $width || 0, height => $height || 0, Since the first version returns 2 undefs for non-image files, this means the declaration of those columns must accept nulls. I want to be able to declare them as: o height integer not null o width integer not null
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Charset: utf8
Content-Type: text/plain
Message-ID: <rt-3.6.HEAD-2224-1238685976-276.40910-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 659
Download (untitled) / with headers
text/plain 659b
On Thu Nov 13 18:52:59 2008, RSAVAGE wrote: Show quoted text
> The hash returned by sub extract_meta() uses > width => $width, > height => $height, > when it should use > width => $width || 0, > height => $height || 0, > > Since the first version returns 2 undefs for non-image files, > this means the declaration of those columns must accept nulls. > > I want to be able to declare them as: > o height integer not null > o width integer not null
I'm not sure understand. It sounds like you want to upload non-images, but have their width and height declared as "0". Isn't is just as accurate to have them declared as null?
MIME-Version: 1.0
X-Spam-Status: No, hits=0.0 required=8.0 tests=
In-Reply-To: <rt-3.6.HEAD-2224-1238685976-276.40910-6-0 [...] rt.cpan.org>
References: <RT-Ticket-40910 [...] rt.cpan.org> <rt-3.6.HEAD-2224-1238685976-276.40910-6-0 [...] rt.cpan.org>
Importance: Normal
Message-ID: <37957.58.6.176.238.1238615755.squirrel [...] mail.savage.net.au>
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id 318B463C6F0 for <bug-CGI-Uploader [...] rt.cpan.org>; Thu, 2 Apr 2009 17:10:15 -0400 (EDT)
Received: (qmail 798 invoked by uid 103); 2 Apr 2009 21:10:15 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 2 Apr 2009 21:10:15 -0000
Received: from mail1.qnetau.com (HELO mail1.qnetau.com) (202.146.209.5) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Thu, 02 Apr 2009 14:10:12 -0700
Received: (qmail 1830 invoked by uid 100); 1 Apr 2009 19:55:55 -0000
Received: from 58.6.176.238 (SquirrelMail authenticated user ron [...] savage.net.au) by mail.savage.net.au with HTTP; Thu, 2 Apr 2009 05:55:55 +1000 (EST)
Delivered-To: cpan-bug+CGI-Uploader [...] diesel.bestpractical.com
User-Agent: SquirrelMail/1.4.6-rc1
Subject: Re: [rt.cpan.org #40910] Columns width and height forced to accept nulls
Return-Path: <ron [...] savage.net.au>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-CGI-Uploader [...] rt.cpan.org
X-Priority: 3 (Normal)
Date: Thu, 2 Apr 2009 05:55:55 +1000 (EST)
X-Spam-Level: *
To: bug-CGI-Uploader [...] rt.cpan.org
Content-Transfer-Encoding: 8bit
From: "Ron Savage" <ron [...] savage.net.au>
RT-Message-ID: <rt-3.6.HEAD-2224-1238706627-458.40910-0-0 [...] rt.cpan.org>
Content-Length: 912
Download (untitled) / with headers
text/plain 912b
Hi Mark MARKSTOS via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=40910 > > > On Thu Nov 13 18:52:59 2008, RSAVAGE wrote:
>> The hash returned by sub extract_meta() uses >> width => $width, >> height => $height, >> when it should use >> width => $width || 0, >> height => $height || 0, >> >> Since the first version returns 2 undefs for non-image files, >> this means the declaration of those columns must accept nulls. >> >> I want to be able to declare them as: >> o height integer not null >> o width integer not null
> > I'm not sure understand. It sounds like you want to upload non-images, > but have their width and height declared as "0". Isn't is just as > accurate to have them declared as null?
It's not that I want to upload non-images. I just want the code to handle that case. -- Ron Savage ron@savage.net.au http://savage.net.au/
MIME-Version: 1.0
X-Spam-Status: No, hits=-0.0 required=8.0 tests=SPF_PASS
In-Reply-To: <rt-3.6.HEAD-2224-1238706627-458.40910-5-0 [...] rt.cpan.org>
X-Mailer: Claws Mail 3.7.1 (GTK+ 2.12.9; i486-pc-linux-gnu)
References: <RT-Ticket-40910 [...] rt.cpan.org> <rt-3.6.HEAD-2224-1238685976-276.40910-6-0 [...] rt.cpan.org> <37957.58.6.176.238.1238615755.squirrel [...] mail.savage.net.au> <rt-3.6.HEAD-2224-1238706627-458.40910-5-0 [...] rt.cpan.org>
Message-ID: <20090403094940.38000781 [...] summersault.com>
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id 6CDC14D8171 for <bug-CGI-Uploader [...] rt.cpan.org>; Fri, 3 Apr 2009 09:49:49 -0400 (EDT)
Received: (qmail 31095 invoked by uid 103); 3 Apr 2009 13:49:48 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 3 Apr 2009 13:49:48 -0000
Received: from tanagra.summersault.com (HELO tanagra.summersault.com) (12.161.105.149) by 16.mx.develooper.com (qpsmtpd/0.80) with SMTP; Fri, 03 Apr 2009 06:49:45 -0700
Received: (qmail 68569 invoked from network); 3 Apr 2009 09:49:41 -0400
Received: from simba.summersault.com (HELO localhost) (192.168.97.182) by tanagra.summersault.com with SMTP; 3 Apr 2009 09:49:41 -0400
Delivered-To: cpan-bug+CGI-Uploader [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #40910] Columns width and height forced to accept nulls
Return-Path: <mark [...] summersault.com>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-CGI-Uploader [...] rt.cpan.org
Date: Fri, 3 Apr 2009 09:49:40 -0400
X-Spam-Level: *
To: bug-CGI-Uploader [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Mark Stosberg <mark [...] summersault.com>
RT-Message-ID: <rt-3.6.HEAD-2224-1238766596-476.40910-0-0 [...] rt.cpan.org>
Content-Length: 352
Download (untitled) / with headers
text/plain 352b
Show quoted text
> It's not that I want to upload non-images. I just want the code to handle > that case.
If you are only uploading images, doesn't it work to just set the data model to be "not null"? The only reason I could see for that to fail would be if the sizes could not be detected, in which case a NULL seems like a reasonable way to express that. Mark
MIME-Version: 1.0
X-Spam-Status: No, hits=0.0 required=8.0 tests=
In-Reply-To: <rt-3.6.HEAD-2224-1238766596-476.40910-6-0 [...] rt.cpan.org>
X-Mailer: Evolution 2.22.3.1
References: <RT-Ticket-40910 [...] rt.cpan.org> <rt-3.6.HEAD-2224-1238685976-276.40910-6-0 [...] rt.cpan.org> <37957.58.6.176.238.1238615755.squirrel [...] mail.savage.net.au> <rt-3.6.HEAD-2224-1238706627-458.40910-5-0 [...] rt.cpan.org> <20090403094940.38000781 [...] summersault.com> <rt-3.6.HEAD-2224-1238766596-476.40910-6-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <1238824500.4557.25.camel [...] zoe.savage.net.au>
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id AF5BC4D819E for <bug-CGI-Uploader [...] rt.cpan.org>; Sat, 4 Apr 2009 01:54:35 -0400 (EDT)
Received: (qmail 8021 invoked by uid 103); 4 Apr 2009 05:54:35 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 4 Apr 2009 05:54:35 -0000
Received: from hosted04.westnet.com.au (HELO hosted04.westnet.com.au) (203.10.1.217) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Fri, 03 Apr 2009 22:54:32 -0700
Received: from hosted04.westnet.com.au (hosted04.westnet.com.au [127.0.0.1]) by hosted04.westnet.com.au (Postfix) with SMTP id 646F53DB64A for <bug-CGI-Uploader [...] rt.cpan.org>; Sat, 4 Apr 2009 13:54:24 +0800 (WST)
Received: from [192.168.100.3] (dsl-58-6-176-238.nsw.westnet.com.au [58.6.176.238]) by hosted04.westnet.com.au (Postfix) with ESMTP id 190983DB13C for <bug-CGI-Uploader [...] rt.cpan.org>; Sat, 4 Apr 2009 13:54:23 +0800 (WST)
Delivered-To: cpan-bug+CGI-Uploader [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #40910] Columns width and height forced to accept nulls
X-PMX-Branch: TNG-Outgoing
Return-Path: <ron [...] savage.net.au>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-CGI-Uploader [...] rt.cpan.org
Date: Sat, 04 Apr 2009 16:55:00 +1100
X-Spam-Level: *
To: bug-CGI-Uploader [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Ron Savage <ron [...] savage.net.au>
RT-Message-ID: <rt-3.6.HEAD-2224-1238824489-100.40910-0-0 [...] rt.cpan.org>
Content-Length: 830
Download (untitled) / with headers
text/plain 830b
Hi Mark On Fri, 2009-04-03 at 09:49 -0400, mark@summersault.com via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=40910 > > >
> > It's not that I want to upload non-images. I just want the code to handle > > that case.
> > If you are only uploading images, doesn't it work to just set the data model to > be "not null"? The only reason I could see for that to fail would be if the sizes > could not be detected, in which case a NULL seems like a reasonable way to express that.
If I recall the idea was to protect against the situation where the cols for size were declared not null but the user uploaded a non-image file. In the latter case, the size would be indeterminate and I did not want the code returning undef. So '|| 0' returns 0. -- Ron Savage ron@savage.net.au http://savage.net.au/index.html
MIME-Version: 1.0
X-Spam-Status: No, hits=-0.0 required=8.0 tests=SPF_PASS
In-Reply-To: <rt-3.6.HEAD-2224-1238824489-100.40910-5-0 [...] rt.cpan.org>
X-Mailer: Claws Mail 3.7.1 (GTK+ 2.12.9; i486-pc-linux-gnu)
References: <RT-Ticket-40910 [...] rt.cpan.org> <rt-3.6.HEAD-2224-1238685976-276.40910-6-0 [...] rt.cpan.org> <37957.58.6.176.238.1238615755.squirrel [...] mail.savage.net.au> <rt-3.6.HEAD-2224-1238706627-458.40910-5-0 [...] rt.cpan.org> <20090403094940.38000781 [...] summersault.com> <rt-3.6.HEAD-2224-1238766596-476.40910-6-0 [...] rt.cpan.org> <1238824500.4557.25.camel [...] zoe.savage.net.au> <rt-3.6.HEAD-2224-1238824489-100.40910-5-0 [...] rt.cpan.org>
Message-ID: <20090406093759.1f7b9f42 [...] summersault.com>
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id BDA074D8040 for <bug-CGI-Uploader [...] rt.cpan.org>; Mon, 6 Apr 2009 09:38:37 -0400 (EDT)
Received: (qmail 1167 invoked by uid 103); 6 Apr 2009 13:38:36 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 6 Apr 2009 13:38:36 -0000
Received: from tanagra.summersault.com (HELO tanagra.summersault.com) (12.161.105.149) by 16.mx.develooper.com (qpsmtpd/0.80) with SMTP; Mon, 06 Apr 2009 06:38:30 -0700
Received: (qmail 16629 invoked from network); 6 Apr 2009 09:37:59 -0400
Received: from simba.summersault.com (HELO localhost) (192.168.97.182) by tanagra.summersault.com with SMTP; 6 Apr 2009 09:37:59 -0400
Delivered-To: cpan-bug+CGI-Uploader [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #40910] Columns width and height forced to accept nulls
Return-Path: <mark [...] summersault.com>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-CGI-Uploader [...] rt.cpan.org
Date: Mon, 6 Apr 2009 09:37:59 -0400
X-Spam-Level: *
To: bug-CGI-Uploader [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Mark Stosberg <mark [...] summersault.com>
RT-Message-ID: <rt-3.6.HEAD-2538-1239025124-1573.40910-0-0 [...] rt.cpan.org>
Content-Length: 963
Download (untitled) / with headers
text/plain 963b
Show quoted text
> > If you are only uploading images, doesn't it work to just set the data model to > > be "not null"? The only reason I could see for that to fail would be if the sizes > > could not be detected, in which case a NULL seems like a reasonable way to express that.
> > If I recall the idea was to protect against the situation where the cols > for size were declared not null but the user uploaded a non-image file. > > In the latter case, the size would be indeterminate and I did not want > the code returning undef. So '|| 0' returns 0.
But at that point you are declaring the columns to be "not null", but then creating a workaround to put null values in it, represented as zero. I think it's cleaner just to advise removing the constraint in that case. If people want to declare "not null" and they actually commit to not trying to put NULL values in it, then no changes are needed to the code, and "NOT NULL" can be declared in the database. Mark
MIME-Version: 1.0
X-Spam-Status: No, hits=0.0 required=8.0 tests=
In-Reply-To: <rt-3.6.HEAD-2538-1239025124-1573.40910-6-0 [...] rt.cpan.org>
X-Mailer: Evolution 2.22.3.1
References: <RT-Ticket-40910 [...] rt.cpan.org> <rt-3.6.HEAD-2224-1238685976-276.40910-6-0 [...] rt.cpan.org> <37957.58.6.176.238.1238615755.squirrel [...] mail.savage.net.au> <rt-3.6.HEAD-2224-1238706627-458.40910-5-0 [...] rt.cpan.org> <20090403094940.38000781 [...] summersault.com> <rt-3.6.HEAD-2224-1238766596-476.40910-6-0 [...] rt.cpan.org> <1238824500.4557.25.camel [...] zoe.savage.net.au> <rt-3.6.HEAD-2224-1238824489-100.40910-5-0 [...] rt.cpan.org> <20090406093759.1f7b9f42 [...] summersault.com> <rt-3.6.HEAD-2538-1239025124-1573.40910-6-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <1239054356.4557.81.camel [...] zoe.savage.net.au>
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id 14A584D80FC for <bug-CGI-Uploader [...] rt.cpan.org>; Mon, 6 Apr 2009 17:45:23 -0400 (EDT)
Received: (qmail 6157 invoked by uid 103); 6 Apr 2009 21:45:23 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 6 Apr 2009 21:45:23 -0000
Received: from hosted06.westnet.com.au (HELO hosted06.westnet.com.au) (203.10.1.221) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Mon, 06 Apr 2009 14:45:20 -0700
Received: from hosted06.westnet.com.au (hosted06.westnet.com.au [127.0.0.1]) by hosted06.westnet.com.au (Postfix) with SMTP id 24EAB224176 for <bug-CGI-Uploader [...] rt.cpan.org>; Tue, 7 Apr 2009 05:45:12 +0800 (WST)
Received: from [192.168.100.3] (dsl-58-6-180-109.nsw.westnet.com.au [58.6.180.109]) by hosted06.westnet.com.au (Postfix) with ESMTP id BCC20224153 for <bug-CGI-Uploader [...] rt.cpan.org>; Tue, 7 Apr 2009 05:45:10 +0800 (WST)
Delivered-To: cpan-bug+CGI-Uploader [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #40910] Columns width and height forced to accept nulls
X-PMX-Branch: TNG-Outgoing
Return-Path: <ron [...] savage.net.au>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-CGI-Uploader [...] rt.cpan.org
Date: Tue, 07 Apr 2009 07:45:56 +1000
X-Spam-Level: *
To: bug-CGI-Uploader [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Ron Savage <ron [...] savage.net.au>
RT-Message-ID: <rt-3.6.HEAD-2538-1239054331-1653.40910-0-0 [...] rt.cpan.org>
Content-Length: 1231
Download (untitled) / with headers
text/plain 1.2k
Hi Mark On Mon, 2009-04-06 at 09:38 -0400, mark@summersault.com via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=40910 > >
> > > If you are only uploading images, doesn't it work to just set the data model to > > > be "not null"? The only reason I could see for that to fail would be if the sizes > > > could not be detected, in which case a NULL seems like a reasonable way to express that.
> > > > If I recall the idea was to protect against the situation where the cols > > for size were declared not null but the user uploaded a non-image file. > > > > In the latter case, the size would be indeterminate and I did not want > > the code returning undef. So '|| 0' returns 0.
> > But at that point you are declaring the columns to be "not null", but > then creating a workaround to put null values in it, represented as > zero. > > I think it's cleaner just to advise removing the constraint in that > case. > > If people want to declare "not null" and they actually commit to not > trying to put NULL values in it, then no changes are needed to the code, > and "NOT NULL" can be declared in the database.
OK. Leave the code as it is. -- Ron Savage ron@savage.net.au http://savage.net.au/index.html
MIME-Version: 1.0
X-Spam-Status: No, hits=-1.0 required=8.0 tests=RCVD_IN_DNSWL_LOW
In-Reply-To: <rt-3.6.HEAD-2538-1239054331-1653.40910-6-0 [...] rt.cpan.org>
X-Mailer: Evolution 2.22.3.1
References: <RT-Ticket-40910 [...] rt.cpan.org> <rt-3.6.HEAD-2224-1238685976-276.40910-6-0 [...] rt.cpan.org> <37957.58.6.176.238.1238615755.squirrel [...] mail.savage.net.au> <rt-3.6.HEAD-2224-1238706627-458.40910-5-0 [...] rt.cpan.org> <rt-3.6.HEAD-2224-1238766596-476.40910-6-0 [...] rt.cpan.org> <1238824500.4557.25.camel [...] zoe.savage.net.au> <rt-3.6.HEAD-2224-1238824489-100.40910-5-0 [...] rt.cpan.org> <20090406093759.1f7b9f42 [...] summersault.com> <rt-3.6.HEAD-2538-1239025124-1573.40910-6-0 [...] rt.cpan.org> <1239054356.4557.81.camel [...] zoe.savage.net.au> <rt-3.6.HEAD-2538-1239054331-1653.40910-6-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <1239098033.4557.86.camel [...] zoe.savage.net.au>
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id ABE8A4DCF88 for <bug-CGI-Uploader [...] rt.cpan.org>; Tue, 7 Apr 2009 05:53:17 -0400 (EDT)
Received: (qmail 12657 invoked by uid 103); 7 Apr 2009 09:53:13 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 7 Apr 2009 09:53:13 -0000
Received: from hosted01.westnet.com.au (HELO hosted01.westnet.com.au) (203.10.1.211) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Tue, 07 Apr 2009 02:53:10 -0700
Received: from hosted01.westnet.com.au (hosted01.westnet.com.au [127.0.0.1]) by hosted01.westnet.com.au (Postfix) with SMTP id 53F462BEC36 for <bug-CGI-Uploader [...] rt.cpan.org>; Tue, 7 Apr 2009 17:53:06 +0800 (WST)
Received: from [192.168.100.3] (dsl-58-6-180-109.nsw.westnet.com.au [58.6.180.109]) by hosted01.westnet.com.au (Postfix) with ESMTP id 02DD32BF383 for <bug-CGI-Uploader [...] rt.cpan.org>; Tue, 7 Apr 2009 17:53:05 +0800 (WST)
Delivered-To: cpan-bug+CGI-Uploader [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #40910] Columns width and height forced to accept nulls
X-PMX-Branch: TNG-Outgoing
Return-Path: <ron [...] savage.net.au>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-CGI-Uploader [...] rt.cpan.org
Date: Tue, 07 Apr 2009 19:53:53 +1000
X-Spam-Level: *
To: bug-CGI-Uploader [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Ron Savage <ron [...] savage.net.au>
RT-Message-ID: <rt-3.6.HEAD-2538-1239098008-1680.40910-0-0 [...] rt.cpan.org>
Content-Length: 1320
Download (untitled) / with headers
text/plain 1.2k
Hi Mark Just for the record... On Mon, 2009-04-06 at 17:45 -0400, ron@savage.net.au via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=40910 > > > Hi Mark > > On Mon, 2009-04-06 at 09:38 -0400, mark@summersault.com via RT wrote:
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=40910 > > >
> > > > If you are only uploading images, doesn't it work to just set the data model to > > > > be "not null"? The only reason I could see for that to fail would be if the sizes > > > > could not be detected, in which case a NULL seems like a reasonable way to express that.
> > > > > > If I recall the idea was to protect against the situation where the cols > > > for size were declared not null but the user uploaded a non-image file. > > > > > > In the latter case, the size would be indeterminate and I did not want > > > the code returning undef. So '|| 0' returns 0.
> > > > But at that point you are declaring the columns to be "not null", but > > then creating a workaround to put null values in it, represented as > > zero.
Of course I was. This advice comes from Joe Celko's SQL For Smarties, p 120, where he advocates using not null on /all/ columns wherever possible. That's why you're wrong on this one. But I give up. -- Ron Savage ron@savage.net.au http://savage.net.au/index.html
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-2538-1239098008-1680.40910-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Charset: utf8
References: <RT-Ticket-40910 [...] rt.cpan.org> <rt-3.6.HEAD-2224-1238685976-276.40910-6-0 [...] rt.cpan.org> <37957.58.6.176.238.1238615755.squirrel [...] mail.savage.net.au> <rt-3.6.HEAD-2224-1238706627-458.40910-5-0 [...] rt.cpan.org> <rt-3.6.HEAD-2224-1238766596-476.40910-6-0 [...] rt.cpan.org> <1238824500.4557.25.camel [...] zoe.savage.net.au> <rt-3.6.HEAD-2224-1238824489-100.40910-5-0 [...] rt.cpan.org> <20090406093759.1f7b9f42 [...] summersault.com> <rt-3.6.HEAD-2538-1239025124-1573.40910-6-0 [...] rt.cpan.org> <1239054356.4557.81.camel [...] zoe.savage.net.au> <rt-3.6.HEAD-2538-1239054331-1653.40910-6-0 [...] rt.cpan.org> <1239098033.4557.86.camel [...] zoe.savage.net.au> <rt-3.6.HEAD-2538-1239098008-1680.40910-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Message-ID: <rt-3.6.HEAD-2538-1239756011-1245.40910-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 702
Download (untitled) / with headers
text/plain 702b
Show quoted text
> This advice comes from Joe Celko's SQL For Smarties, p 120, where he > advocates using not null on /all/ columns wherever possible.
I read this book as well, also now try to make maximum use of "not null". However, the debate here has become about the appropriateness of using other values to represent null so that a column can be declared "not null". This seems like a philosophical difference which may not be resolved. But, hey, couldn't you define a column like this: my_col INT NOT NULL DEFAULT 0 This represents clearly that if the column would be null you are substituting another value instead. Either way, based on our conversation so far, I'm marking this as 'resolved'. Mark
MIME-Version: 1.0
X-Spam-Status: No, hits=0.0 required=8.0 tests=
In-Reply-To: <rt-3.6.HEAD-2538-1239756011-1245.40910-6-0 [...] rt.cpan.org>
X-Mailer: Evolution 2.24.5
References: <RT-Ticket-40910 [...] rt.cpan.org> <rt-3.6.HEAD-2224-1238685976-276.40910-6-0 [...] rt.cpan.org> <37957.58.6.176.238.1238615755.squirrel [...] mail.savage.net.au> <rt-3.6.HEAD-2224-1238706627-458.40910-5-0 [...] rt.cpan.org> <20090406093759.1f7b9f42 [...] summersault.com> <rt-3.6.HEAD-2538-1239025124-1573.40910-6-0 [...] rt.cpan.org> <1239054356.4557.81.camel [...] zoe.savage.net.au> <rt-3.6.HEAD-2538-1239054331-1653.40910-6-0 [...] rt.cpan.org> <1239098033.4557.86.camel [...] zoe.savage.net.au> <rt-3.6.HEAD-2538-1239098008-1680.40910-6-0 [...] rt.cpan.org> <rt-3.6.HEAD-2538-1239756011-1245.40910-6-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <1239781754.3183.53.camel [...] zoe.savage.net.au>
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id C7ED84D81A7 for <bug-CGI-Uploader [...] rt.cpan.org>; Wed, 15 Apr 2009 03:48:05 -0400 (EDT)
Received: (qmail 19132 invoked by uid 103); 15 Apr 2009 07:48:05 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 15 Apr 2009 07:48:05 -0000
Received: from hosted06.westnet.com.au (HELO hosted06.westnet.com.au) (203.10.1.221) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Wed, 15 Apr 2009 00:48:02 -0700
Received: from hosted06.westnet.com.au (hosted06.westnet.com.au [127.0.0.1]) by hosted06.westnet.com.au (Postfix) with SMTP id 865EF223EEA for <bug-CGI-Uploader [...] rt.cpan.org>; Wed, 15 Apr 2009 15:47:57 +0800 (WST)
Received: from [192.168.100.3] (unknown [124.149.146.76]) by hosted06.westnet.com.au (Postfix) with ESMTP id 20ABC2246B3 for <bug-CGI-Uploader [...] rt.cpan.org>; Wed, 15 Apr 2009 15:47:55 +0800 (WST)
Delivered-To: cpan-bug+CGI-Uploader [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #40910] Columns width and height forced to accept nulls
X-PMX-Branch: TNG-Outgoing
Return-Path: <ron [...] savage.net.au>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-CGI-Uploader [...] rt.cpan.org
Date: Wed, 15 Apr 2009 17:49:14 +1000
X-Spam-Level: *
To: bug-CGI-Uploader [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Ron Savage <ron [...] savage.net.au>
RT-Message-ID: <rt-3.6.HEAD-2538-1239781694-1350.40910-0-0 [...] rt.cpan.org>
Content-Length: 1009
Download (untitled) / with headers
text/plain 1009b
Hi Mark On Tue, 2009-04-14 at 20:40 -0400, MARKSTOS via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=40910 > > >
> > This advice comes from Joe Celko's SQL For Smarties, p 120, where he > > advocates using not null on /all/ columns wherever possible.
> > I read this book as well, also now try to make maximum use of "not > null". However, the debate here has become about the appropriateness of > using other values to represent null so that a column can be declared > "not null". This seems like a philosophical difference which may not be > resolved. > > But, hey, couldn't you define a column like this: > > my_col INT NOT NULL DEFAULT 0 > > This represents clearly that if the column would be null you are > substituting another value instead.
Yes. I was just worried you didn't get my point. But that solves it. Show quoted text
> Either way, based on our conversation so far, I'm marking this as > 'resolved'.
Understood. -- Ron Savage ron@savage.net.au http://savage.net.au/index.html


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.