Project

General

Profile

Actions

Defect #12693

closed

MSSQL column quotations

Added by Martin Valensky over 11 years ago. Updated over 11 years ago.

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

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

Actions
Actions #1

Updated by Jean-Philippe Lang over 11 years ago

  • Status changed from New to Closed
  • Resolution set to Wont fix

I'm closing it, MSSQL is not supported.

Actions #2

Updated by Jean-Philippe Lang over 11 years ago

[column] is MSSQL specific. I think that #quote_column_name should be used instead.

Actions #3

Updated by Jean-Philippe Lang over 11 years ago

  • Resolution changed from Wont fix to Fixed

Fixed in r11099, see #12713.

Actions

Also available in: Atom PDF