Actions
Defect #12693
closedMSSQL column quotations
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Database
Target version:
-
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Fixed
Affected version:
Description
If I create new role the workflows are copied. The problem is in SQL query because no quotation is used for column names and in MSSQL the RULE and TYPE are reserved words. So I suggest to use quotation on every column according to SQL defintion.
I have had to modify the worflow_rule.rb like this:
delete_all :tracker_id => target_tracker.id, :role_id => target_role.id connection.insert "INSERT INTO #{WorkflowRule.table_name} (tracker_id, role_id, old_status_id, new_status_id, author, assignee, field_name, [rule], [type])" + " SELECT #{target_tracker.id}, #{target_role.id}, old_status_id, new_status_id, author, assignee, field_name, [rule], [type]" + " FROM #{WorkflowRule.table_name}" + " WHERE tracker_id = #{source_tracker.id} AND role_id = #{source_role.id}"
I have used square brackets but you can use double quotations accoring to SQL definition.
I'm running 2.2.0
Related issues
Updated by Jean-Philippe Lang about 12 years ago
- Status changed from New to Closed
- Resolution set to Wont fix
I'm closing it, MSSQL is not supported.
Updated by Jean-Philippe Lang about 12 years ago
[column] is MSSQL specific. I think that #quote_column_name
should be used instead.
Updated by Jean-Philippe Lang about 12 years ago
- Resolution changed from Wont fix to Fixed
Actions