The error I get is:

user warning: Unknown column 'lid' in 'where clause' query: DELETE FROM location WHERE lid = 9 in /var/www/drupal_5.1_20070214/html/includes/database.mysqli.inc on line 151.

My "location" table in the database has the following structure:

mysql> desc location;
+--------------+---------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+---------------------+------+-----+---------+-------+
| eid | int(10) unsigned | NO | PRI | 0 | |
| type | varchar(6) | NO | PRI | NULL | |
| name | varchar(255) | YES | | NULL | |
| street | varchar(255) | YES | | NULL | |
| additional | varchar(255) | YES | | NULL | |
| city | varchar(255) | YES | | NULL | |
| province | varchar(16) | YES | | NULL | |
| postal_code | varchar(16) | YES | | NULL | |
| country | char(2) | YES | | NULL | |
| latitude | decimal(10,6) | YES | | NULL | |
| longitude | decimal(10,6) | YES | | NULL | |
| source | tinyint(4) | YES | | 0 | |
+--------------+---------------------+------+----+---------+-------+

Comments

geodaniel’s picture

Category: bug » support

Have you run update.php since updating? If you have, this could be related to http://drupal.org/node/116599

stella’s picture

Yep I've run update.php since getting this error. I'm not sure if it's related to issue http://drupal.org/node/116599 but I do have the Views module enabled, ditto with GMap, GMap Location, GMap Macro Builder, GMap Views Integration, Location Views and KML.

Cheers,
Stella

stella’s picture

I've dropped my location table and recreated it using the sql provided in the 116599 issue. Everything is working fine now.

Stella

geodaniel’s picture

Sounds like a bug in the upgrade process then. Do you remember seeing any errors when you ran update.php previously?

stella’s picture

not with update.php. The only other problem I had with the location module was in relation to php5 and array_merge(), now fixed, but that's unconnected with the database schema.

Anyway I'm happy for this to be closed off.

Thanks,
Stella

mfredrickson’s picture

I'm seeing this error on a fresh D5 install with location.

I think the problem is actually with gmap_location. The install file for that module has this in it:

<?php
 
function gmap_location_install() {
  drupal_set_message('Installing location');
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("
      CREATE TABLE {location} (
        eid int unsigned NOT NULL default '0',
        type varchar(6) NOT NULL default '',
....

As you can see, it creates it's own location table. If it is enabled before location, all heck breaks loose.

I'm going to go file an issue there. Why are is gmap_location creating it's own location table? I'd guess this is a holdover from when gmap_location was a fork of location.

niklp’s picture

Status: Active » Closed (fixed)

I'll close this, because it's been addressed in another issue that's been patched and committed.