egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

mysql.mod problem with

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Modules & Programming
View previous topic :: View next topic  
Author Message
matteo
Guest





PostPosted: Thu Nov 04, 2004 5:40 pm    Post subject: mysql.mod problem with Reply with quote

Hi, I'm trying to use mysql.mod with an eggdrop 1.6.15. It works great, except that it doesn't log messages that contain one or more apostrophees (the ' character).
Any idea what could be involved ? thx in advance
Back to top
greenbear
Owner


Joined: 24 Sep 2001
Posts: 733
Location: Norway

PostPosted: Thu Nov 04, 2004 6:29 pm    Post subject: Reply with quote

you have to escape it, and i think the mysql.mod have a function for it, mysql_escape or something like that.
Back to top
View user's profile Send private message Send e-mail
matteo
Guest





PostPosted: Fri Nov 05, 2004 12:20 pm    Post subject: Reply with quote

yes I got that. Actually I did not do any modification to mysql.mod. I was just interested in the logging to mySQL part.
Yet it doesn't work "out of the box", I was just wondering if I missed something
Back to top
D4RkViP3R
Voice


Joined: 13 Jun 2005
Posts: 7
Location: Isenbüttel, Lower Saxony, Germany

PostPosted: Mon Jun 13, 2005 7:27 am    Post subject: Reply with quote

Hi matteo,

may you help me to compile the mysql.mod?
I think I'm too stupid to do this.

I copied the mysql sourcecode to /usr/src/mysql and the eggdrop sourcecode to /usr/src/eggdrop1.6.16.
I also copied the mysql.mod tarball to /usr/src/eggdrop1.6.16/src/mysql.mod THEN the mysql include dir to /usr/src/eggdrop1.6.16/src/mysql.mod/mysql

- ./configure --with-mysql=/usr/src/mysql <- works fine
- make config <- works also fine
- make modules <- here some errors compiling the mysql.mod

Code:
In file included from ../mysql.mod/mysql/mysql.h:62,
                 from ../mysql.mod/mysql.c:26:
../mysql.mod/mysql/my_list.h:32: error: parse error before "int"
make[2]: *** [../mysql.o] Error 1
make[2]: Leaving directory `/usr/src/eggdrop1.6.16/src/mod/mysql.mod'
make[1]: *** [mysql.mod_so] Error 2
make[1]: Leaving directory `/usr/src/eggdrop1.6.16/src/mod'
make: *** [modules] Error 2



Did I something wrong ?


Best regards,

D4RkViP3R
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Mon Jun 13, 2005 1:55 pm    Post subject: Reply with quote

you probably got other errors before that one, let us know what are they
Back to top
View user's profile Send private message Visit poster's website
D4RkViP3R
Voice


Joined: 13 Jun 2005
Posts: 7
Location: Isenbüttel, Lower Saxony, Germany

PostPosted: Mon Jun 13, 2005 6:18 pm    Post subject: Reply with quote

Hi,

I found the failure. I used wrong mySQL-dev versions.
But now I have one other failure with the server.mod see below in codebox

Code:
vs245184:/usr/src/eggdrop1.6.16# make modules
make[1]: Entering directory `/usr/src/eggdrop1.6.16/src/mod'
make[2]: Entering directory `/usr/src/eggdrop1.6.16/src/mod/assoc.mod'
make[2]: Nothing to be done for `modules'.
make[2]: Leaving directory `/usr/src/eggdrop1.6.16/src/mod/assoc.mod'
make[2]: Entering directory `/usr/src/eggdrop1.6.16/src/mod/blowfish.mod'
make[2]: Nothing to be done for `modules'.
make[2]: Leaving directory `/usr/src/eggdrop1.6.16/src/mod/blowfish.mod'
make[2]: Entering directory `/usr/src/eggdrop1.6.16/src/mod/channels.mod'
make[2]: Nothing to be done for `modules'.
make[2]: Leaving directory `/usr/src/eggdrop1.6.16/src/mod/channels.mod'
make[2]: Entering directory `/usr/src/eggdrop1.6.16/src/mod/compress.mod'
make[2]: Nothing to be done for `modules'.
make[2]: Leaving directory `/usr/src/eggdrop1.6.16/src/mod/compress.mod'
make[2]: Entering directory `/usr/src/eggdrop1.6.16/src/mod/console.mod'
make[2]: Nothing to be done for `modules'.
make[2]: Leaving directory `/usr/src/eggdrop1.6.16/src/mod/console.mod'
make[2]: Entering directory `/usr/src/eggdrop1.6.16/src/mod/ctcp.mod'
make[2]: Nothing to be done for `modules'.
make[2]: Leaving directory `/usr/src/eggdrop1.6.16/src/mod/ctcp.mod'
make[2]: Entering directory `/usr/src/eggdrop1.6.16/src/mod/dns.mod'
make[2]: Nothing to be done for `modules'.
make[2]: Leaving directory `/usr/src/eggdrop1.6.16/src/mod/dns.mod'
make[2]: Entering directory `/usr/src/eggdrop1.6.16/src/mod/filesys.mod'
make[2]: Nothing to be done for `modules'.
make[2]: Leaving directory `/usr/src/eggdrop1.6.16/src/mod/filesys.mod'
make[2]: Entering directory `/usr/src/eggdrop1.6.16/src/mod/irc.mod'
make[2]: Nothing to be done for `modules'.
make[2]: Leaving directory `/usr/src/eggdrop1.6.16/src/mod/irc.mod'
make[2]: Entering directory `/usr/src/eggdrop1.6.16/src/mod/mysql.mod'
gcc -pipe -fPIC -g -O2 -Wall -I. -I../../.. -I../../.. -I../../../src/mod -DHAVE                                                           _CONFIG_H  -I/usr/src/mysql/include  -DMAKING_MODS -c .././mysql.mod/mysql.c
mv mysql.o ../
gcc -pipe -shared -nostartfiles -L/usr/src/mysql/lib/mysql -lmysqlclient -o ../.                                                           ./../mysql.so ../mysql.o
touch ../../../mysql.so
make[2]: Leaving directory `/usr/src/eggdrop1.6.16/src/mod/mysql.mod'
make[2]: Entering directory `/usr/src/eggdrop1.6.16/src/mod/notes.mod'
gcc -pipe -fPIC -g -O2 -Wall -I. -I../../.. -I../../.. -I../../../src/mod -DHAVE                                                           _CONFIG_H   -DMAKING_MODS -c .././notes.mod/notes.c
mv notes.o ../
gcc -pipe -shared -nostartfiles -o ../../../notes.so ../notes.o -L/usr/lib -ltcl                                                           8.4 -lm -lpthread -ldl -lnsl
touch ../../../notes.so
make[2]: Leaving directory `/usr/src/eggdrop1.6.16/src/mod/notes.mod'
make[2]: Entering directory `/usr/src/eggdrop1.6.16/src/mod/seen.mod'
gcc -pipe -fPIC -g -O2 -Wall -I. -I../../.. -I../../.. -I../../../src/mod -DHAVE                                                           _CONFIG_H   -DMAKING_MODS -c .././seen.mod/seen.c
mv seen.o ../
gcc -pipe -shared -nostartfiles -o ../../../seen.so ../seen.o
touch ../../../seen.so
make[2]: Leaving directory `/usr/src/eggdrop1.6.16/src/mod/seen.mod'
make[2]: Entering directory `/usr/src/eggdrop1.6.16/src/mod/server.mod'
gcc -pipe -fPIC -g -O2 -Wall -I. -I../../.. -I../../.. -I../../../src/mod -DHAVE                                                           _CONFIG_H   -DMAKING_MODS -c .././server.mod/server.c
../server.mod/server.c: In function `next_server':
../server.mod/server.c:1047: warning: dereferencing type-punned pointer will bre                                                           ak strict-aliasing rules
../server.mod/server.c: At top level:
../server.mod/server.c:1341: warning: dereferencing type-punned pointer will bre                                                           ak strict-aliasing rules
../server.mod/server.c:1349: warning: dereferencing type-punned pointer will bre                                                           ak strict-aliasing rules
mv server.o ../
gcc -pipe -shared -nostartfiles -o ../../../server.so ../server.o -L/usr/lib -lt                                                           cl8.4 -lm -lpthread -ldl -lnsl
touch ../../../server.so
make[2]: Leaving directory `/usr/src/eggdrop1.6.16/src/mod/server.mod'
make[2]: Entering directory `/usr/src/eggdrop1.6.16/src/mod/share.mod'
gcc -pipe -fPIC -g -O2 -Wall -I. -I../../.. -I../../.. -I../../../src/mod -DHAVE                                                           _CONFIG_H   -DMAKING_MODS -c .././share.mod/share.c
mv share.o ../
gcc -pipe -shared -nostartfiles -o ../../../share.so ../share.o
touch ../../../share.so
make[2]: Leaving directory `/usr/src/eggdrop1.6.16/src/mod/share.mod'
make[2]: Entering directory `/usr/src/eggdrop1.6.16/src/mod/transfer.mod'
gcc -pipe -fPIC -g -O2 -Wall -I. -I../../.. -I../../.. -I../../../src/mod -DHAVE                                                           _CONFIG_H   -DMAKING_MODS -c .././transfer.mod/transfer.c
mv transfer.o ../
gcc -pipe -shared -nostartfiles -o ../../../transfer.so ../transfer.o -L/usr/lib                                                            -ltcl8.4 -lm -lpthread -ldl -lnsl
touch ../../../transfer.so
make[2]: Leaving directory `/usr/src/eggdrop1.6.16/src/mod/transfer.mod'
make[2]: Entering directory `/usr/src/eggdrop1.6.16/src/mod/uptime.mod'
gcc -pipe -fPIC -g -O2 -Wall -I. -I../../.. -I../../.. -I../../../src/mod -DHAVE                                                           _CONFIG_H   -DMAKING_MODS -c .././uptime.mod/uptime.c
mv uptime.o ../
gcc -pipe -shared -nostartfiles -o ../../../uptime.so ../uptime.o
touch ../../../uptime.so
make[2]: Leaving directory `/usr/src/eggdrop1.6.16/src/mod/uptime.mod'
make[2]: Entering directory `/usr/src/eggdrop1.6.16/src/mod/wire.mod'
gcc -pipe -fPIC -g -O2 -Wall -I. -I../../.. -I../../.. -I../../../src/mod -DHAVE                                                           _CONFIG_H   -DMAKING_MODS -c .././wire.mod/wire.c
mv wire.o ../
gcc -pipe -shared -nostartfiles -o ../../../wire.so ../wire.o
touch ../../../wire.so
make[2]: Leaving directory `/usr/src/eggdrop1.6.16/src/mod/wire.mod'

All modules compiled.
make[1]: Leaving directory `/usr/src/eggdrop1.6.16/src/mod'

Test run of ./eggdrop -v:
/bin/sh: line 1: ./eggdrop: No such file or directory
make: *** [modules] Error 127


The mysql.mod area seems to be okay but when I start my eggdrop comes the following:

Code:
[00:11] * Last context: mysql:mysql.c/119 []
[00:11] * Please REPORT this BUG!
[00:11] * Check doc/BUG-REPORT on how to do so.
[00:11] * Wrote DEBUG
[00:11] * SEGMENT VIOLATION -- CRASHING!



I don't know what to do Sad


D4RkViP3R
Back to top
View user's profile Send private message
Galadhrim
Op


Joined: 11 Apr 2003
Posts: 123
Location: Netherlands, Enschede

PostPosted: Mon Jun 13, 2005 6:53 pm    Post subject: Reply with quote

Code:
...
Test run of ./eggdrop -v:
/bin/sh: line 1: ./eggdrop: No such file or directory
make: *** [modules] Error 127


the way it looks to me is that u didnt execute 'make', you do have to compile eggdrop itself before you compile the modules.

Code:
make[2]: Entering directory `/usr/src/eggdrop1.6.16/src/mod/server.mod'
gcc -pipe -fPIC -g -O2 -Wall -I. -I../../.. -I../../.. -I../../../src/mod -DHAVE                                                           _CONFIG_H   -DMAKING_MODS -c .././server.mod/server.c
../server.mod/server.c: In function `next_server':
../server.mod/server.c:1047: warning: dereferencing type-punned pointer will bre                                                           ak strict-aliasing rules
../server.mod/server.c: At top level:
../server.mod/server.c:1341: warning: dereferencing type-punned pointer will bre                                                           ak strict-aliasing rules
../server.mod/server.c:1349: warning: dereferencing type-punned pointer will bre                                                           ak strict-aliasing rules
mv server.o ../
gcc -pipe -shared -nostartfiles -o ../../../server.so ../server.o -L/usr/lib -lt                                                           cl8.4 -lm -lpthread -ldl -lnsl
touch ../../../server.so
make[2]: Leaving directory `/usr/src/eggdrop1.6.16/src/mod/server.mod'

The server.mod errors are warnings which you can ignore, everyone I know have them...

Code:
[00:11] * Last context: mysql:mysql.c/119 []
[00:11] * Please REPORT this BUG!
[00:11] * Check doc/BUG-REPORT on how to do so.
[00:11] * Wrote DEBUG
[00:11] * SEGMENT VIOLATION -- CRASHING!


Wonder if anyone can think of what is wrong... Might be the login variables being setup wrong, no mysql server running on the host you specified. Or maybe you edited one of the files of the mod...
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Mon Jun 13, 2005 11:45 pm    Post subject: Reply with quote

you messed up, start over - cleanup, untar eggdrop, untar mysqlmod, configure, make, install
Back to top
View user's profile Send private message Visit poster's website
D4RkViP3R
Voice


Joined: 13 Jun 2005
Posts: 7
Location: Isenbüttel, Lower Saxony, Germany

PostPosted: Tue Jun 14, 2005 10:46 am    Post subject: Reply with quote

Hi demond,

I do this and it's the same problem.
Now I take the mysqltcl module and its works very fine Smile
But one problem I have with this.

I have a database named 'eggdrop' and a table named 'allow_in_channels'.
If I want to query the table with following proc:

Code:
proc allow_in_channel {current_channel} {
    global scriptname db_handle
    set sql_cmd "SELECT $scriptname FROM 'allow_in_channels'"
    set result [mysqlquery $db_handle $sql_cmd]

    while {[set row [mysqlnext $result]] != ""} {
        #set allow_in_channel_id [lindex $row 0]
        set allow_in_channel_script [lindex $row 1]
        set allow_in_channel_channel [lindex $row 2]

        if {$allow_in_channel_script == $scriptname} {
            if {$allow_in_channel_channel == $current_channel} {
                return $allow_in_channel_channel
            }
        }
    }
}


And call the "function"

Code:

bind pub - !testin testin
proc testin {nick uhost hand chan arg} {
    global scriptname
    if {([allow_in_channel $chan] == $chan)} {
        putchan $chan "Hallo"
    }
}


My eggdrop shows me this message:
Code:
[16:26] Tcl error [testin]: mysqlquery/db server: You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM 'allow_in_channels'' at line 1


Doesn't support this script tablenames with underscores or what?


Regards,

D4RkViP3R
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Tue Jun 14, 2005 12:30 pm    Post subject: Reply with quote

it's not the underscores, it's the single quotes

remove single quotes:
Code:

set sql_cmd "SELECT $scriptname FROM allow_in_channels"
Back to top
View user's profile Send private message Visit poster's website
D4RkViP3R
Voice


Joined: 13 Jun 2005
Posts: 7
Location: Isenbüttel, Lower Saxony, Germany

PostPosted: Tue Jun 14, 2005 12:36 pm    Post subject: Reply with quote

Sad

same error

Code:
[18:37] Tcl error [testin]: mysqlquery/db server: You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM allow_in_channels' at line 1
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Tue Jun 14, 2005 12:39 pm    Post subject: Reply with quote

most likely $scriptname is empty string
Back to top
View user's profile Send private message Visit poster's website
D4RkViP3R
Voice


Joined: 13 Jun 2005
Posts: 7
Location: Isenbüttel, Lower Saxony, Germany

PostPosted: Tue Jun 14, 2005 12:43 pm    Post subject: Reply with quote

I've replaced the variable with the string.
The error doesn't change

May you help my over ICQ to solve the problem ?
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Tue Jun 14, 2005 12:56 pm    Post subject: Reply with quote

sorry, I don't help privately on ICQ (unless you don't mind me charging you a fee for my consulting services)

try your SQL command from mysql client utility
Back to top
View user's profile Send private message Visit poster's website
D4RkViP3R
Voice


Joined: 13 Jun 2005
Posts: 7
Location: Isenbüttel, Lower Saxony, Germany

PostPosted: Wed Jun 15, 2005 7:11 pm    Post subject: Reply with quote

fixed, is used a wrong rowname Smile

Tnx


D4RkViP3R
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Modules & Programming All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber