Re: SQL logging compiles but does not work

Víctor Pascual wrote:

> ./robot.sh http://whatever.com http://whatever.com somewhereToLog 
> -sqlserver localhost -sqldb anyDB -sqluser root (just to try...)
>
> Can anybody say me what should I do, or what I'm doing wrong??

Hurrms, is there some place where you have initialized the "anyDB" 
database instance ?  A casual inspection of the code turns up where the 
createTables() function is invoked . . . see,

    [bancroft@hilbert libwww]$ find . | egrep "\.(c|h)$" | xargs grep
    createTables
    ./Library/cvs2sql/cvs2sql.c:PRIVATE BOOL createTables (HTSQL * sql,
    SQLFlags flags)
    ./Library/cvs2sql/cvs2sql.c:    if (create_db) createTables(sql, 0);

./Library/src/HTSQLLog.c:PRIVATE BOOL createTables (HTSQLLog * me, HTSQLLogFlags flags)

    ./Library/src/HTSQLLog.c:       createTables(me, flags);

So, a side effect of calling, HTSQLLog_open should be to create the 
appropriate table definitions.  This, given an appropriate define for 
HT_MYSQL, should create the correct tables, if the database exists.  As 
we see in RobotMain.c (around line 505),

    /* SQL Log specified? */
#ifdef HT_MYSQL
    if (mr->sqlserver) {
    if ((mr->sqllog =
         HTSQLLog_open(mr->sqlserver,
               mr->sqluser ? mr->sqluser : DEFAULT_SQL_USER,
               mr->sqlpw ? mr->sqlpw : DEFAULT_SQL_PW,
               mr->sqldb ? mr->sqldb : DEFAULT_SQL_DB,
               mr->sqlflags)) != NULL) {
        if (mr->sqlrelative) HTSQLLog_makeRelativeTo(mr->sqllog, mr->sqlrelative);
    }
    }
#endif

Perhaps you can try something relevantly similar to

mysql> create database webbot;
Query OK, 1 row affected (0.10 sec)

mysql> show databases;
+----------+
| Database |
+----------+
| mysql    |
| test     |
| webbot   |
+----------+
3 rows in set (0.00 sec)

I use the database name "webbot" since that is the definition for 
DEFAULT_SQL_DB . . .

more,
l8r,
v

-- 
america sig

Received on Thursday, 21 July 2005 03:17:57 UTC