[ODBC-18] only first half of each VARCHAR value is displayed in Excel Created: 2015-02-07  Updated: 2015-03-12  Resolved: 2015-03-12

Status: Closed
Project: MariaDB Connector/ODBC
Component/s: None
Affects Version/s: 1.0.0
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Danny Read Assignee: Lawrin Novitsky
Resolution: Fixed Votes: 0
Labels: None
Environment:

Windows 7 Professional, Service Pack 1, 64-bit OS.
(Version 6.1.7601 Service Pack 1 Build 7601)
Office Professional Plus 2013, 32-bit.


Attachments: File show_truncation.xlsx     Microsoft Word show_truncation_screenshots.docx    

 Description   

Load this in your MariaDB:
create table show_truncation (
ID INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
LOAD_TIME TIMESTAMP NOT NULL,
LABEL VARCHAR(20),
A_NUMBER DOUBLE(20,10)
);

insert into show_truncation (LABEL, A_NUMBER) VALUES ('ABCDEFGHIJKLMNO', 1234567890.0987654321), ('Z',9.87), ('YX',55555.55555), ('PQRS',1234);

Use ‘Microsoft ODBC Administrator’ (32-bit version: C:\Windows\SysWOW64\odbcad32.exe) to create a DSN for your MariaDB database. Leave all the option checkboxes blank/unchecked.
In a new Excel file, select cell A1, then click Data->From Other Sources -> From Data Connection Wizard
Select “ODBC DSN”, click Next
Select the ODBC Source you just created, click Next.
Select the table “show_truncation”, click Next
Click Finish in the “Save Data Connection File and Finish” dialog.
Click OK to insert the data into a cell of the spreadsheet.
Notice the values in column C (“LABEL”) are truncated:
• the “ABCDEFGHIJKLMNO” value only shows ABCDEFG
• the Z is completely missing
• YX shows only Y
• PQRS shows only PQ.
The ID, LOAD_TIME and A_NUMBER are OK.

(screen shot and .xlsx file are attached below)

More Info: Strangely, this additional sequence of steps shows the full values are being sent from the database.
In Excel, select the “Design” tab (if not already there).
Click the down-arrow below “Refresh” (in “External Table Data” section of the ribbon), select “Connection Properties”.
Click on the Definition tab.
Click “Edit Query…”
When the warning dialog appears (“This query cannot be edited by the Query Wizard”), click OK.
‘Microsoft Query” window appears, and shows the full values in the label column!



 Comments   
Comment by Lawrin Novitsky [ 2015-03-12 ]

I tried to reproduce the problem with current trunk version(master branch in the git repository), and values showed up not truncated. So, I hope the bug has been fixed by some other issue patch. I have couple of suspects. I am closing the bug for now.

Comment by Lawrin Novitsky [ 2015-03-12 ]

Danny, I can provide binaries if you need/want them to verify the bug is really fixed.

Comment by Danny Read [ 2015-03-12 ]

Yes, please (or are they already available in one of the regular builds?)

Generated at Thu Feb 08 03:25:38 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.