Bug #90745 sqlide-history parser fails to parse entries with some html encodings
Submitted: 4 May 2018 8:38 Modified: 4 May 2018 10:01
Reporter: Fredric Johansson Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:8.0.11, 8.0.23 OS:Any
Assigned to: CPU Architecture:Any

[4 May 2018 8:38] Fredric Johansson
Description:
History entries with certain html encodings like ä , í and á fails to parse with the XML parser in workbench 8.0.11. I don't remember seeing this in the log for earlier versions like 6.3. These entries does not appear in the history

Messages from the log:
########################
10:36:08 [ERR][  XML Functions]: LibXml: Entity: line 1: 
10:36:08 [ERR][  XML Functions]: LibXml: parser 
10:36:08 [ERR][  XML Functions]: LibXml: error : 
10:36:08 [ERR][  XML Functions]: LibXml: Entity 'aring' not defined

10:36:08 [ERR][  XML Functions]: LibXml: <ENTRY timestamp='10:35:13'>INSERT INTO t (ds) VALUES('&aring;&auml;&ouml;')</EN

10:36:08 [ERR][  XML Functions]: LibXml:                                                               ^

10:36:08 [ERR][  XML Functions]: LibXml: Entity: line 1: 
10:36:08 [ERR][  XML Functions]: LibXml: parser 
10:36:08 [ERR][  XML Functions]: LibXml: error : 
10:36:08 [ERR][  XML Functions]: LibXml: Entity 'auml' not defined

10:36:08 [ERR][  XML Functions]: LibXml: <ENTRY timestamp='10:35:13'>INSERT INTO t (ds) VALUES('&aring;&auml;&ouml;')</EN

10:36:08 [ERR][  XML Functions]: LibXml:                                                                     ^

10:36:08 [ERR][  XML Functions]: LibXml: Entity: line 1: 
10:36:08 [ERR][  XML Functions]: LibXml: parser 
10:36:08 [ERR][  XML Functions]: LibXml: error : 
10:36:08 [ERR][  XML Functions]: LibXml: Entity 'ouml' not defined

10:36:08 [ERR][  XML Functions]: LibXml: <ENTRY timestamp='10:35:13'>INSERT INTO t (ds) VALUES('&aring;&auml;&ouml;')</EN

10:36:08 [ERR][  XML Functions]: LibXml:                                                                           ^

10:36:08 [ERR][ sqlide-history]: Can't parse <ENTRY timestamp='10:35:13'>INSERT INTO t (ds) VALUES('&aring;&auml;&ouml;')</ENTRY>, of file: C:\Users\fredric\AppData\Roaming\MySQL\Workbench\sql_history\2017-06-22
########################

How to repeat:
1. Insert an valid entry containing &auml; like the one above in the history. i.e. run
CREATE TEMPORARY TABLE t (
`id` INT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
`ds` VARCHAR(244)
);    
INSERT INTO t (ds) VALUES('åäö');

2. Open history for that date
[4 May 2018 9:33] Chiranjeevi Battula
Hello Fredric,

Thank you for the bug report.
I could not repeat the issue at our end using with MySQL workbench 8.0.11 version.
Could you please provide repeatable steps (exact steps, screenshot, provide full MySQL Workbench Log file etc. - please make it as private if you prefer) to confirm this issue at our end?

Thanks,
Chiranjeevi.
[4 May 2018 9:50] Fredric Johansson
The action output after running the queries

Attachment: actionoutput.PNG (image/png, text), 10.56 KiB.

[4 May 2018 9:51] Fredric Johansson
The history output after running the query

Attachment: historyoutput.PNG (image/png, text), 7.45 KiB.

[4 May 2018 9:53] Fredric Johansson
The history file causing this

Attachment: 2018-05-04 (application/octet-stream, text), 338 bytes.

[4 May 2018 10:01] Chiranjeevi Battula
Hello Fredric,

Thank you for the feedback.
Verified this behavior on MySQL Workbench in 8.0.11 version.

Thanks,
Chiranjeevi.
[30 Mar 2021 13:19] MySQL Verification Team
Bug #103131 marked as duplicate of this one.
[30 Mar 2021 13:20] MySQL Verification Team
Bug #103132 marked as duplicate of this one.
[12 Dec 2023 9:42] Terje Rosenlund
Version 8.0.34 on Windows 10 

In my case there is norwegian characters in table names

The log file contains many html-entity characters and usually has no problem interpreting them. Surely that indicates more of an error in the part of the code that interprets than an error in what is interpreted?

The problem occures if workbench has been open for a long period, i.e. over night

09:32:41 [ERR][ sqlide-history]: Can't parse <ENTRY timestamp='~'>INSERT INTO utl&aring;n (Utl&aring;nsNr, LNr, ISBN, EksNr, Utl&aring;nsDato, Levert)&#x0A;  VALUES(1, 8, 801424, 2, '2023-01-12', 1),&#x0A;		(2, 6, 814516, 1, '2023-01-12', 0),&#x0A;		(3, 5, 814000, 3, '2023-01-12', 1),&#x0A;		(4, 3, 803855, 2, '2023-01-12', 0),&#x0A;		(5, 4, 800644, 1, '2023-01-12', 1),&#x0A;		(6, 6, 807389, 2, '2023-01-12', 0),&#x0A;		(7, 5, 803948, 3, '2023-01-12', 1),&#x0A;		(8, 3, 804463, 2, '2023-01-12', 0),&#x0A;		(9, 4, 803453, 3, '2023-01-12', 1)</ENTRY>, of file: C:\Users\....\AppData\Roaming\MySQL\Workbench\sql_history\2023-04-09
[12 Dec 2023 12:43] Terje Rosenlund
The fact that MysqlWorkbench is crashing after beeing open for a long period (ie. over night) makes it reasonabily to suspect a memory leak

Python modules seems to be responsible for encoding/decoding of character sets (ref. .\python\lib\encodings)

A memory leak in a C++ module is more likely to have been found than a memory leak in a python module considering the automatic garbage collector and implicit automatic references in python

Is there a good ide to check the python modules with a memory profiler in regards to this problem?