Bug #19345 Table column length multiplies on size session character set
| Submitted: | 25 Apr 2006 17:25 | Modified: | 3 Aug 2007 10:13 |
|---|---|---|---|
| Reporter: | Vladimir Loubenski | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | Connector / ODBC | Severity: | S2 (Serious) |
| Version: | 3.51.12 | OS: | Windows (Windows XP) |
| Assigned to: | Jim Winstead | CPU Architecture: | Any |
[25 Apr 2006 17:25]
Vladimir Loubenski
[27 Apr 2006 15:37]
Valeriy Kravchuk
According to ODBC specification (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcsqlcolumns.a...) reporter is right! COLUMN_SIZE is in characters, and it should be 10. Unlike BUFFER_LENGTH...
[27 Apr 2006 16:07]
Vladimir Loubenski
Hi Valeriy, I’d like to clarify the problem. I agree with you that COLUMN_SIZE should be in characters and result 10 is correct. Problem is if in DSN for ODBC connection I set session characterset to utf8 (On tab "Connect Option" - "Initial statement" write: SET NAMES 'utf8') I get COLUMN_SIZE 30 for the same table. Regards, Vladimir.
[27 Apr 2006 16:23]
Tonci Grgin
Please use SQLColumns functions from unicode library (A,W). It is obvious why you have 3 times bigger result with non-unicode function just by counting bytes needed for unicode...
[27 Apr 2006 16:46]
Vladimir Loubenski
Thank you Tonci for answer. I got the same result with using W function. Put attention on answer for #12894
[27 Apr 2006 17:05]
Tonci Grgin
Vladimir, can you post your test case, presumeably in C++?
[27 Apr 2006 17:24]
Vladimir Loubenski
Table t_length should be created
Attachment: mainWMySQL.cpp (text/plain), 3.36 KiB.
[2 May 2006 9:42]
Tonci Grgin
Hi, Vladimir. I don't even get connected with your code. I'll write it myself and post the findings.
[2 May 2006 10:15]
Tonci Grgin
Verified as described by reporter. Test case attached.
[2 May 2006 10:18]
Tonci Grgin
VS test file
Attachment: Testbug19345.cpp (text/plain), 4.01 KiB.
[2 May 2006 14:42]
Vladimir Loubenski
Hi Tonci, I run your test case and got the same problem: I get column length 30 on DSN which defines utf8 session character set. You need adjust connection sections in my test case to be able connect to database : SQLWCHAR * pServer = (SQLWCHAR*)L"MySQLlocal"; -> SQLWCHAR * pServer = (SQLWCHAR*)L" Your DSN"; SQLWCHAR * pUser = (SQLWCHAR*)L"rnddb6";- > SQLWCHAR * pUser = (SQLWCHAR*)L"Your user name"; SQLWCHAR * pPassword = (SQLWCHAR*)L"rnddb6"; -> SQLWCHAR * pPassword = (SQLWCHAR*)L"Your Password"; SQLWCHAR * pCatalog = (SQLWCHAR*)L"rnddb6"; -> SQLWCHAR * pCatalog = (SQLWCHAR*)L"Your Database Schema name"; SQLWCHAR * pSchema = (SQLWCHAR*)L""; //No changes SQLWCHAR * pTable = (SQLWCHAR*)L"t_length"; //No changes Thank you, Vladimir.
[19 Jul 2007 20:00]
Jim Winstead
Preliminary patch to clean up length handling, and other related bugs
Attachment: bug19345.patch (text/plain), 50.30 KiB.
[26 Jul 2007 19:51]
Jim Winstead
Complete patch to fix column lengths and related bugs
Attachment: bug19345.patch (text/plain), 61.08 KiB.
[2 Aug 2007 17:28]
Jim Winstead
The fix for this bug, and many related ones, has been committed, and will be in the 3.51.18 release. Thanks for the bug report.
[3 Aug 2007 10:13]
MC Brown
A note has been added to the 3.51.18 changelog: Obtaining the length of a column when using a character set for the connection of utf8 would result in the length being returned incorrectly.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.066 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.