[Asterisk-code-review] func_odbc: acf_odbc_read() and cli_odbc_read() unicode support (...asterisk[master])

Boris P. Korzun asteriskteam at digium.com
Sat Sep 14 07:11:40 CDT 2019


Boris P. Korzun has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/12812 )

Change subject: func_odbc:  acf_odbc_read() and cli_odbc_read() unicode support
......................................................................


Patch Set 5:

> Patch Set 4:
> 
> > Patch Set 4:
> > 
> > > Patch Set 4:
> > > 
> > > I just did a test with MySQL.
> > > 
> > > CREATE TABLE test_utf8 (
> > >     test_fld varchar(200)
> > > ) DEFAULT CHARACTER SET utf8
> > >   DEFAULT COLLATE utf8_general_ci;
> > > 
> > > CREATE TABLE test_utf16 (
> > >     test_fld varchar(200)
> > > ) DEFAULT CHARACTER SET utf16
> > >   DEFAULT COLLATE utf16_general_ci;
> > > 
> > > The SQLDescribeCol returns collen=200 for both tables.
> > > SQLColAttribute with SQL_DESC_OCTET_LENGTH returns
> > > test_utf8  - 600
> > > test_utf16 - 800
> > 
> > It's OK for MySQL (that can store the data in various encodings). But MS SQL (prior 2019) can store Unicode data (NCHAR/NVARCHAR/NTEXT types) in UTF-16 only.
> 
> My point is that the ODBC driver should correctly return SQL_DESC_OCTET_LENGTH.
> If it's not that the issue either with driver configuration or driver implementation.

I've reviewed FreeTDS sources and confirmed the bug. FreeTDS returns SQL_DESC_OCTET_LENGTH incorrectly. I will try to report the issue to FreeTDS team.

Also I've rewritten the patch for support SQL_DESC_OCTET_LENGTH column attribute.


-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/12812
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I50e86c8a277996f13d4a4b9b318ece0d60b279bf
Gerrit-Change-Number: 12812
Gerrit-PatchSet: 5
Gerrit-Owner: Boris P. Korzun <drtr0jan at yandex.ru>
Gerrit-Reviewer: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-Reviewer: Boris P. Korzun <drtr0jan at yandex.ru>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-CC: Sean Bright <sean.bright at gmail.com>
Gerrit-Comment-Date: Sat, 14 Sep 2019 12:11:40 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190914/ed0f424f/attachment.html>


More information about the asterisk-code-review mailing list