Hello,

I was interested in creating nodes from feeds to use news from other sites as a starting point for discussions. I choosed FeedAPI, SimplePie parser and FeedAPI node. I started with 1.0 version of FeedAPI, with Drupal 5.7 and MySQL 4.0.23. I got an error message saying "Table mydatabase.feedapi_node_item doesn't exist ..."

After reading FeedAPI issues, I tried different things which did not work :
- upgrade my MySQL version from 4.0.23 to > 4.1
- install one component at a time then update the database
- test both 1.0 and 1.x-dev versions of FeedAPI

The table is still missing. The error message says :

user warning: Table 'mydatabase.feedapi_node_item' doesn't exist query: SELECT fi.*, ff.feed_nid FROM feedapi_node_item fi JOIN feedapi_node_item_feed ff ON fi.nid = ff.feed_item_nid WHERE fi.nid = 355 in /home3/s/mysite/www/drupal/includes/database.mysql.inc on line 172.

What shall I do now ?

Thanks for your help.

Comments

bobthecow’s picture

a bit more on this. i had the same problem... the feedapi node module wouldn't install under mysql 4, so i upgraded to mysql 5 and it worked just fine. here's the error from my log:

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 'character set latin1 collate latin1_general_ci NOT NULL, query: CREATE TABLE feedapi_node_item ( fiid int(10) unsigned NOT NULL, feed_nid int(10) unsigned NOT NULL, nid int(10) unsigned NOT NULL, url text character set latin1 collate latin1_general_ci NOT NULL, `timestamp` int(10) unsigned NOT NULL default '0', arrived int(10) unsigned NOT NULL default '0', guid text character set latin1 collate latin1_general_ci NOT NULL, PRIMARY KEY (nid), KEY fiid (fiid), KEY feed_nid (feed_nid), KEY arrived (arrived), KEY url (url(255)), KEY guid (guid(255)) ) DEFAULT CHARSET=latin1; in /homepages/18/d167091269/htdocs/drupal/drupal-5.7/includes/database.mysql.inc on line 172.

i successfully ran the query manually under mysql 4 by stripping out all of the "character set" and "collate" parts.

PhilippeB’s picture

Hello Bobthecow,

Thanks for your comment. I tried to run the query manually and it worked indeed (after a few tries).

For those who are not familiar with MySQL, here's the query that finaly worked for me (with MySQL 4.1.22) :

CREATE TABLE feedapi_node_item (
fiid int(10) unsigned NOT NULL,
feed_nid int(10) unsigned NOT NULL,
nid int(10) unsigned NOT NULL,
url text NOT NULL,
`timestamp` int(10) unsigned NOT NULL default '0',
arrived int(10) unsigned NOT NULL default '0',
guid text NOT NULL,
PRIMARY KEY (nid),
KEY fiid (fiid),
KEY feed_nid (feed_nid),
KEY arrived (arrived),
KEY url (url(255)),
KEY guid (guid(255))
)

Hope this will help.

aron novak’s picture

Can you share me the platform where mysql is running? Maybe there are differences between platforms. For example, an old mysql distribution (mysql Ver 14.7 Distrib 4.1.11, for pc-linux-gnu (i386) works nicely.

PhilippeB’s picture

Hello Aron,

My phpinfo.php file indicates the system is:
Linux http23 2.4.34-grsec #1 Wed Jun 20 16:32:30 CEST 2007 i686

smk-ka’s picture

Component: Miscellaneous » Code
Assigned: Unassigned » smk-ka
Category: support » bug
Status: Active » Needs review

I've reviewed the FeedAPI Node install file and fixed a couple of things:

  1. CREATE TABLE statements should create tables using UTF-8 as default charset, not latin1. The patch removes any explicit charset statements, and update_7() converts the main table to UTF-8. This should fix the problems the OP reported.
  2. Postgres indices are created globally, and should therefore be unique. This has been fixed in update_6() by altering existing indices to include the table name they belong to. See here for reference.
  3. The rest of the changes are purely of cosmetic nature or simplify existing code.
smk-ka’s picture

StatusFileSize
new8.53 KB

The patch...

smk-ka’s picture

StatusFileSize
new8.73 KB

Previous patch left one of the tables in latin1 encoding, new patch fixes this.

mustafau’s picture

I have created an issue about character sets two months ago. Why don't we merge the two patches?

#247900: Default character set of FeedAPI db tables

mustafau’s picture

Status: Needs review » Needs work

Patch does not apply.

mustafau’s picture

Priority: Normal » Critical
smk-ka’s picture

Status: Needs work » Fixed

This patch was actually quite unnecessary: it seems that it was already fixed in CVS by the time I submitted it.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.