Project

General

Profile

Actions

Defect #23741

closed

unable to modify the issue description

Added by Christian Pinedo over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Database
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Duplicate
Affected version:

Description

Hello,

I am using the last git version of the branch 3.3-stable and I cannot modify the description of my issues once they have been defined.

I get the following error in the browser:

Internal error
An error occurred on the page you were trying to access.
If you continue to experience problems please contact your Redmine administrator for assistance.
If you are the Redmine administrator, check your log files for details about the error.

This is the error in the log:

ActiveRecord::StatementInvalid (Mysql2::Error: Data too long for column 'old_value' at row 1: INSERT INTO `journal_details` (`property`, `prop_key`, `old_value`, `value`, `journal_id`) VALUES (.......................
  app/models/journal.rb:67:in `save'
  app/models/issue.rb:1679:in `create_journal'
  app/models/issue.rb:210:in `create_or_update'
  app/controllers/issues_controller.rb:515:in `block in save_issue_with_child_records'
  app/controllers/issues_controller.rb:503:in `save_issue_with_child_records'
  app/controllers/issues_controller.rb:179:in `update'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'
  • If I select to modify the description of the issue but I do not modify any character, there is no problem once I update the issue.
  • If I select to modify the description of the issue and I modify even only one character, this error raises.

Thanks,

Christian


Related issues

Is duplicate of Redmine - Defect #20831: journal_details table reverted value and old_value back to String on update from 2.6.0 to 3.1.1Closed

Actions
Actions #1

Updated by Toshi MARUYAMA over 8 years ago

  • Status changed from New to Needs feedback

journal_details.old_value and issued.description should be text type.
Do you use plugins?

Actions #2

Updated by Christian Pinedo over 8 years ago

The details of the tables:

mysql> describe journal_details;
+------------+-------------+------+-----+---------+----------------+
| Field      | Type        | Null | Key | Default | Extra          |
+------------+-------------+------+-----+---------+----------------+
| id         | int(11)     | NO   | PRI | NULL    | auto_increment |
| journal_id | int(11)     | NO   | MUL | 0       |                |
| property   | varchar(30) | NO   |     |         |                |
| prop_key   | varchar(30) | NO   |     |         |                |
| old_value  | tinytext    | YES  |     | NULL    |                |
| value      | tinytext    | YES  |     | NULL    |                |
+------------+-------------+------+-----+---------+----------------+
6 rows in set (0.00 sec)
mysql> describe issues;
+------------------+--------------+------+-----+---------+----------------+
| Field            | Type         | Null | Key | Default | Extra          |
+------------------+--------------+------+-----+---------+----------------+
| id               | int(11)      | NO   | PRI | NULL    | auto_increment |
| tracker_id       | int(11)      | NO   | MUL | NULL    |                |
| project_id       | int(11)      | NO   | MUL | NULL    |                |
| subject          | varchar(255) | NO   |     |         |                |
| description      | text         | YES  |     | NULL    |                |
| due_date         | date         | YES  |     | NULL    |                |
| category_id      | int(11)      | YES  | MUL | NULL    |                |
| status_id        | int(11)      | NO   | MUL | NULL    |                |
| assigned_to_id   | int(11)      | YES  | MUL | NULL    |                |
| priority_id      | int(11)      | NO   | MUL | NULL    |                |
| fixed_version_id | int(11)      | YES  | MUL | NULL    |                |
| author_id        | int(11)      | NO   | MUL | NULL    |                |
| lock_version     | int(11)      | NO   |     | 0       |                |
| created_on       | datetime     | YES  | MUL | NULL    |                |
| updated_on       | datetime     | YES  |     | NULL    |                |
| start_date       | date         | YES  |     | NULL    |                |
| done_ratio       | int(11)      | NO   |     | 0       |                |
| estimated_hours  | float        | YES  |     | NULL    |                |
| parent_id        | int(11)      | YES  |     | NULL    |                |
| root_id          | int(11)      | YES  | MUL | NULL    |                |
| lft              | int(11)      | YES  |     | NULL    |                |
| rgt              | int(11)      | YES  |     | NULL    |                |
| is_private       | tinyint(1)   | NO   |     | 0       |                |
| closed_on        | datetime     | YES  |     | NULL    |                |
+------------------+--------------+------+-----+---------+----------------+
24 rows in set (0.00 sec)

I think that the problem is the "tinytext" type in the case of old_value and the "text" type in case of description. Because if a modify a big text of description, there is no space in old_value??

The only plugin I use is DMSF.

Actions #3

Updated by Toshi MARUYAMA over 8 years ago

  • Priority changed from High to Normal
Actions #4

Updated by Christian Pinedo over 8 years ago

if you need more feedback, ask me. Thanks,

Actions #5

Updated by Toshi MARUYAMA over 8 years ago

I think it is bug of rails or mysql adapter in old version.
#20831, #21993, #21123#note-6.
Try #20831#note-3.

Actions #6

Updated by Toshi MARUYAMA over 8 years ago

  • Related to Defect #20831: journal_details table reverted value and old_value back to String on update from 2.6.0 to 3.1.1 added
Actions #7

Updated by Toshi MARUYAMA over 8 years ago

  • Category changed from Issues to Database
Actions #8

Updated by Christian Pinedo over 8 years ago

I think this bug is more related to #21993 than to #20831#note-3. #21993 discovers problems between text fields of the database with different size limits and #20831#note-3 is related to a migration problem between SQLite and MySQL. In this case, I think the problem is different size of text fields of the database (like #21993).

The db/schema.rb for issues table is:

  create_table "issues", force: :cascade do |t|
    t.integer  "tracker_id",       limit: 4,                     null: false
    t.integer  "project_id",       limit: 4,                     null: false
    t.string   "subject",          limit: 255,   default: "",    null: false
    t.text     "description",      limit: 65535
    t.date     "due_date" 
    t.integer  "category_id",      limit: 4
    t.integer  "status_id",        limit: 4,                     null: false
    t.integer  "assigned_to_id",   limit: 4
    t.integer  "priority_id",      limit: 4,                     null: false
    t.integer  "fixed_version_id", limit: 4
    t.integer  "author_id",        limit: 4,                     null: false
    t.integer  "lock_version",     limit: 4,     default: 0,     null: false
    t.datetime "created_on" 
    t.datetime "updated_on" 
    t.date     "start_date" 
    t.integer  "done_ratio",       limit: 4,     default: 0,     null: false
    t.float    "estimated_hours",  limit: 24
    t.integer  "parent_id",        limit: 4
    t.integer  "root_id",          limit: 4
    t.integer  "lft",              limit: 4
    t.integer  "rgt",              limit: 4
    t.boolean  "is_private",                     default: false, null: false
    t.datetime "closed_on" 

So, the description filed is limited to 65535. However, the old_value of journal_details table in db/schema.rb is limited to 255:

create_table "journal_details", force: :cascade do |t|
    t.integer "journal_id", limit: 4,   default: 0,  null: false
    t.string  "property",   limit: 30,  default: "", null: false
    t.string  "prop_key",   limit: 30,  default: "", null: false
    t.text    "old_value",  limit: 255
    t.text    "value",      limit: 255

(I cannot provide a patch because I am not a ruby/rails developer)

Actions #9

Updated by Toshi MARUYAMA over 8 years ago

  • Related to deleted (Defect #20831: journal_details table reverted value and old_value back to String on update from 2.6.0 to 3.1.1)
Actions #10

Updated by Toshi MARUYAMA over 8 years ago

  • Status changed from Needs feedback to Closed
  • Resolution set to Duplicate

We cannot do anything because of source:tags/3.3.0/db/migrate/20110227125750_change_journal_details_values_to_text.rb.

And this issue is duplicate of #20831.

Actions #11

Updated by Toshi MARUYAMA over 8 years ago

  • Is duplicate of Defect #20831: journal_details table reverted value and old_value back to String on update from 2.6.0 to 3.1.1 added
Actions

Also available in: Atom PDF