Hey!
When I install banner.module in my 4.7.2. drupal system then NO database structure is created.
I'm using banner module on my other drupal sites (cvs version of drupal + some cvs version of banner) but there it's not working. If I use some old banner.mysql file to create banner structure in myPhpAdmin then i get this error:

* user warning: Unknown column 'b.vid' in 'on clause' query: SELECT COUNT(*) FROM node n INNER JOIN banner b ON n.vid=b.vid INNER JOIN users u ON n.uid=u.uid in /home/www/mazlicci/new.psi-kocky.cz/htdocs/includes/database.mysql.inc on line 120.
* user warning: Unknown column 'b.vid' in 'on clause' query: SELECT n.*, b.*, u.name FROM node n INNER JOIN banner b ON n.vid=b.vid INNER JOIN users u ON n.uid=u.uid ORDER BY workflow ASC LIMIT 0, 25 in /home/www/mazlicci/new.psi-kocky.cz/htdocs/includes/database.mysql.inc on line 120.

Any clue? Could you any send me mysql dump to create database? Looks banner.install is not working WELL!

It's critical problem for me :( I need quick help.

Comments

umonkey’s picture

brumisek, the trailing ";" in the banner.install file sometimes breaks the process (always does so for me, but perhaps it works for someone). Copy the SQL instruction from that file, change the table name (remove {} and add the prefix), remove the semicolon and run the query.

wulff’s picture

AFAICT from a quick check, quite a few modules have a trailing ';' in create table in the .install file.

brumisek: do you get any error messages when activating the banner module on the modules page?

micahw156’s picture

I just installed the latest (15-Aug-2006) cvs version into my test 4.7.3 installation, and I also have the same error. Upon activation, I get the following message:

user warning: You have an error in your SQL syntax near '; ' at line 44 query: CREATE TABLE banner ( nid INT(10) UNSIGNED NOT NULL DEFAULT '0', vid INT(10) UNSIGNED NOT NULL DEFAULT '0', -- basic information url VARCHAR(255) NOT NULL DEFAULT '', target VARCHAR(8) NOT NULL DEFAULT '', workflow TINYINT UNSIGNED NOT NULL DEFAULT '0', position TINYINT UNSIGNED NOT NULL DEFAULT '0', mode TINYINT UNSIGNED NOT NULL DEFAULT '0', content TEXT, cache TEXT, -- notifications notify_day TINYINT UNSIGNED NOT NULL DEFAULT '0', notify_week TINYINT UNSIGNED NOT NULL DEFAULT '0', notify_failed INT(3) UNSIGNED NOT NULL DEFAULT '0', notify_send TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', notify_sent TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', in /webdocs/includes/database.mysql.inc on line 120.

I manually created the table as described by umonkey and all is well.

My test system is somewhat ancient: Fedora Core 1 with mysql-server-3.23.58-4.7.legacy. Works okay with Drupal 4.7 and Gallery 2.1.1, but I may be stretching it, and it will soon be upgraded. On a hunch, I downloaded the same banner module to my fresh copy of drupal-on-a-stick, and the table intialized properly. brumisek, are you also using an older version of mysql? Could this be the problem?

ryivhnn’s picture

I had to do the same thing for MySQL 4.0.27-standard. Not -that- old in the grand scheme of things seeing as the latest MySQL stable is 5 :)

ymcp’s picture

Exactly the same problem here (user warning: You have an error in your SQL syntax near '; ' at line 44 query...) when installing the module.

This is with a clean Drupal 4.7.3 install and banner.module v1.66 2006/08/15 20:53:38, on a server running mysql v3.23

I did manage to install the banner module on a server running mysql v4.1.15 , so it seems very likely that the .install file is not compatible with earlier versions of mysql.

Other modules (and Drupal in general) seem to support mysql v3.23, so it would be nice if this install file could be fixed...

ymcp’s picture

After a bit of trial and error, I have found that the .install file needs to be edited as follows:

Change this:

         ) /*!40100 DEFAULT CHARACTER SET utf8 */;
       ");

To this:

         ) /*!40100 DEFAULT CHARACTER SET utf8 */;"
       );

ie, move the double quotes from the start of the last line to the end of the previous line.

No idea why this should make any difference, but it does.

Ease to reproduce: just try to install this module on a mysql 3.23 server & try it with & without the change. Remember to disable the banner module and delete the entry from the system table between tests:

mysql> delete from system where type='module' and name like 'banner%';
wulff’s picture

Status: Active » Fixed

Committed. Thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)