I had to change it to:
MYSQL_UPDATE
CREATE TABLE `audio_playlist_metadata` (
pid int(10) unsigned NOT NULL default '0',
image_url varchar(128) default '',
subtitle varchar(128) default '',
author varchar(128) default '',
copyright varchar(128) default '',
owner varchar(128) default '',
owner_email varchar(128) default '',
explicit tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`pid`)
) /*!40100 DEFAULT CHARACTER SET utf8 */;
MYSQL_UPDATE

with the ` character around the primary key and table name...

MYSQL 4.1.14 on Debian

Comments

zirafa’s picture

Hm. I'd like to know if anybody else has this problem...currently the table name is surrounded by braces {audio_playlist_metadata} and the primary key is in single quotes.

      db_query(
<<<MYSQL_UPDATE
        CREATE TABLE {playlist_relate} (
          rid int(11) NOT NULL auto_increment,
          type varchar(255) NOT NULL default '',
          parent_id int(11) NOT NULL default 0,
          child_id int(11) NOT NULL default 0,
          weight int(11) default 0,
          PRIMARY KEY  ('rid')
        ) /*!40100 DEFAULT CHARACTER SET utf8 */;;
MYSQL_UPDATE
      );
zirafa’s picture

whoops, I meant to paste:

      db_query(
<<<MYSQL_UPDATE
        CREATE TABLE {audio_playlist_metadata} (
          pid int(10) unsigned NOT NULL default '0',
          image_url varchar(128) default '',
          subtitle varchar(128) default '',
          author varchar(128) default '',
          copyright varchar(128) default '',
          owner varchar(128) default '',
          owner_email varchar(128) default '',
          explicit tinyint(1) NOT NULL DEFAULT '0',
          PRIMARY KEY  (`pid`)
        ) /*!40100 DEFAULT CHARACTER SET utf8 */;
MYSQL_UPDATE
      );
jivyb’s picture

I get the following error after installing, enabling the module, granting permissions, and trying to both browse audio and manage playlist:

# user warning: Table 'username_dru47.audio_metadata' doesn't exist query: SELECT COUNT(*) FROM node n INNER JOIN audio_metadata a ON n.vid = a.vid INNER JOIN audio af ON n.vid = af.vid WHERE n.status = 1 in /home/username/public_html/includes/database.mysql.inc on line 120.
# user warning: Table 'username_dru47.audio_metadata' doesn't exist query: SELECT DISTINCT n.nid FROM node n INNER JOIN audio_metadata a ON n.vid = a.vid INNER JOIN audio af ON n.vid = af.vid WHERE n.status = 1 ORDER BY n.created DESC LIMIT 0, 7 in /home/username/public_html/includes/database.mysql.inc on line 120.
# user warning: Table 'username_dru47.audio_metadata' doesn't exist query: SELECT COUNT(*) FROM node n INNER JOIN audio_metadata a ON n.vid = a.vid INNER JOIN audio af ON n.vid = af.vid WHERE n.status = 1 in /home/username/public_html/includes/database.mysql.inc on line 120.
# user warning: Table 'username_dru47.audio_metadata' doesn't exist query: SELECT DISTINCT n.nid FROM node n INNER JOIN audio_metadata a ON n.vid = a.vid INNER JOIN audio af ON n.vid = af.vid WHERE n.status = 1

jivyb’s picture

Having trouble getting either of the above to work. Can either of you tell me the mysql code to run the query manually in phpmyadmin?

jivyb’s picture

I figured it out--Here's the manual mysql code:

CREATE TABLE audio_playlist_metadata (
          pid int(10) unsigned NOT NULL default '0',
          image_url varchar(128) default '',
          subtitle varchar(128) default '',
          author varchar(128) default '',
          copyright varchar(128) default '',
          owner varchar(128) default '',
          owner_email varchar(128) default '',
          explicit tinyint(1) NOT NULL DEFAULT '0',
          PRIMARY KEY  (pid)
        ) 
        TYPE = MYISAM /*!40100 DEFAULT CHARACTER SET utf8 */

Also, It would've been good to know that the errors I had above were caused by the playlist.module searching for audio_metadata which is a table created by the audio module...I'll post a request that the readme or install.txt be updated to reflect that playlist is dependent on audio module

bjb1959’s picture

I get these errors after using the manual sql code above to create the playlist_relate table which isn't created by the install. Any suggestions?

* user warning: Unknown column 'child_id' in 'field list' query: SELECT child_id FROM playlist_relate WHERE parent_id = 1 AND type = 'audio_playlist' ORDER BY weight in /srv/www/htdocs/drupal/includes/database.mysql.inc on line 120.
* user warning: Unknown column 'child_id' in 'field list' query: SELECT child_id FROM playlist_relate WHERE parent_id = 1 AND type = 'audio_playlist' ORDER BY weight in /srv/www/htdocs/drupal/includes/database.mysql.inc on line 120.

zirafa’s picture

Status: Active » Fixed

I haven't heard anybody having any problems recently so I'm marking as fixed. Feel free to un-fix it if it still doesn't work for you.

Anonymous’s picture

Status: Fixed » Closed (fixed)