Some annoying bugs with date and number operations

Stefan Manegold Stefan.Manegold at cwi.nl
Thu Oct 1 13:04:24 CEST 2015



----- On Oct 1, 2015, at 12:48 PM, Sherzod Mutalov shmutalov at gmail.com wrote:

> Hello Developers,
>    Firstly, I must say thank you for releasing MonetDb Jul2015.
>    Secondly,
>    Problem 1:
>            Following query crashes the mserver5:
> 
>            SELECT ~0; -- here can be any number or numeric column
> 
>            There  is NULL dereference problem in rel_select.c file at
>            line  3915  (rel_binop  function). dl->next->next is null,
>            but  rel_value_exp  receives  dl->next->next->data.sym  as
>            argument.

A crash / segfault is alwasy a bug.
Please file a bug report via bugs.monetdb.org .

>            How correctly use bitwise NOT operator with SQL?
> 
>     Problem 2:
>             Following queries produces incorrect results:
> 
>             SELECT ( (current_timestamp
>                         - str_to_timestamp('2015-09-30', '%Y-%m-%d'))/86400
>                    , BIGINT);
>  
>             SELECT CONVERT(
>                      CONVERT( (current_timestamp
>                                   - str_to_timestamp('2015-09-30', '%Y-%m-%d'))
>                          , BIGINT) /86400
>                      , BIGINT);
> 
>             SELECT (current_timestamp
>                        - str_to_timestamp('2015-09-30', '%Y-%m-%d'))/86400.0;

Could you explain what results you'd expect, and what results you get?

Preferably also via a bug report.

Thanks!
Stefan

> Server info:
> # MonetDB 5 server v11.21.5 "Jul2015"
> # Serving database 'demo', using 4 threads
> # Compiled for x86_64-pc-winnt/64bit with 64bit OIDs dynamically linked
> # Found 15.916 GiB available main-memory.
> --
> 
> Best regards,
> Sherzod                          mailto:shmutalov at gmail.com
> 
> _______________________________________________
> developers-list mailing list
> developers-list at monetdb.org
> https://www.monetdb.org/mailman/listinfo/developers-list

-- 
| Stefan.Manegold at CWI.nl | DB Architectures   (DA) |
| www.CWI.nl/~manegold/  | Science Park 123 (L321) |
| +31 (0)20 592-4212     | 1098 XG Amsterdam  (NL) |


More information about the developers-list mailing list