[GRASS5] Re: [bug #4056] (grass) db.test fails on sqlite driver

Glynn Clements glynn at gclements.plus.com
Sat Feb 18 14:23:20 EST 2006


Markus Neteler wrote:

> > > > select c1 from grass_test1 where d1 < 500 / 2 and i1 <> 2  and c1 ~ 'bc'
> > > > DBMI-SQLite driver error:
> > > > Error in sqlite3_prepare():select c1 from grass_test1 where d1 < 500 / 2 and
> > > > i1 <> 2  and c1 ~ 'bc'
> > > > near "~": syntax error
> > > > EXECUTE: ******** ERROR ********
> > > > 
> > > > '~' is not SQL standard, this is not a bug.
> > > > ---
> > > > 
> > > 
> > > I consider it as bug as SQLite supports '~':
> > > 
> > > http://www.sqlite.org/lang_expr.html
> > > 
> > > "Supported unary operators are these:
> > > 
> > >  -    +    !    ~
> > 
> > Note the use of the word "unary". In the above select statement, the ~
> > is being used as a /binary/ operator, which SQLite doesn't support:
> > 
> >   SQLite understands the following binary operators, in order from
> >   highest to lowest precedence:
> >   
> >       ||
> >       *    /    %
> >       +    -
> >       <<   >>   &    |
> >       <    <=   >    >=
> >       =    ==   !=   <>   IN
> >       AND   
> >       OR
> > 
> 
> Ah, I see - but what does it mean for db.test?
> Add a sqlite test to skip it?

As it's an extension (rather than standard SQL), the test should be
disabled by default and only run (if at all) for specific back-ends
which are known to support it.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list