installation issue: mysql table creation syntax error

redtomato

08-12-2005 12:44:49

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

redtomato

08-12-2005 12:56:40

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',

silfreed

08-12-2005 13:39:40

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

radkon

29-01-2006 15:10:15

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

Thanks again