#296 SQL error on creating tables

v2.0.1
closed-fixed
Database (56)
8
2005-11-04
2005-10-28
Ron Goodwin
No

Migrating from Ver.1.1.1 to 2.0.2 I selected Migrate
and checked 'Create tables' which raised an error:
Site Error

An error was encountered while publishing this resource.

Error Type: ProgrammingError
Error Value: (1064, "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 'SERIAL
PRIMARY KEY,\n subject TEXT,\n from_name TEXT,\n f")

I still think there is insufficient documentation to
define the steps for upgrading from a ZODB version to MySql

Discussion

  • Kevin Campbell
    Kevin Campbell
    2005-10-28

    Logged In: YES
    user_id=1241761

    Ron,

    The error raised is due to PostgreSQL datatypes being used
    rather than MySQL versions. The migration form should have
    an option for migrating to PostgreSQL or MySQL. If it
    doesn't, then that will need added to the migration form.
    I'll check this in a bit and raise a bug if needed.

    Regards,
    Kevin

     
  • Kevin Campbell
    Kevin Campbell
    2005-10-28

    • assigned_to: nobody --> kevca
     
  • Ron Goodwin
    Ron Goodwin
    2005-10-31

    Logged In: YES
    user_id=838577

    Kevin,
    There isn't an option displayed on my migration page to
    select the database type.
    Ron

     
  • Peter George
    Peter George
    2005-11-03

    • priority: 5 --> 8
    • assigned_to: kevca --> mathie
     
  • Logged In: YES
    user_id=12789

    OK, I've got the initial bug fixed in CVS. MySQL is now
    listed as an option for the migration and it will correctly
    create the tables. For bonus points, it will make sure and
    create them with the correct text encoding too!

    However, with the migration I'm trying out, it's failing due
    to a UnicodeEncodeError buried deep within ZMySQLDA, which
    I'm trying to suss out now...

     
  • Logged In: YES
    user_id=12789

    OK, it would appear that ZMySQLDA doesn't really support
    Unicode. I've a patch in their tracker[1] which I've
    probably gotten completely wrong, but which causes my test
    migrations to succeed. I'll need to have another look at it
    tomorrow, since adustman gives the impression I'm smoking
    crack. :-)

    The other workaround is to set the default character set
    encoding to UTF-8 globally (in
    lib/python2.4/sitecustomize.py), but I'm less enthralled
    about that as an option.

    Hopefully, the other MySQL-related migration bugs have
    disappeared today, though, so when 2.0.3 is released the
    MySQL migration should finally work!

    Regards,

    Graeme

    [1]
    http://sourceforge.net/tracker/index.php?func=detail&aid=1347619&group_id=22307&atid=374934

     
    • status: open --> closed-fixed
     
  • Logged In: YES
    user_id=12789

    OK, this particular issue is fixed in the latest CVS, so I'm
    closing this bug. The further unicode problems I came
    across later, we'll track in #1338614.