Archived
1
0
Fork 0

arch/mysql.c: fixed the test and a overflow in init(). mysql needs alot more love.

This commit is contained in:
H Hautakoski 2010-08-26 21:37:47 +02:00 committed by Henrik Hautakoski
parent bc7492cb1d
commit 8cafb25c42
3 changed files with 63 additions and 74 deletions

View file

@ -39,7 +39,7 @@ indexer :
$(CC) $(CFLAGS) -D__DEBUG__ ../src/common/path.c ../src/fs/tree.c ../src/indexer.c t_indexer.c -o test_indexer
mysql :
$(CC) -D DB_DEBUG $(CFLAGS) ../src/mysql_db.c -L/usr/lib64/mysql \
$(CC) -D DB_DEBUG $(CFLAGS) ../src/arch/mysql.c -L/usr/lib64/mysql \
-lmysqlclient -lz -lcrypt -lnsl -lm -L/usr/lib64 -lssl -lcrypto t_mysql.c -o test_mysql
queue :

View file

@ -1,33 +1,20 @@
#ifndef INOTIFY_DEBUG
#define INOTIFY_DEBUG
#endif
#include <stdio.h>
#include "../src/notify_db.h"
#include "../src/arch/db.h"
int main(int argc, char *argv[]) {
// Keep me safe
printf("Run!\n");
// Connect
notify_db_init("localhost", "warez", "elebobo", "filesystem", "filesystem");
// Truncate
//notify_db_truncate();
arch_db_init("localhost", "warez", "elebobo", "filesystem", "filesystem");
sleep(10);
// Insert
notify_db_insert("/this/is/my/path/to/", "myfile", 0);
arch_db_insert("/this/is/my/path/to/", "myfile", 0);
// Delete
//notify_db_delete("/this/is/my/path/to/", "myfile");
arch_db_delete("/this/is/my/path/to/", "myfile");
// Close
notify_db_close();
arch_db_close();
// Kill me
return 0;
}
}