[MDEV-11029] connect engine odbc type table Simplified Chinese display error Created: 2016-10-11 Updated: 2020-11-06 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Character Sets, Storage Engine - Connect |
| Affects Version/s: | 10.1.18 |
| Fix Version/s: | 10.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | SmileJi | Assignee: | Olivier Bertrand |
| Resolution: | Unresolved | Votes: | 2 |
| Labels: | connect-engine | ||
| Environment: |
centeos 6 |
||
| Description |
|
Mariadb connect engine odbc type table,connecting oracle database,Simplified Chinese display error. Replication method:
oracle:
mariadb:
Chinese is not the first line should not appear as '?'.
jdbc table display is normal. |
| Comments |
| Comment by SmileJi [ 2016-10-12 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
See that you have changed to fix, in which fixed in version 10.1? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by SmileJi [ 2016-10-12 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
My test version is mariadb 10.1.18. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Olivier Bertrand [ 2016-10-13 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Not fixed yet. I just begin to work on it but the issue is that I cannot create the table on my machine not have the proper code page. In the Oracle shell, when I paste your:
It is pasted as:
Even the character 呵 show on my screen, it is not really usable. What seems strange is that the JDBC table retrieves the good row while nothing indicates using utf8 in its creation. I think that this is due to the JDBC process itself. JDBC probably works in UNICODE, generally coded in some utf8 and does the decode by itself. ODBC does not and use latin1 by default. See the Oracle documentation about the DSN parameters, there is a charset parameter that possibly could solve your problem. Please let me know if that works. Thanks. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Olivier Bertrand [ 2016-10-13 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hummm... I think the information a got on the Internet about DSN parameters was for the MySQL connector. About Oracle I did not found it. The problem is that if ODBC returns '?' characters instead of the good one, CONNECT cannot do anything about it. So if the Oracle ODBC driver cannot take in charge the utf8 charset, the only solution seems to use JDBC instead of ODBC. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by SmileJi [ 2016-10-14 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The character set used in my oracle database is AMERICAN_AMERICA.AL32UTF8,When you create a Oracle database, you need to use the AL32UTF8 character set. I use the Oracle documentation to connect to the Oracle is ok.MariaDB Connect engine ‘s odbc and the implementation of the document is not the same way.Oracle link :http://docs.oracle.com/database/121/ADFNS/adfns_odbc.htm#ADFNS1216 I did not see the parameters of DSN in the Oracle document, you can send a link? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by SmileJi [ 2016-10-14 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I also tested the JDBC table, JDBC type big table is very easy to cause the database crash.
This is why?
The table size for ARC_E_MP_PARA_SNAP in oracle database is : 2G | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Olivier Bertrand [ 2016-10-14 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There are many entries on the Internet about using utf8 with Oracle ODBC. Most of them from people using PHP. But I did not find the exact description of the parameters to use with the data source definition. About the JDBC crash, I tried to connect to the big table but it failed: (1105) Connecting:java.sql.SQLRecoverableException: I/O Error: The Network Adapter could not establish the connection rc=-2 Looking in the crash report, the last command sent to JDBC by CONNECT is:
After apparently successfully retrieved a column value. Then the crash occurs in JVM code. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Olivier Bertrand [ 2016-10-15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I could not make the Oracle table with chinese character but I made a CONNECT CSV table based on a file manually made containing the utf8 representation of that character:
The CONNECT table is:
And when executing:
I get the expected display:
Now I can address this table via JDBC by:
and get the same display result. Note that I must specify this table with "default charset=utf8" Now with ODBC:
Returns:
Note that using the MYSQL-Unicode driver does not work either.
This one returns
This shows that this problem is not with CONNECT but with ODBC. I found what to do | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Olivier Bertrand [ 2016-10-15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
On Windows, the ODBC data sources administrator window displays all the available data sources and permit the user to configure them. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2017-10-24 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
One needs to use the DATA_CHARSET option to specify character set of the data in the remote table. Oracle:
MariaDB:
|