gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r5332 - GNUnet/src/applications/sqstore_mysql


From: gnunet
Subject: [GNUnet-SVN] r5332 - GNUnet/src/applications/sqstore_mysql
Date: Sat, 21 Jul 2007 23:38:56 -0600 (MDT)

Author: grothoff
Date: 2007-07-21 23:38:55 -0600 (Sat, 21 Jul 2007)
New Revision: 5332

Modified:
   GNUnet/src/applications/sqstore_mysql/mysql.c
   GNUnet/src/applications/sqstore_mysql/mysqltest3.c
Log:
versioncheck

Modified: GNUnet/src/applications/sqstore_mysql/mysql.c
===================================================================
--- GNUnet/src/applications/sqstore_mysql/mysql.c       2007-07-22 05:25:33 UTC 
(rev 5331)
+++ GNUnet/src/applications/sqstore_mysql/mysql.c       2007-07-22 05:38:55 UTC 
(rev 5332)
@@ -312,18 +312,36 @@
      earlier versions have issues with INDEX over BINARY data,
      which is why we need to use InnoDB for those
      (even though MyISAM would be faster) */
-  mysql_query (dbh->dbf,
-              "CREATE TABLE IF NOT EXISTS gn071 ("
-              " size INT(11) UNSIGNED NOT NULL DEFAULT 0,"
-              " type INT(11) UNSIGNED NOT NULL DEFAULT 0,"
-              " prio INT(11) UNSIGNED NOT NULL DEFAULT 0,"
-              " anonLevel INT(11) UNSIGNED NOT NULL DEFAULT 0,"
-              " expire BIGINT UNSIGNED NOT NULL DEFAULT 0,"
-              " hash BINARY(64) NOT NULL DEFAULT '',"
-              " vkey BIGINT UNSIGNED NOT NULL DEFAULT 0,"
-              " INDEX (hash(64))," /* MySQL 5.0.46 fixes bug in MyISAM */
-              " INDEX (prio),"
-              " INDEX (expire,anonLevel,type)" ") ENGINE=InnoDB");
+  if (50046 <= mysql_get_server_version(dbh->dbf)) {
+    /* MySQL 5.0.46 fixes bug in MyISAM */
+    mysql_query (dbh->dbf,
+                "CREATE TABLE IF NOT EXISTS gn071 ("
+                " size INT(11) UNSIGNED NOT NULL DEFAULT 0,"
+                " type INT(11) UNSIGNED NOT NULL DEFAULT 0,"
+                " prio INT(11) UNSIGNED NOT NULL DEFAULT 0,"
+                " anonLevel INT(11) UNSIGNED NOT NULL DEFAULT 0,"
+                " expire BIGINT UNSIGNED NOT NULL DEFAULT 0,"
+                " hash BINARY(64) NOT NULL DEFAULT '',"
+                " vkey BIGINT UNSIGNED NOT NULL DEFAULT 0,"
+                " INDEX (hash(64))," 
+                " INDEX (prio,vkey),"
+                " INDEX (expire,vkey,type),"
+                " INDEX (anonLevel,prio,vkey,type)" ") ENGINE=MyISAM");
+  } else {
+    mysql_query (dbh->dbf,
+                "CREATE TABLE IF NOT EXISTS gn071 ("
+                " size INT(11) UNSIGNED NOT NULL DEFAULT 0,"
+                " type INT(11) UNSIGNED NOT NULL DEFAULT 0,"
+                " prio INT(11) UNSIGNED NOT NULL DEFAULT 0,"
+                " anonLevel INT(11) UNSIGNED NOT NULL DEFAULT 0,"
+                " expire BIGINT UNSIGNED NOT NULL DEFAULT 0,"
+                " hash BINARY(64) NOT NULL DEFAULT '',"
+                " vkey BIGINT UNSIGNED NOT NULL DEFAULT 0,"
+                " INDEX (hash(64))," 
+                " INDEX (prio,vkey),"
+                " INDEX (expire,vkey,type),"
+                " INDEX (anonLevel,prio,vkey,type)" ") ENGINE=InnoDB");
+  }
   if (mysql_error (dbh->dbf)[0])
     {
       LOG_MYSQL (GE_ERROR | GE_ADMIN | GE_BULK, "mysql_query", dbh);

Modified: GNUnet/src/applications/sqstore_mysql/mysqltest3.c
===================================================================
--- GNUnet/src/applications/sqstore_mysql/mysqltest3.c  2007-07-22 05:25:33 UTC 
(rev 5331)
+++ GNUnet/src/applications/sqstore_mysql/mysqltest3.c  2007-07-22 05:38:55 UTC 
(rev 5332)
@@ -40,7 +40,7 @@
  */
 #define MAX_SIZE 1024LL * 1024 * 128
 
-#define ITERATIONS 10
+#define ITERATIONS 1
 
 /**
  * Number of put operations equivalent to 1/10th of MAX_SIZE
@@ -146,15 +146,7 @@
       printf ("%3u non anonymou iteration took %20llums (%d)\n", i, end - 
start, ret);
       if (GNUNET_SHUTDOWN_TEST () == YES)
         break;
-#if 1
       start = get_time ();
-      ret = api->iterateNonAnonymous (0, &iterateDummy, api);
-      end = get_time ();
-      printf ("%3u non anon YES iteration took %20llums (%d)\n", i, end - 
start, ret);
-      if (GNUNET_SHUTDOWN_TEST () == YES)
-        break;
-#endif
-      start = get_time ();
       ret = api->iterateMigrationOrder (&iterateDummy, api);
       end = get_time ();
       printf ("%3u migration or iteration took %20llums (%d)\n", i, end - 
start, ret);
@@ -167,6 +159,7 @@
       if (GNUNET_SHUTDOWN_TEST () == YES)
         break;
     }
+  api->drop();
   return OK;
 }
 





reply via email to

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