プロジェクト

全般

プロフィール

Vote #79602

未完了

3.4.6, SQLSERVER 2014. Incorrect syntax near 'OFFSET'

Admin Redmine さんがほぼ2年前に追加. ほぼ2年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Database_21
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
21
version_id:
0
issue_org_id:
29819
author_id:
117184
assigned_to_id:
0
comments:
4
status_id:
1
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
141
ステータス-->[New]

説明

I'm trying to setup a new Redmine instance of version 3.4.6 using SQLSERVER 2014. When I run rake db:migrate I get the following error.

== 62 InsertBuiltinRoles: migrating ===========================================
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

TinyTds::Error: Incorrect syntax near 'OFFSET'.: EXEC sp_executesql N'SELECT 1 AS one FROM [roles] WHERE [roles].[name] = N''Non member'' COLLATE Latin1_General_CS_AS_WS ORDER BY [roles].[id] ASC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY'
C:/Sites/redmine346/db/migrate/062_insert_builtin_roles.rb:6:in up'
C:in
migrate'

Caused by:
ActiveRecord::StatementInvalid: TinyTds::Error: Incorrect syntax near 'OFFSET'.: EXEC sp_executesql N'SELECT 1 AS one FROM [roles] WHERE [roles].[name] = N''Non member'' COLLATE Latin1_General_CS_AS_WS ORDER BY [roles].[id] ASC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY'
C:/Sites/redmine346/db/migrate/062_insert_builtin_roles.rb:6:in up'
C:in
migrate'

Caused by:
TinyTds::Error: Incorrect syntax near 'OFFSET'.
C:/Sites/redmine346/db/migrate/062_insert_builtin_roles.rb:6:in up'
C:in
migrate'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

Any suggestions would be greatly appreciated


journals

Does using the latest tiny_tds solve the problem? Could you try the steps below?

1. Update the version of tiny_tds from 1.0.5 to 2.1.2.

<pre><code class="diff">
diff --git a/Gemfile b/Gemfile
index b9a176439..34300e052 100644
--- a/Gemfile
+++ b/Gemfile
@@ -66,7 +66,7 @@ if File.exist?(database_file)
when /sqlite3/
gem "sqlite3", "~>1.3.12", :platforms => [:mri, :mingw, :x64_mingw]
when /sqlserver/
- gem "tiny_tds", "~> 1.0.5", :platforms => [:mri, :mingw, :x64_mingw]
+ gem "tiny_tds", "~> 2.1.2", :platforms => [:mri, :mingw, :x64_mingw]
gem "activerecord-sqlserver-adapter", :platforms => [:mri, :mingw, :x64_mingw]
else
warn("Unknown database adapter `#{adapter}` found in config/database.yml, use Gemfile.local to load your own database gems")
</code></pre>

2. Run @bundle update@

3. Run @bundle exec rake db:migrate@ again.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

Admin Redmine さんがほぼ2年前に更新

  • カテゴリDatabase_21 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0