Anope MySQL Support
-------------------

IMPLEMENTATION STEPS:

PHASE 1:Anope will be able to save all it's databases
        to MySQL. It will happen in conjuction with
        the current FFF databases. This first step is 
        nothing more than a MySQL dump of the databases 
        (i.e. read-only), since Anope will not (for now) 
        read from Mysql. (COMPLETED)

PHASE 2:The next step is load the databases from mysql, 
        being able to replace the FFF completely as an 
        archive method (since all changes to the mysql 
        db would be lost on the next Services save). All,
        while keeping FFF intact. This is still not the 
        final goal, but it's a milestone.

PHASE 3:The next step, and most convoluted of all (since 
        we'll need to modify pretty much all the source) is 
        to load/save (SELECT/INSERT) data in realtime. That 
        way the mysql db could be modified externaly (web?).
        Again, the FFF will be kept intact.

REQUIREMENTS

1. MySQL server version 3.23.32 or greater
2. A MySQL user account
3. A MySQL database

ALPHA INSTALLATION

1. Create a mysql user and database (you can use mkanope.sql) (not done yet)
2. Edit services.conf add changes noted in Changes.conf
3. Change the above values to your mysql user and database
4. Run ./configure and choose the MySQL option
5. make ; make install
6. Create the tables with tables.sql

NOTES (things to fix)

* We need a more robust sql_query function. (DONE)
* ./configure does not look for, or check for MySQL libs. (DONE)
* ./configure uses hardcoded lib paths for MySQL. (DONE)
* mysql4 is #include <mysql.h> need a cpp clause. (DONE)

NOTES IN SPANISH (also need fixing)
1. en ./configure script. Supuestamente deberia tratar de decetectar donde estan las libs de mysql.  Ahora esta' hardcoded a /usr/lib/mysql.o (algo asi). Eso necesita ser dinamico, como los autoconf. (DONE)
2. en todo el mysql.c uso arrays fijos, onda char *query[2048], lo cual puede producir un overflow si es que se pasa de eso (DONE)
3. la funcion db_mysql_query() debe ser mas inteligente. Detecar timeouts, y hacer retries. Y deberia tener una forma mejor de salirse de errores (DONE)
4. las tablas. Necesitan ser optimizadas. Usar ENUM donde corresponda, y ver bien los lenghts de los fields. Quizas hacer un index, no se.
5. ver todas las funciones del save (dump) y confirmar que son consistentes, o sea, que hacemos la misma cosa para todos. (DONE)
6. poner un layer entre services y mysql, onda rdb.c que en vez de llamar db_mysql_save_ns_core, por ejemplo llame db_save_ns_core y que de ahi llame a la funcion especifica de mysql (para futuramente poder implementar msql, pgsql, etc) (DONE)
7. poner las directivas en el services.conf onda UseMysql, MysqlDump, MysqlRead, MysqlRealtime (DONE)

