/*
This file is part of GNUnet
(C) 2009, 2010, 2011 Christian Grothoff (and other contributing authors)
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 3, or (at your
option) any later version.
GNUnet is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNUnet; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
/**
* @file datastore/plugin_datastore_mysql.c
* @brief mysql-based datastore backend
* @author Igor Wronsky
* @author Christian Grothoff
*
* NOTE: This db module does NOT work with mysql prior to 4.1 since
* it uses prepared statements. MySQL 5.0.46 promises to fix a bug
* in MyISAM that is causing us grief. At the time of this writing,
* that version is yet to be released. In anticipation, the code
* will use MyISAM with 5.0.46 (and higher). If you run such a
* version, please run "make check" to verify that the MySQL bug
* was actually fixed in your version (and if not, change the
* code below to use MyISAM for gn071).
*
* HIGHLIGHTS
*
* Pros
* + On up-to-date hardware where mysql can be used comfortably, this
* module will have better performance than the other db choices
* (according to our tests).
* + Its often possible to recover the mysql database from internal
* inconsistencies. The other db choices do not support repair!
* Cons
* - Memory usage (Comment: "I have 1G and it never caused me trouble")
* - Manual setup
*
* MANUAL SETUP INSTRUCTIONS
*
* 1) in /etc/gnunet.conf, set
* @verbatim
[datastore]
DATABASE = "mysql"
@endverbatim
* 2) Then access mysql as root,
* @verbatim
$ mysql -u root -p
@endverbatim
* and do the following. [You should replace $USER with the username
* that will be running the