Project

General

Profile

Actions

Defect #12693

closed

MSSQL column quotations

Added by Martin Valensky about 13 years ago. Updated about 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Database
Target version:
-
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

Related to Redmine - Feature #12713: Microsoft SQLServer supportClosedJean-Philippe LangActions
Actions

Also available in: Atom PDF