petropavel13 / pg_rrule

RRULE data type for PostgreSQL
MIT License
164 stars 29 forks source link

rrule functions in where clause #10

Open Falmarri opened 8 years ago

Falmarri commented 8 years ago

Are the various rrule functions not supported in where clauses?

running select id, rrule from test where get_freq(rrule) = 'WEEKLY';

testdb-# \d test
 id     | bigint | not null default nextval('test_id_seq'::regclass)
 rrule  | rrule  | 

segfaults with this:

May 09 16:31:43 opal systemd-coredump[18790]: Process 18491 (postgres) of user 88 dumped core.

    Stack trace of thread 18491:
    #0  0x00007f3b0f3b4646 strlen (libc.so.6)
    #1  0x00007f3b04990b66 icalmemory_append_string (libical.so.2)
    #2  0x00007f3b04999854 icalrecurrencetype_as_string_r (libical.so.2)
    #3  0x00007f3b04999c16 icalrecurrencetype_as_string (libical.so.2)
    #4  0x00007f3b04bd127f pg_rrule_out (pg_rrule.so)
    #5  0x000000000079be48 FunctionCall1Coll (postgres)
    #6  0x000000000079d2ee OutputFunctionCall (postgres)
    #7  0x0000000000471661 n/a (postgres)
    #8  0x00000000005ac369 standard_ExecutorRun (postgres)
    #9  0x00000000006aac50 n/a (postgres)
    #10 0x00000000006ac04e PortalRun (postgres)
    #11 0x00000000006a8f93 PostgresMain (postgres)
    #12 0x0000000000467c64 n/a (postgres)
    #13 0x00000000006529ef PostmasterMain (postgres)
    #14 0x0000000000468e04 main (postgres)
    #15 0x00007f3b0f356710 __libc_start_main (libc.so.6)
    #16 0x0000000000468e79 _start (postgres)
Falmarri commented 8 years ago

Actually, it seems like something's wrong with just converting the ical to string. select * from test throws the same segfault

petropavel13 commented 8 years ago

I see you found the issue: https://github.com/Falmarri/pg_rrule/commit/2b5ea0986c4a6c18cfacce5a78191e3503ea801a Let's create pull request and specify minimum required version of libical in readme