lists.netmrg.net lists.netmrg.net
NetMRG discussion and support
 
FAQ :: Search :: Memberlist :: Usergroups :: Register
Profile :: Log in to check your private messages :: Log in

installation issue: mysql table creation syntax error

 
Post new topic   Reply to topic    lists.netmrg.net Forum Index -> Support
Author Message
redtomato
Beginner


Joined: 08 Dec 2005
Posts: 2

PostPosted: Thu Dec 08, 2005 5:44 pm    Post subject: installation issue: mysql table creation syntax error Reply with quote

i've compiled and installed netmrg correctly. but table creation makes a syntax error (one of the field name seems to be a reserved word in MySQL5): is there a workaround ? --> i don't want to downgrade my db!

Error

SQL query:

CREATE TABLE conditions(
id int( 11 ) NOT NULL AUTO_INCREMENT ,
event_id int( 11 ) NOT NULL default '0',
value bigint( 20 ) NOT NULL default '0',
condition smallint( 6 ) NOT NULL default '0',
logic_condition smallint( 6 ) NOT NULL default '0',
value_type smallint( 6 ) NOT NULL default '0',
PRIMARY KEY ( id ) ,
KEY event_id( event_id )
) TYPE = MYISAM ;

MySQL said: Documentation
#1064 - 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 '"condition" smallint(6) NOT NULL default '0',
logic_condition smallint(6) NOT' at line 5
Back to top
redtomato
Beginner


Joined: 08 Dec 2005
Posts: 2

PostPosted: Thu Dec 08, 2005 5:56 pm    Post subject: workaround Reply with quote

i've found a workaround:

in the file "share/netmrg.mysql", you have to add :

SET sql_mode='ANSI_QUOTES';


and then, add quotes to :

"condition" smallint(6) NOT NULL default '0',
Back to top
silfreed
Site Admin


Joined: 19 Jan 2003
Posts: 394
Location: Shippensburg, PA, USA

PostPosted: Thu Dec 08, 2005 6:39 pm    Post subject: Reply with quote

You can also put backticks around the table name (`condition`).

I'm afraid it might become a problem in the gatherer and php scripts also; you might want to go through those and do the same thing (I recommend the backticks).

You might also want to report this as a bug in our bugs database: http://bugs.netmrg.net

-Doug
Back to top
radkon
Beginner


Joined: 29 Jan 2006
Posts: 2

PostPosted: Sun Jan 29, 2006 8:10 pm    Post subject: Reply with quote

Thanks for this fix, I had been struggling to figure this out for a day now and I am no MySQL expert.

Thanks again
Back to top
Display posts from previous:   
Post new topic   Reply to topic    lists.netmrg.net Forum Index -> Support All times are GMT
Page 1 of 1

 



smartBlue Style © 2002 Smartor
Powered by phpBB © 2001, 2002 phpBB Group