[tinysql] SQL parsing problem

Brian Jepson bjepson@jepstone.net
Wed, 4 Dec 2002 20:22:16 -0800 (PST)


Thanks; can you try a 'cvs diff -w'?  That should ignore whitespace, which
sometimes causes this problem.


On Thu, 5 Dec 2002, daniel carter wrote:

> On Mon, 02 Dec 2002 17:28, daniel carter wrote:
> > Hello.
> >
> > I've encountered a problem with the SQL parser.
> >
> > select pe_people from people where car_id =7 works
> > select p.pe_people from people as p where car_id=7 works
> > select p.pe_people from people as p where p.car_id=7 doesn't work :(
> >
> > Unfortuantly it is the last form that my application uses.
> >
> > I'm using the CVS as of today (latest stable release doesn't seem to work
> > at all)
> 
> 
> In the file ORG.as220.tinySQL.sqlparser.ColumnValue i changed the evaluate method to use column instead of colname.  The change appears to fix the problem with qualified column names in the where clause
> 
> cvs diff seems to think the entire file has changed... here the relevant snippet
> 
> <    */
> <   public Object evaluate(tsRow row) throws tinySQLException
> <   {
> <     if (row == null)
> <       throw new tinySQLException("there is no row to check");
> <
> <     int index = row.findColumn(colname);
> <     if (index == -1)
> <       throw new tinySQLException("column " + colname + " was not found");
> <     Object o = row.get(index);
> <     return o;
> <   }
> <
> ---
> >    */
> >   public Object evaluate(tsRow row) throws tinySQLException
> >   {
> >     if (row == null)
> >       throw new tinySQLException("there is no row to check");
> >
> >     int index = row.findColumn(column);
> >     if (index == -1)
> >       throw new tinySQLException("column " + column + " was not found");
> >     Object o = row.get(index);
> >     return o;
> >   }
> >
> 
> _______________________________________________
> tinysql mailing list
> tinysql@as220.org
> http://as220.org/mailman/listinfo/tinysql
> 


Brian Jepson
http://www.jepstone.net/
http://www.oreillynet.com/pub/au/125