[MDEV-29719] Bad transfer string during exec remote sql command Created: 2022-10-06 Updated: 2022-11-07 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Character Sets, Storage Engine - Connect |
| Affects Version/s: | 10.5.15 |
| Fix Version/s: | 10.5 |
| Type: | Bug | Priority: | Major |
| Reporter: | Jaroslav Zeman | Assignee: | Andrew Hutchings |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | CONNECT, character-set | ||
| Description |
|
Hi This is my SW: Debian GNU/Linux 11 (bullseye) installed ODBC Driver 17 for SQL Server (libmsodbcsql-17.10.so.1.1) and installed sql server 10.5.15-MariaDB and Microsoft SQL Server 2019 (RTM-CU16) (KB5011644) - 15.0.4223.1 (X64) (64-bit). On MariaDB I have created table (according to the manual):
And in MS SQL I have:
If run those:
In the table Test in MS SQL string 'šččřžýýá' is stored as 'Å¡Ä Ä Å Å¾Ã½Ã½Ã¡'. How to set the character set encoding so that the string is transferred correctly? Inserting data direct into tables mapped to MariaDB via engine connect is correct. However, I need to pass a parameter to the procedure. Isn't it a problem that the data is stored with a different order of BE and LE bytes in both systems? Or just when passing data to ODBC, ODBC evaluates the data as being in a different encoding? Thanks for any idea how to fix this Jaroslav |
| Comments |
| Comment by Marko Mäkelä [ 2022-10-06 ] | |||||||||
|
jaroslav.zeman13@post.cz, what would the following return?
If it returns 'š', your connection to the MariaDB Server is configured incorrectly: the server thinks that you are using latin1. SET NAMES utf8 or something similar should help. The correct answer would be 'Å¡'. If you are getting that, then something is wrong between the Connect storage engine and MS SQL. | |||||||||
| Comment by Jaroslav Zeman [ 2022-10-06 ] | |||||||||
|
Hi, I do not have problem with coding data in MariaDB, there is all correct. I am usig default coding UTF8 and
I get, correct 'š'. But problem is, if send `š` as parameter function to MS SQL sever over table ExterCommand. Jaroslav | |||||||||
| Comment by Marko Mäkelä [ 2022-10-06 ] | |||||||||
|
Thank you for the clarification. I only wanted to rule out the obvious. | |||||||||
| Comment by Jaroslav Zeman [ 2022-10-06 ] | |||||||||
|
OK, the ExternCommand table returns what was sent to the remote server and the characters are displayed correctly here (in MariaDB). i.e. displayed locally 'šččřžýýá'. | |||||||||
| Comment by Jaroslav Zeman [ 2022-10-06 ] | |||||||||
|
And there is no problem in this?
| |||||||||
| Comment by Marko Mäkelä [ 2022-10-07 ] | |||||||||
|
| |||||||||
| Comment by Jaroslav Zeman [ 2022-10-09 ] | |||||||||
|
Using utf16le doesn't solve anything, I just pointed out that the data is probably stored in a different way by the SQL server. |