Menu

#26 CookieDAOImpl uses incorrect SQL

v1.0 (example)
closed-fixed
EJP
None
5
2021-07-14
2007-02-20
Anonymous
No

When using the net.javacoding.jspider.core.storage.jdbc.JdbcStorageProvider, the net.javacoding.jspider.core.storage.jdbc.CookieDAOImpl class uses incorrect SQL to find the cookie entry.

Here is the line of code that is incorrect:

61 rs = st.executeQuery("select count(*) as count from jspider_cookie where id='" + id + "' and name='" + cookie.getName() + "'");

The "where id=" should be "where site="

NOTE: id is replaced by site. In the jspider_cookie table, the 'site' column is the id of the site being indexed and the 'id' column is just a unique row identifier. With the current SQL, the existing cookie row is never found because the id column is randomly generated. So a new row is inserted every time a page is indexed. Then when the code tries to use the cookie string, it blows up after about 65 pages because the cooke string length becomes greater then 800+ characters.

Discussion

  • EJP

    EJP - 2021-07-14

    Fixed in upcoming 1.0 release.

     
  • EJP

    EJP - 2021-07-14
    • status: open --> closed
    • assigned_to: EJP
    • Group: --> v1.0 (example)
     
  • EJP

    EJP - 2021-07-14
    • status: closed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB