G'day all,

Newbie alert in both sqlite and SQL in general and I'm trying to do something reasonably complex. Please bear with me.

I'm in the process of integrating regex support into sqlite.

Can someone give me a quick rundown on how to run the regression test suite so I can check that the changes I'm making to the parser are not damaging the way it currently is supposed to work?

I need to change the way it parses the ~ operator so I can try and get regex working similar to how it works in postgres.
I have it working at the moment but only by adding another keyword "RLIKE" which is most untidy, I'd like to clean it up a bit better. (It also segfaults if you feed it a bogus regex! I'm currently using the internal libc regex functions and they appear to have a bug or three)


Additionally, there is quite a performance hit currently because each time the match function is entered it generates the compiled match array. I want to cache this data, but I can only do this if the data is not likley to change.

something like
select Note from datebook where start ~ "107" and Note ~ "DMCC";

I figure I can add an extra pointer somewhere to an array of cached compiled regex entries and just select the required one, athough I'm not quite sure of an efficient way of selecting the correct one at the moment. My ideal would be to pass the currently executing token address to the function routine, but I can't yet see a way to do that. The Parse array that gets passed as context does not appear to contain the information I require.

This of course will not work where the right side of the ~ operator is likley to change ( I guess it could be the output of another querey? I'm not really that familiar with advanced SQL use myself )

Has anyone looked at this previously? I can't locate anything on regex in the archives and google indicates that it's been a requested feature for a while but no info on anyone implementing it.

I'm after some ideas that might make it both efficient and useful to others I guess. I'd ideally like it to be eventually integrated into the mainline so I need to make it as clean an implementation as possible. I'll probably also make it a ./configure time option so it can be compiled out.

Regards,
Brad

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to