In normal programming logic.. this is really a software bug.

In Java, if you declare an array and try to read outside the array like

String[] myArray = new String[10];

System.out.println(myArray[10]);//Java Arrays are indexed from Zero NOT 1

You will get  "java.lang.ArrayIndexOutOfBoundsException"

I am surprised this would be considered as an "undocumented feature". I think there
might be an issue with "coldfusion.sql.QueryTable" which converts a regular Java Resultset
to some form of Collection Object, this should really throw an Exception.

Joe Eugene

  ----- Original Message -----
  From: Michael Dinowitz
  To: CF-Talk
  Sent: Monday, October 27, 2003 1:07 PM
  Subject: Re: Query-past protection?

  Personally, I think they should both produce errors as that would be the
  expected result. But as long as it's documented and well known, people will
  not trip over it (much). I've placed it on the front of HoF as an issue to
  watch out for. I'll also set this thread as an important read (a new list
  feature) so people will give it more attention.

  > I guess I sorta see it as fixing an inconsistency.
  > If you run a query like this in CF 5:
  > <cfquery name="getname" datasource="#database#">
  > Select name
  > from table
  > where 0=1
  > </cfquery>
  >
  > (This query will not return a record set)
  >
  > And then try outputting the value of name:
  > <cfoutput>#getname.name#</cfoutput>
  >
  > You do not get an error.
  >
  > But if you tried to output :
  >
  > <cfoutput>#getname.name[1]#</cfoutput>
  >
  > You would get an error in CF 5.
  >
  > Now in CFMX they both work the same.
  >
  > But, yes this should be documented.
  >
  > Mark W. Breneman


[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to