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

Glynn Clements glynn at gclements.plus.com
Fri Feb 17 13:11:02 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

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




More information about the grass-dev mailing list