I'm writing a simple notification mechanism for my D7 website that allows users to subscribe to a thread and receive notifications when the thread is updated. When I tried to add a node subscription, the autocomplete field generated an Ajax error. It appears to me the autocomplete still uses the D6 function db_rewrite_sql(). Also another error "Call to undefined function notifications_node_title2nid()" appeared when I saved the subscription. I was trying to solve the problem myself but got lost in the code. Really appreciate if someone could write a patch for it.