Re: Cannot add reference.

"Markus Hoenicka" <[email protected]> Mon, 4 May 2009 23:07:50 +0200
Newsgroups gmane.text.refdb.general
Message-ID <[email protected]>
Wei-Wei Guo writes:
 > Do you mean patches for refdb-0.9.9-1.tar.gz? I can do that.
 > 

I've appended a simple patch for one of the source files to provide
additional debug output. Please apply the patch to the sources with a
command like:

patch < refdbdref.c.patch

from within the src subdirectory of the source tree. Then please
rebuild this directory and install it, or (whichever is easier for
you), run the server as a regular app from the src directory, like
this:

./refdbd -s [other options]

(kill it with Ctrl-c when done)

Then repeat your "add references" test from another xterm, and send
the refdbd log. Just ask if anything is unclear, I'll be happy to
help.

I've just tested this on a FreeBSD box using the current svn revision
and the sqlite3 driver. Things work ok for me.

regards,
Markus


-- 
Markus Hoenicka
[email protected]
(Spam-protected email: replace the quadrupeds with "mhoenicka")
http://www.mhoenicka.de

------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf

_______________________________________________
Refdb-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/refdb-users
refdbdref.c.patch (application/octet-stream, 1.6 KB)
Index: refdbdref.c
===================================================================
--- refdbdref.c	(revision 673)
+++ refdbdref.c	(working copy)
@@ -2113,15 +2113,20 @@
   dbires = dbi_conn_query(conn, sql_command);
   if (!dbires) {
     free(quoted_listname);
+    LOG_PRINT(LOG_DEBUG, "dbires went to NULL");
     return 234;
   }
 
   if (dbi_result_next_row(dbires)) {
     /* note already exists, check user id */
     n_list_owner_id = my_dbi_result_get_idval(dbires, "note_user_id");
-    
+    sprintf(sql_command, "n_list_owner_id went to %lld", n_list_owner_id);
+    LOG_PRINT(LOG_DEBUG, sql_command);
+
     if (n_list_owner_id != n_user_id) { /* we're not owner of this list */
       free(quoted_listname);
+      LOG_PRINT(LOG_DEBUG, "not owner of this list");
+
       sprintf(sql_command, "266:%s:%s\n", (*listname)?listname:full_listname, username);
       if ((new_msg = mstrcat(ptr_addresult->msg, sql_command, &(ptr_addresult->msg_len), 0)) == NULL) {
 	LOG_PRINT(LOG_CRIT, get_status_msg(801));
@@ -2136,11 +2141,16 @@
 
     /* we own this list. retrieve ID */
     n_list_id = my_dbi_result_get_idval(dbires, "note_id");
+    sprintf(sql_command, "n_list_id went to %lld", n_list_id);
+    LOG_PRINT(LOG_DEBUG, sql_command);
   }
   else {
     /* note does not yet exist. Create a new one */
     n_list_id = create_personal_list(conn, (*listname)?(char*)listname:full_listname, n_user_id, username);
 
+    sprintf(sql_command, "new n_list_id went to %lld", n_list_id);
+    LOG_PRINT(LOG_DEBUG, sql_command);
+
     if (!n_list_id) {
       free(quoted_listname);
       sprintf(sql_command, "262:%s\n", (*listname)?listname:full_listname);