Dear, I'm trying to make a mystrstr function to use it as a sub-function of "like". mystrstr function is designed to use boyer-moore algorithm to improve string search performance. (Only for simple substing search, but not a complex search pattern)
But, the problem is occurred when this mystrstr function is called two more times on one query. In boyer-moore algorithm, search pattern string should be preprocessed before it is used. I used sqlite3_set_auxdata() and sqlite3_get_auxdata() function to save preprocessed search pattern to call preprocessing process only once. It works very well if I use only one mystrstr function on one query. example) select * from mytable where mystrstr(col1, 'test1') and mystrstr(col2, 'test2'); In this case, mystrstr function is called twice and there are two different search patterns. I can use two aux data slots and can find preprocessed patterns by string compare with original pattern string for each call of mystrstr(). But, I think it is not a good idea, because of string compare can make not necessary processing cost. Could I get some more information of currently called function? For example, If I can get PC(program count of VDBE) from context, this value can be used to distinguish current position of my function on a query. Thank you. Yongil Jang. _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

