* user warning: 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 '' at line 1 query: ALTER TABLE content_type_bps_school_commitee_meeting DROP in C:\wamp\www\drupal6\includes\database.mysql-common.inc on line 331.
* user warning: 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 '' at line 1 query: ALTER TABLE content_type_bps_super_circular DROP in C:\wamp\www\drupal6\includes\database.mysql-common.inc on line 331.
* user warning: 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 '' at line 1 query: ALTER TABLE content_type_bps_school DROP in C:\wamp\www\drupal6\includes\database.mysql-common.inc on line 331.
* user warning: 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 '' at line 1 query: ALTER TABLE content_type_bps_school DROP in C:\wamp\www\drupal6\includes\database.mysql-common.inc on line 331.
* user warning: 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 '' at line 1 query: ALTER TABLE content_type_bps_school_menu DROP in C:\wamp\www\drupal6\includes\database.mysql-common.inc on line 331.

Comments

NancyDru’s picture

Project: Content Construction Kit (CCK) » FileField
Version: 6.x-2.9 » 6.x-3.9
Component: upgrade path » Code
Priority: Normal » Major

Moving to FileField. I am pretty much dead in the water now.

NancyDru’s picture

This appears to be in update 6001. I can confirm that CCK in D5 was the most current (5.x-1.12).

NancyDru’s picture

Since these are drops rather than something that changed the data, is it reasonable to use the module while this is being fixed?

ckng’s picture

Having same problem.

user warning: Can't DROP 'field_object_description'; check that column/key exists query: ALTER TABLE content_type_lesson_object DROP field_object_description

Inspecting the DB shows that there is no 'field_object_description' but the description exist in the column 'field_object_data' as string array
a:1:{s:11:"description";N;}

NancyDru’s picture

Priority: Major » Normal

I am going with the assumption in #3.

quicksketch’s picture

Status: Active » Postponed

I'm not sure if there is anything here that FileField can (or will) fix. I'll look at patches, but I'm not going to install Drupal 5 to test this out.

Mark Theunissen’s picture

Title: Syntax errors upgrading from 5.x to 6.x » Syntax errors and data loss upgrading from 5.x to 6.x

I can confirm this issue and that it results in data loss in the upgrade. The function filefield_update_6001() is supposed to copy data from the 'description' and 'list' columns, serialize it, and add it into the newly created column 'data'.

However the update first alters the schema, dropping the description column:

// Update database storage (add data column, remove description, set NOT NULL).
  foreach ($fields as $field) {
    $new_field = $field;

    // Setup the previous definition.
    $field['columns']['description'] = array('type' => 'varchar');
    $field['columns']['fid']['not null'] = TRUE;
    $field['columns']['list']['not null'] = TRUE;
    unset($field['columns']['data']);

    // Setup the new definition.
    $new_field['columns']['data'] = array('type' => 'text', 'serialize' => TRUE);
    $new_field['columns']['fid']['not null'] = FALSE;
    $new_field['columns']['list']['size'] = 'tiny';
    $new_field['columns']['list']['not null'] = FALSE;
    unset($new_field['columns']['description']);

    content_alter_db($field, $new_field);
  }

*then* it attempts to set the batch operation, which fails to copy the data out (silently - ouch!) and instead inserts serialized blank arrays.

It doesn't seem like the above code works well (the content_alter_db function is suspect), as I can't get it to preserve the description column. I would be tempted to remove the whole chunk and replace it with one call to db_add_field(), and then write another update to clean up the description and list columns once this update has run.

Mark Theunissen’s picture

Priority: Normal » Critical
Status: Postponed » Active
Mark Theunissen’s picture

-edit-

Never mind, I see this column exists in the new schema.

quicksketch’s picture

Priority: Critical » Normal
Status: Active » Postponed

Er, okay. Well back to postponed then?

Mark Theunissen’s picture

Title: Syntax errors and data loss upgrading from 5.x to 6.x » Syntax errors and 'description' field data loss upgrading from 5.x to 6.x
Status: Postponed » Active

quicksketch: Sorry, I should have been clearer in my comments above where I made an edit.

The original bug still exists (what I described in #7 and what NancyDru is experiencing too).

I thought I found another, related bug and made a comment #9, however I realised that I was wrong about this second bug so edited my comment saying "never mind".

To summarise the current issue: The 'description' field is lost when upgrading from Drupal 5.x to 6.x

quicksketch’s picture

Status: Active » Closed (won't fix)

I'm not interested in fixing this problem. Sorry guys. Patches still accepted, but as I said above, I'm not going to install D5 to fix this problem.

Mark Theunissen’s picture

I don't blame you. :)