Bug #4932 Sql result causes slow down of MQB and repeatedly prints warnings to stderr
Submitted: 6 Aug 2004 14:29 Modified: 24 May 2006 2:34
Reporter: Ronan O'Connor Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Query Browser Severity:S1 (Critical)
Version:1.0.5 OS:Linux (Fedora Core 2)
Assigned to: Alfredo Kojima CPU Architecture:Any

[6 Aug 2004 14:29] Ronan O'Connor
Description:
Upon completion of "Select * from table" (which returns about 19000 rows), mysql-query browser [MQB] starts printing: 

** (mysql-query-browser:5615): WARNING **: Invalid UTF8 string passed to pango_layout_set_text()

To stderr/stdout, about one warning per second. The MQB now becomes very slow to carry out actions/ redraw screen.

I've also received same message but with different number after mysql-query-browser:

** (mysql-query-browser:5641): WARNING **: Invalid UTF8 string passed to pango_layout_set_text()

How to repeat:
Execute a "Select * from table" (maybe on table with large number of rows? or some data in table has strange char encoding?).
[12 Aug 2004 19:39] Jorge del Conde
Hi Ronan,

Can you please provide us with the output of 

SHOW CREATE TABLE [table_name] ?

Thanks !
[13 Aug 2004 7:14] Alfredo Kojima
This is caused by the tree view from Gtk. It was optimized in gtk 2.4 (although I'm not sure how much), so it might get better once we switch to it. Meanwhile, please use means to limit your query resultset sizes (with limit "offset, count", for example). 
As for the warning messages, they are usually caused by characters in a strange encoding. Can you please attach one of the rows that causes the warnings?
[13 Aug 2004 16:22] Ronan O'Connor
I think I've tracked down the problem to accented characters. More specifically accented characters entered from a windows machine.
E.G.
From the windows2000 charmap program use
character á [latin small letter A with acute], U+00E1.  

If I enter the following text via the windows MQB (mysql-query-browser) or the windows MySQL control center 0.9.4:
this is the windows xáx character

This displays ok in windows MySQL control center 0.9.4.
The windows MQB (mysql-query-browser:) displays an empty field.
The mysql command line client on linux displays as:
this is the windows x x character
Using the MySQL CC on linux displays:
this is the windows x<2 dashed boxes>x character
The MQB on linux displays:
this is the windows x
And starts spewing out error messages to stdout/stderr.

If I enter the same text but from Linux MysqlCC (taking accented char from  Fedora's character map program):
The same text displays fine on linux with MQB (and no stderr messages), MySQLCC, and command line client.
It also displays fine on the MQB for windows,
but accented char is displayed as:
Ãj [latin capital letter A with tilde, followed by letter j]
on MySQLCC.

Have fun :)
[19 Aug 2004 23:24] Alfredo Kojima
What is the encoding of the table with the problem you mention?
MQB uses UTF8 so when it sees latin-1 characters in the table it would convert them to UTF-8, unless it can't recognize the table character set. MySQLCC probably uses latin-1, so it can display your text but can't display the UTF-8 version of it (that you inserted with the charmap program).
[20 Aug 2004 13:07] Ronan O'Connor
> What is the encoding of the table with the problem you mention?

Sorry, not quite sure what you mean. How can I check encoding of table?

I'll go through a basic example and maybe this will help....

Using the MQB1.0.5 on FC2:

CREATE TABLE `basic` (
  `id` int(11) NOT NULL auto_increment,
  `text` text NOT NULL,
  PRIMARY KEY  (`id`)
) TYPE=MyISAM; 

On Win2K using MQB1.0.5 enter:
INSERT INTO basic VALUES('\N', 'Win2K MQB1.0.5 ->á<- [Alt Gr + \' + a]');

As text indicates, I've entered the accented char, holding "Alt Gr" then pressing char ' and then pressing char a.
-----
Viewing (SELECT * FROM basic;) on MQB1.0.5 on Win2k displays (pipe seperates fields):
1 |

In other words the "text" field seems to be blank.
-----
Viewing (SELECT * FROM basic;) on MQB on FC2 displays (pipe separates fields):
1 | Win2K MQB1.0.5 ->
 
Notice cutoff of text. This then starts off the errors to stderr:
** (mysql-query-browser:3910): WARNING **: Invalid UTF8 string passed to pango_layout_set_text()
-----
From a command line client on FC2 (version 5.0.0-alpha) connecting to the database (version 4.0.12-log) gives:
mysql> SELECT * FROM basic;
+----+---------------------------------------+
| id | text                                  |
+----+---------------------------------------+
|  1 | Win2K MQB1.0.5 ->&#65533;<- [Alt Gr + ' + a] |
+----+---------------------------------------+

On the command line client I only see a blank space between the -> <-. Copying and pasting to this browser window, shows up a black box (I assume some char that isn't liked) instead of the blank space.

I had a look in the MySQL manual, section 5.8.1 :
"By default, MySQL uses the ISO-8859-1 (Latin1) character set...." 
I don't know very much about char encoding but could this be conflicting with the MQB using UTF8?
[24 May 2006 2:34] Alfredo Kojima
Noticed the server version being used is 4.0, which does not have the character set support needed by Query Browser to properly handle that. Otherwise, QB should receive text data as UTF8 from the server. QB also does not directly display BLOB data anymore, which would cause similar effects (slow down and millions of warnings), having now a separate blob viewer.
Therefore, I'll mark this as Won't fix (because this will probably continue happening with 4.0 servers). If you disagreee, please reopen and inform version of QB, version of MySQL server used and attach a small dump that causes the bug.