Fixing a DB error

This commit is contained in:
BlackLight 2010-10-21 17:42:57 +02:00
parent a15e1991e4
commit 8090600f65
3 changed files with 2 additions and 17 deletions

5
db.h
View file

@ -30,7 +30,7 @@
#define DB_init mysql_do_init
#define DB_is_init mysql_is_init
#define DB_query mysql_do_query
#define DB_num_rows mysql_do_num_rows
#define DB_num_rows mysql_num_rows
#define DB_fetch_row mysql_fetch_row
#define DB_free_result mysql_free_result
#define DB_escape_string mysql_do_escape_string
@ -39,14 +39,11 @@
#define DB_out_init mysql_do_out_init
#define DB_is_out_init mysql_is_out_init
#define DB_out_query mysql_do_out_query
#define DB_out_num_rows mysql_do_out_num_rows
#define DB_out_escape_string mysql_do_out_escape_string
#define DB_out_close mysql_do_out_close
DB_result* DB_query ( const char* );
DB_result* DB_out_query ( const char* );
unsigned long DB_num_rows();
unsigned long DB_out_num_rows();
#endif
#ifdef HAVE_LIBPQ

12
mysql.c
View file

@ -156,18 +156,6 @@ mysql_do_out_escape_string ( char **to, const char *from, unsigned long length )
return mysql_real_escape_string ( outdb, *to, from, length );
}
unsigned long
mysql_do_num_rows ()
{
return mysql_num_rows ( db );
}
unsigned long
mysql_do_num_rows ()
{
return mysql_num_rows ( outdb );
}
void
mysql_do_out_close ()
{

View file

@ -85,7 +85,7 @@ AI_som_train ()
AI_fatal_err ( "AIPreproc: Query error", __FILE__, __LINE__ );
}
num_rows = DB_out_num_rows();
num_rows = DB_num_rows ( res );
if ( !( inputs = (double**) alloca ( num_rows * sizeof ( double* ))))
{