Modify

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#13035 closed defect (cantfix)

Getting mysql error 1406 when converting from sqlite to mysql

Reported by: joseph.garcia@… Owned by: Jun Omae
Priority: normal Component: TracMigratePlugin
Severity: normal Keywords: mysql
Cc: Trac Release: 1.0

Description

Running the following command:

./trac-migrate.py --in-place <myproject> mysql://<user>:<password>@<mysqlserver>:3306/trac

Keep getting a mysql 1406 error even though the max_allowed_packet is set to 1GB

Copying tables:
  attachment table... 426 records.
  auth_cookie table... 74 records.
  cache table... 11 records.
  component table... 19 records.
  dir_cache table... 67 records.
  enum table... 15 records.
  milestone table... 32 records.
  node_change table... 6623 records.
  permission table... 37 records.
  report table... 17 records.
  repository table... 47 records.
  revision table... 1824 records.
  session table... 13365 records.
  session_attribute table... 26983 records.
  system table... 3 records.
  ticket table... 1401 records.
  ticket_change table... Traceback (most recent call last):
  File "./trac-migrate.py", line 55, in <module>
    sys.exit(main(sys.argv[1:]) or 0)
  File "./trac-migrate.py", line 51, in main
    return TracMigrationCommand(env)._do_migrate(dest, dburi)
  File "/tmp/blah/tracmigrateplugin/0.12/tracmigrate/admin.py", line 55, in _do_migrate
    return self._do_migrate_inplace(dburi)
  File "/tmp/blah/tracmigrateplugin/0.12/tracmigrate/admin.py", line 89, in _do_migrate_inplace
    self._copy_tables(src_db, dst_db, src_dburi, dburi, inplace=True)
  File "/tmp/blah/tracmigrateplugin/0.12/tracmigrate/admin.py", line 212, in _copy_tables
    count = copy_table(dst_db, cursor, table)
  File "/tmp/blah/tracmigrateplugin/0.12/tracmigrate/admin.py", line 202, in copy_table
    sum(rows, ()))
  File "/usr/local/lib64/python2.6/site-packages/Trac-1.0.11-py2.6.egg/trac/db/util.py", line 72, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
  File "/usr/lib64/python2.6/site-packages/MySQLdb/cursors.py", line 166, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib64/python2.6/site-packages/MySQLdb/connections.py", line 35, in defaulterrorhandler
    raise errorclass, errorvalue
_mysql_exceptions.DataError: (1406, "Data too long for column 'newvalue' at row 88")

Attachments (0)

Change History (4)

comment:1 Changed 8 years ago by joseph.garcia@…

Trac is version 1.0.11

It looks like all the tables are being created with type text which has a 255 char limit.

+----------+------------+------+-----+---------+-------+
| Field    | Type       | Null | Key | Default | Extra |
+----------+------------+------+-----+---------+-------+
| ticket   | int(11)    | NO   | PRI | 0       |       |
| time     | bigint(20) | NO   | PRI | 0       |       |
| author   | text       | YES  |     | NULL    |       |
| field    | text       | NO   | PRI | NULL    |       |
| oldvalue | text       | YES  |     | NULL    |       |
| newvalue | text       | YES  |     | NULL    |       |
+----------+------------+------+-----+---------+-------+

comment:2 Changed 8 years ago by Jun Omae

Keywords: mysql added; MySQL removed
Resolution: cantfix
Status: newclosed

Mysql TEXT is 65535 characters limit.

comment:4 Changed 8 years ago by Ryan J Ollos

In light of trac:#8396, it sounds like the issue could be resolved by upgrading to Trac 1.2 before the migration.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.