[MDEV-8232] CONNECT fails for NVARCHAR Created: 2015-05-26 Updated: 2023-04-27 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - Connect |
| Affects Version/s: | 10.0.17, 10.3, 10.4 |
| Fix Version/s: | 10.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Takuya Aoki (Inactive) | Assignee: | Andrew Hutchings |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | connect-engine | ||
| Environment: |
CentOS release 6.5 (X86_64), PureData Release 7.0 (P-3) , NetezzaSQL ODBCDriver |
||
| Description |
|
I am trying to make a CONNECT table to a table on an IBM database. The original table includes columns in NVARCHAR(N) for UTF-8 characters. I have two problems. 1. Error (Code 1105): Unsupported SQL type -9 It doesn't happen when the table does not have any NVARCHAR(N) columns, 2.
I found it is not a problem of the ODBC driver, queries on isql returns the UTF-8 values correctly. |
| Comments |
| Comment by Olivier Bertrand [ 2015-05-28 ] | |||
|
Indeed types NCHAR or NVARCHAR correspond to SQL_WCHAR (-8) and SQL_WVARCHAR (-9). These types were not recognized by CONNECT. It will be fixed just by handling them as CHAR and VARCHAR with a warning (NOTE) saying that the column contains wide characters. Remains the issue of UTF8 characters displayed as '?'. It looks as if the column text was translated twice. The first time, UTF8 characters are replaced by, say, latin1 characters that are not recognized the second time and replaced by '?'. Perhaps this could be avoided by setting character_set_client to latin1. Indeed the character_set_results variable only applies to MYSQL tables but does not for ODBC tables. | |||
| Comment by Olivier Bertrand [ 2015-05-30 ] | |||
|
I don't know about IBM but, according to the Oracle documentation, the NCHAR, NVARCHAR types (N for Native) are character strings supposely containing text in native character set. It seems that when writing and reading, the data source (at least Oracle) automatically does the translation between the internal coding (Unicode as UTF8 or UT16) and the native character set. | |||
| Comment by Takuya Aoki (Inactive) [ 2015-06-02 ] | |||
|
Hello Olivier, Do you mean that the table charset is for the first translation and character_set_client for the second? | |||
| Comment by Takuya Aoki (Inactive) [ 2015-06-02 ] | |||
|
Netezza seems to handle all characters in UTF8 and does not do any conversions.
| |||
| Comment by Elena Stepanova [ 2023-01-22 ] | |||
|
TheLinuxJedi, |