プロジェクト

全般

プロフィール

Vote #77341

完了

SQL server: non ASCII filter does not work

Admin Redmine さんが約4年前に追加. 約4年前に更新.

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

0%

予定工数:
category_id:
56
version_id:
110
issue_org_id:
22405
author_id:
149056
assigned_to_id:
1
comments:
9
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
109
ステータス-->[Closed]

説明

Filter not work with unicode.


journals

See [[Submissions]].
--------------------------------------------------------------------------------
I have new Issues like image. when i filter with "Kiểm", it not show.
!feedback.png!
--------------------------------------------------------------------------------
[[Submissions#Submitting-a-Bug]]
> Before submitting a bug report here, please make sure:
> .
> .
> .
--------------------------------------------------------------------------------
Sory, i setup server on windows and SQL server 2012.

Environment:
Redmine version 3.2.0.stable
Ruby version 2.1.8-p440 (2015-12-16) [i386-mingw32]
Rails version 4.2.5
Environment production
Database adapter SQLServer
SCM:
Git 1.9.4
Filesystem
Redmine plugins:
redmine_ckeditor 1.1.3
--------------------------------------------------------------------------------
I cannot reproduce.

<pre>
Environment:
Redmine version 3.2.1.stable
Ruby version 1.9.3-p551 (2014-11-13) [x86_64-linux]
Rails version 4.2.5.2
Environment production
Database adapter SQLite
SCM:
Subversion 1.6.11
Darcs 2.2.0
Mercurial 2.8.2
Cvs 1.12.13
Bazaar 2.1.1
Git 1.7.1
Filesystem
Redmine plugins:
no plugin installed
</pre>

You would better ask https://github.com/rails-sqlserver .
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
I solved by adding characters N on SQL LIKE statement.

<pre><code class="ruby">
# Returns a SQL LIKE statement with wildcards
def sql_contains(db_field, value, match=true)
if ActiveRecord::Base.connection.adapter_name == "SQLServer"
value = "N'%#{self.class.connection.quote_string(value.to_s)}%'"
else
value = "'%#{self.class.connection.quote_string(value.to_s)}%'"
end
Redmine::Database.like(db_field, value, :match => match)
end
</code></pre>
thanks.
--------------------------------------------------------------------------------
http://stackoverflow.com/questions/10025032/what-is-the-meaning-of-the-prefix-n-in-t-sql-statements
--------------------------------------------------------------------------------

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

Admin Redmine さんが約4年前に更新

  • カテゴリIssues filter_56 にセット
  • 対象バージョン3.3.0_110 にセット

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

いいね!0
いいね!0