gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r14871 - gnunet/src/datastore


From: gnunet
Subject: [GNUnet-SVN] r14871 - gnunet/src/datastore
Date: Tue, 5 Apr 2011 16:16:44 +0200

Author: grothoff
Date: 2011-04-05 16:16:43 +0200 (Tue, 05 Apr 2011)
New Revision: 14871

Modified:
   gnunet/src/datastore/plugin_datastore_mysql.c
Log:
insanity

Modified: gnunet/src/datastore/plugin_datastore_mysql.c
===================================================================
--- gnunet/src/datastore/plugin_datastore_mysql.c       2011-04-05 14:07:10 UTC 
(rev 14870)
+++ gnunet/src/datastore/plugin_datastore_mysql.c       2011-04-05 14:16:43 UTC 
(rev 14871)
@@ -212,6 +212,8 @@
 
   unsigned long long last_vkey;
 
+  unsigned int last_prio;
+
   int end_it;
 };
 
@@ -320,7 +322,7 @@
 
 #define SELECT_IT_REPLICATION "SELECT type,prio,anonLevel,expire,hash,vkey 
FROM gn090 FORCE INDEX(expire) "\
   "WHERE expire > ?"\
-  " ORDER BY repl DESC,RAND() LIMIT 1) "
+  " ORDER BY repl DESC,RAND() LIMIT 1"
   struct GNUNET_MysqlStatementHandle *select_replication;
 
 };
@@ -1025,6 +1027,7 @@
                                nrc)))
     goto END_SET;
   nrc->last_vkey = vkey;
+  nrc->last_prio = priority;
   GNUNET_assert (nrc->plugin->next_task == GNUNET_SCHEDULER_NO_TASK);
   if ( (rbind[4].buffer_length != sizeof (GNUNET_HashCode)) ||
        (hashSize != sizeof (GNUNET_HashCode)) )
@@ -1591,9 +1594,16 @@
                                        MYSQL_TYPE_LONGLONG,
                                        &nrc->now.abs_value,
                                        GNUNET_YES,
-                                       MYSQL_TYPE_LONG,
-                                       &nrc->type,
-                                       GNUNET_YES, -1);
+                                       MYSQL_TYPE_LONGLONG,
+                                       &nrc->last_vkey,
+                                       GNUNET_YES,
+                                       MYSQL_TYPE_LONGLONG,
+                                       &nrc->last_prio,
+                                       GNUNET_YES,
+                                       MYSQL_TYPE_LONGLONG,
+                                       &nrc->last_vkey,
+                                       GNUNET_YES,
+                                       -1);
 }
 
 
@@ -1624,6 +1634,7 @@
   nrc->dviter_cls = iter_cls;
   nrc->prep = &iterator_zero_prepare;
   nrc->last_vkey = INT64_MAX; /* MySQL only supports 63 bits, hence signed */
+  nrc->last_prio = INT32_MAX; /* similar issue... */
   mysql_plugin_next_request (nrc, GNUNET_NO);
 }
 
@@ -1693,12 +1704,15 @@
                    struct NextRequestClosure *nrc)
 {
   struct Plugin *plugin = cls;
+  long long nt;
 
+  nt = (long long) nrc->now.abs_value;
   return prepared_statement_run_select
     (plugin,
      plugin->select_expiration, 
      6, nrc->rbind, 
      &return_ok, NULL,
+     MYSQL_TYPE_LONGLONG, &nt, GNUNET_YES, 
      -1);
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]