logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
MySQL plugin, invalid query crashes the server ?

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Development
View previous topic :: View next topic  
Author Message
uezi



Joined: 06 Dec 2006
Posts: 6

PostPosted: Wed Dec 06, 2006 23:55    Post subject: MySQL plugin, invalid query crashes the server ? Reply with quote

Executing an invalid query using the MySQL plugin crashes the nwn2 server.
This is also the cause of the crash when using the Get/SetPersistent... functions when the PWDATA table has not been created.
Happens in 1.04-1.06
Back to top
View user's profile Send private message
amphiprion



Joined: 07 Nov 2006
Posts: 44
Location: Toulouse (France)

PostPosted: Thu Dec 07, 2006 14:30    Post subject: Reply with quote

Hi
could you give us the query because with wrong query my server don't crash.
Back to top
View user's profile Send private message
uezi



Joined: 06 Dec 2006
Posts: 6

PostPosted: Thu Dec 07, 2006 23:33    Post subject: Reply with quote

amphiprion wrote:
Hi
could you give us the query because with wrong query my server don't crash.


SQLExecDirect( "SELECT sqlite_version(*)" );

You may wonder why this query on MySQL? Well it was an initial trick for detecting if SQLLite or MySQL was beeing used and activate code paths for supporting both databases Smile

Well, now I changed my code and use the nwnx_include.nss functions for checking plugin information.
After this change the server no longer crashes.
Back to top
View user's profile Send private message
Grinning Fool



Joined: 12 Feb 2005
Posts: 264

PostPosted: Thu Dec 07, 2006 23:40    Post subject: Reply with quote

mysql probably viewed that as a stored proc, so it's possible that a call to a nonexistent stored proc would cause the crash?
_________________
Khalidine, a NWN2 persistent world

Looking for volunteers.
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Fri Dec 08, 2006 22:56    Post subject: Reply with quote

Hmm, the only thing that happens here is:

Quote:
! Error (mysql_query): 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 '*)' at line 1.


Are you sure the mysql plugin is the most recent one ? You might want to try to replace everything with the files from the download again, just to make sure.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
uezi



Joined: 06 Dec 2006
Posts: 6

PostPosted: Sun Dec 10, 2006 11:11    Post subject: Reply with quote

Papillon wrote:
Hmm, the only thing that happens here is:

Quote:
! Error (mysql_query): 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 '*)' at line 1.


Are you sure the mysql plugin is the most recent one ? You might want to try to replace everything with the files from the download again, just to make sure.


mmh, I'll have to check it out again.
I should have been using the most recent plugin, but maybe I messed up something when merging the config files and updating to the newest version.
Anyways now I use the nwnx_include functions for checking the database type and the crash no longer occurs.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Development All times are GMT + 2 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


Powered by phpBB © 2001, 2005 phpBB Group