Vote #81284
未完了SQL Error with UTF8 character greater or equals
0%
説明
I am currently getting a fatal error using this character (greater or equals) editing a wiki page
≥
https://fr.wiktionary.org/wiki/%E2%89%A5
Error
app/models/wiki_page.rb:249:in `block in save_with_content' app/models/wiki_page.rb:245:in `save_with_content' app/controllers/wiki_controller.rb:180:in `update' lib/redmine/sudo_mode.rb:65:in `sudo_mode' Started PUT "/projects/site-web/wiki/Breakpoints" for 92.167.55.166 at 2021-02-26 17:46:08 +0000 Processing by WikiController#update as HTML Parameters: {"utf8"=>"<9C><93>", "authenticity_token"=>"XXX", "content"=>{"version"=>"1", "text"=>"h1. Breakpoints\r\n\r\nNous utilisons bootstrap 5 avec ses breakpoints officiels\r\n\r\nhttps://getbootstrap.com/docs/5.0/layout/breakpoints/\r\n\r\n|_.Breakpoint|_.Class infix|_.Dimensions|_.Appareil|\r\n|X-Small|None|<576px|Mobile|\r\n|Small|sm| <89> 576px|Mobile|\r\n|Medium|md| <89> 768px|Mobile|\r\n|Large|lg| <89> 992px|Ordinateur|\r\n|Extra large|xl| <89> 1200px|Ordinateur|\r\n|Extra extra large|xxl| <89> 1400px|Ordinateur|\r\n", "comments"=>""}, "wiki_page"=>{"parent_id"=>"25"}, "commit"=>"Sauvegarder", "project_id"=>"site-web", "id"=>"Breakpoints"} Current user: Me (id=1) Completed 500 Internal Server Error in 257ms (ActiveRecord: 249.6ms) ActiveRecord::StatementInvalid (Mysql2::Error: Incorrect string value: '\xE2\x89\xA5576...' for column `redmine`.`wiki_contents`.`text` at row 1: INSERT INTO `wiki_contents` (`page_id`, `author_id`, `text`, `updated_on`, `version`) VALUES (27, 1, 'h1. Breakpoints\r\n\r\nNous utilisons bootstrap 5 avec ses breakpoints officiels\r\n\r\nhttps://getbootstrap.com/docs/5.0/layout/breakpoints/\r\n\r\n|_.Breakpoint|_.Class infix|_.Dimensions|_.Appareil|\r\n|X-Small|None|<576px|Mobile|\r\n|Small|sm| <89> 576px|Mobile|\r\n|Medium|md| <89> 768px|Mobile|\r\n|Large|lg| <89> 992px|Ordinateur|\r\n|Extra large|xl| <89> 1200px|Ordinateur|\r\n|Extra extra large|xxl| <89> 1400px|Ordinateur|\r\n', '2021-02-26 17:46:08', 1)):
Here is my redmine's environment
Environment: Redmine version 4.1.1.stable Ruby version 2.6.3-p62 (2019-04-16) [x86_64-linux] Rails version 5.2.4.2 Environment production Database adapter Mysql2 Mailer queue ActiveJob::QueueAdapters::AsyncAdapter Mailer delivery smtp SCM: Git 2.25.1 Filesystem Redmine plugins: no plugin installed
journals
To make it work quickly, I just replaced the character by >=, this is not a problem for my usage.
--------------------------------------------------------------------------------
What kind of database encoding are you using?
You can use the following queries to retrieve this:
1. MySQL config:
<pre><code class="sql">
SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';
</code></pre>
2. Redmine database:
<pre><code class="sql">
SELECT default_character_set_name FROM information_schema.SCHEMATA WHERE schema_name = "<redmine_database_name>";
</code></pre>
--------------------------------------------------------------------------------
Please reopen with the required information.
--------------------------------------------------------------------------------
Sorry, I missed the notification email.
<pre>
MariaDB [(none)]> SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';
+--------------------------+--------------------+
| Variable_name | Value |
+--------------------------+--------------------+
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
| character_set_system | utf8 |
| collation_connection | utf8mb4_general_ci |
| collation_database | utf8mb4_general_ci |
| collation_server | utf8mb4_general_ci |
+--------------------------+--------------------+
10 rows in set (0.128 sec)
</pre>
<pre>
MariaDB [(none)]> SELECT default_character_set_name FROM information_schema.SCHEMATA WHERE schema_name = "redmine";
+----------------------------+
| default_character_set_name |
+----------------------------+
| utf8mb4 |
+----------------------------+
1 row in set (0.000 sec)
</pre>
--------------------------------------------------------------------------------