Bug #87555 Wrong data retrieved
Submitted: 28 Aug 2017 2:35 Modified: 5 Sep 2017 14:11
Reporter: Igor Korot Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S1 (Critical)
Version:5.6.35 OS:Any
Assigned to: CPU Architecture:Any

[28 Aug 2017 2:35] Igor Korot
Description:
Hi,
I have a following situation.
I own 2 laptops - one with Windows 8.1 and the extended keyboard (numeric keypad) and second one with Linux and no extended keyboard. As Linux I'm using Gentoo and I have mysql server 5.6.35 installed.
On Windows I created a following script:

CREATE TABLE abcß(id int, name varchar(100));

I used "ALT+225" for the "ß" symbol. (On Windows it represented by the greek letter "beta"). I used an extended keyboard to enter "225".

Next I transfer this script to Linux, loaded into mySQL Workbench ver 6.3.4 and executed the script.

The table was successfully created.

Next to make sure that the table is successfully created I executed following query:

SELECT t.table_catalog AS catalog, t.table_schema, t.table_name FROM information_schema.tables t WHERE t.table_type = 'BASE TABLE' OR t.table_type = 'VIEW';";

What I did see in the result from the Workbench is that this table was not showing "abcß".

Next I tried to run the same query from Windows Workbench. I got the same results. There is no "abcß" in that list.

I actually found this during debugging following code:

[code]
std::wstring_convert<std::codecvt_utf8<wchar_t> > m_myconv;
MYSQL_ROW row;
while( ( row = mysql_fetch_row( results ) ) != NULL )
{
    char *end;
    char *catalog_name = row[0] ? row[0] : NULL;
    char *schema_name = row[1] ? row[1] : NULL;
    char *table_name = row[2] ? row[2] : NULL;                                                                                           std::wstring tableName = m_pimpl->m_myconv.from_bytes( (const char *) table_name );
[/code]

which crashed the program when I ran it on Windows.

How to repeat:
Steps are in the description.

Thank you for looking into this.
[28 Aug 2017 2:41] Igor Korot
Query results

Attachment: Capture.PNG (image/png, text), 28.68 KiB.

[5 Sep 2017 6:25] MySQL Verification Team
Hello Igor Korot,

Thank you for the report.
I tried to reproduce your issue on many hosts with diff OS but still not seeing the issue. Discussed with WB developer, concluded that you have to upgrade workbench to the latest available GA since you are trying with 6.3.4 and many bugs were fixed since then. Upgrade WB to 6.3.9, then please confirm if you are seeing the issue when using upgraded WB, and also confirm the output from mysql command prompt on what exactly you are seeing. 
I suspect that you are using latin charset instead of utf8* etc

If you can provide more information, feel free to add it to this bug and change the status back to 'Open'.

Thank you for your interest in MySQL.

Thanks,
Umesh
[5 Sep 2017 14:11] Igor Korot
Hi, Umesh,
Attached please find the screenshot of the MySQL Workbench I used on Windows to verify the symbol and produce the screenshot of the previous submission.
Also I will attach the complete script I used to create a database.
Or you are saying I should run the script with the latest WB?
Like I said - the script was made on Windows, then sent to Linux machine and executed inside WB.
In terms of charset - how do I verify that? I didn't change any settings of the server other than allow remote connection. So it should be running with UTF8.
However, since the script was made on Windows I belive it is using UTF-16, right?

Thank you.
[5 Sep 2017 14:11] Igor Korot
mySQL WB version

Attachment: WB version.png (image/png, text), 148.60 KiB.