Some annoying bugs with date and number operations

Sherzod Mutalov shmutalov at
Thu Oct 1 12:48:52 CEST 2015

Hello Developers,
    Firstly, I must say thank you for releasing MonetDb Jul2015.
    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

            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;

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

More information about the developers-list mailing list