MySQL 5.0 errors when running subscription.mysql
| Project: | Subscription |
| Version: | 4.6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Hi There,
Have tried the latest version of this module from both the Drupal site as well as http://messze.net/files/subscription-cvs-211005.tgz with the same result. When I go to import the subscription.mysql file into my Drupal database I get the syntax errors. I have tried using the CLI, PhpMyAdmin, and MySQL Query Browser. This is the error given by PHPMyAdmin;
Error
SQL query:
CREATE TABLE subscription_subscriptions(
sid int( 3 ) unsigned NOT NULL default '0',
uid int( 10 ) unsigned NOT NULL default '0',
condition text NOT NULL ,
cid int( 10 ) unsigned default '0',
object varchar( 15 ) NOT NULL default '',
PRIMARY KEY ( sid )
) 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 text NOT NULL,
cid int(10) unsigned default '0',I ended up creating the tables manually and was sucessfully able to create the table using this syntax;
CREATE TABLE `subscription_subscriptions` (
`sid` int( 3 ) unsigned NOT NULL default '0',
`uid` int( 10 ) unsigned NOT NULL default '0',
`condition` text NOT NULL ,
`cid` int( 10 ) unsigned default '0',
`object` varchar( 15 ) NOT NULL ,
PRIMARY KEY ( `sid` )
) ENGINE = MYISAM There also seems to be something wrong with a SELECT statement at line 319 of the subscription.module file, as even with the subscription_subscriptions table properly installed I still get this error when ever I try to view content, or the "my subscriptions" tab from under my acount settings;
Fatal error: 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' at line 1 query: SELECT s.*,c.name,c.id FROM subscription_subscriptions s LEFT JOIN subscription_channels c ON s.cid=c.cid WHERE s.uid = 0 ORDER BY uid, cid, object, condition in D:\WebRoot\drupal\includes\database.mysql.inc on line 66Also, when I try to subscribe to content (story in this case), I get this error at line 401 (might be 566 though);
Fatal error: 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,cid) VALUES (6,1,'node','a:1:{s:4:\"type\";s:5:\"story query: INSERT INTO subscription_subscriptions (sid,uid,object,condition,cid) VALUES (6,1,'node','a:1:{s:4:\"type\";s:5:\"story\";}',2) in D:\WebRoot\drupal\includes\database.mysql.inc on line 66System Info
OS: Windows XP SP2
Web: Apache 2
DB: MySQL 5.0.18
CMS: Drupal 4.6.5
Any ideas?

#1
Somehow set this to scritical without meaning it, and can't seem to edit it. Also, slight error in correct MySQL syntax. Correct code is;
CREATE TABLE `subscription_subscriptions` (`sid` int( 3 ) unsigned NOT NULL default '0',
`uid` int( 10 ) unsigned NOT NULL default '0',
`condition` text NOT NULL ,
`cid` int( 10 ) unsigned default '0',
`object` varchar( 15 ) NOT NULL ,
PRIMARY KEY ( `sid` )
) ENGINE = MYISAM;
(forgot the ; at the end)
#2
Oh for the love of god!! I really need to be more thorough before posting bugs. Tip of the day, set the "Status" feild to "" to look for existing bugs before posting! You never know, you might even find a patch already to commit to CVS..... ahem....
http://drupal.org/node/38980
Anyway, as patching is such a pain in the bum if you have a Windows box without Cygwin installed, I have attached the patched files ready to go.