Project

General

Profile

SQL Error at subtaks

Added by Sven Denkert almost 14 years ago

Hello,

i'm using trunk version of redmine and getting an sql error while creating a subtask

Processing IssuesController#create (for 212.91.243.228 at 2010-06-18 12:12:03) [POST]
  Parameters: {"commit"=>"Anlegen", "project_id"=>"galiator", "action"=>"create", 
"authenticity_token"=>"BCRiZeomrtGNRWYqegG0ws1t2wbbvNmBhN7WX+IYJts=", "issue"=>{"start_date"=>"2010-06-18", 
"estimated_hours"=>"", "priority_id"=>"4", "parent_issue_id"=>"307", "done_ratio"=>"0", "assigned_to_id"=>"1", 
"subject"=>"Raumdock anlegen", "tracker_id"=>"2", "due_date"=>"", "status_id"=>"1", "description"=>"damit man die Pinnwand 
implementieren kann"}, "controller"=>"issues", "attachments"=>{"1"=>{"description"=>""}}}

...

  Issue Update (0.0ms)   Mysql::Error: 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 
' lft = 625, rgt = 626 WHERE (id = 314)' at line 1: 
UPDATE `issues` SET root_id = , lft = 625, rgt = 626 WHERE (id = 314)

Replies (4)

RE: SQL Error at subtaks - Added by Felix Schäfer almost 14 years ago

Do you use MySQL 5.1 perchance? It's not supported by the adapter rails uses.

RE: SQL Error at subtaks - Added by Sven Denkert almost 14 years ago

yes, it is a 5.1 server

Is there an other way to get working subtasks?
I can't downgrade the server to 5.0

RE: SQL Error at subtaks - Added by Felix Schäfer almost 14 years ago

Well, other than making the mysql adapter support 5.1... You could maybe try any of the other adapters, 4 in total come to mind, but there might be others: the full-ruby mysql gem (bad performance, not always good mysql compatibility), the librarized mysql gem (built against the mysql client libs, best rails compatibility, mysql only up to 5.0), mysql2 and mysql-plus gems (better performance in theory, can't tell anything about compatibility).

Yet another solution: use mysql-proxy and rewrite incoming queries to comply to mysql 5.1.

RE: SQL Error at subtaks - Added by Sven Denkert almost 14 years ago

Subtasks work now with MySQL 5.1 at my server.
The error occured with old data from subtask-plugin.
On update to trunk version the col root_id dont set to id.
root_id was "null" and create the error on update.

UPDATE issues SET root_id = id, lft = 1, rgt = 2 WHERE root_id IS NULL

fix the error

    (1-4/4)