Bug #5273 Save Query - file truncated, format changed, won't re-load
Submitted: 28 Aug 2004 1:21 Modified: 8 Oct 2004 18:41
Reporter: Neil Jackson Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S1 (Critical)
Version:1.06-alpha OS:Windows (WinXP Pro SP1)
Assigned to: Michael G. Zinner CPU Architecture:Any

[28 Aug 2004 1:21] Neil Jackson
Description:
Save Query feature of MQB appears to have changed since 1.05-alpha:

1. Files are being randomly truncated on save.

2. They appear to now be being saved in double-byte charset format instead of 8-bit ASCII.

3. They also don't appear to re-load, once saved - you'll just see the first character of the query in the SQL window.

4. The default offered save filetype has changed from '.sql' to '.qbquery' - which is surely unusual for a Windows 3-letter file-extension 'standard' (though probably legal).

5. In any case, regardless of file-extension chosen, the saved file does not get saved with that extension.

How to repeat:
1 & 2. Just save the current query, and open it up in Notepad or any text editor (Ultraedit reveals the double-byte charset quite clearly, either will show the truncation).

3. Re-load the same file back in - you'll see one character only (usually the 'S' of 'SELECT' and no more).

4 & 5. - examine the saved file in Windows Explorer - there'll be no suffix, whatever you chose.

Suggested fix:
Has this been inadvertently compiled with the Unix file-output libraries, maybe?

Preferably, I'd like to see the query get saved as a 'normal' 8-bit ASCII representation of the SQL query, so that the file can be used in more things than just MQB (eg, for easy incorporation into an app, later), ideally with a file suffix '.sql'.

(Love the MySql CLI window which appeared in 1.06a, guys - perfectly timed - keep up the excellent work - you are doing one FINE job :) )
[28 Aug 2004 1:44] Neil Jackson
This bug may need to be upgraded to Critical/Fatal...

I switched to a query in another tabsheet (leaving the truncated one which showed just 'S' from the attempted re-load mentioned earlier). When I switched back to the truncated query window, I got an endless loop of modal dialog boxes entitled MySQL Query Browser Error with a message about List Index (1) missing (or something like that. Alas, although I took a screenshot, the error text is missing - only the dialog and its title is visible in them).

The program had to be quit with Task Manager before it consumed all the resources - the popups were appearing at a rate impossible to even think about closing fast enough to reach the main window to close that.

Unfortunately, I have not yet been able to reproduce this fault again (yet).
[31 Aug 2004 7:29] MySQL Verification Team
Thank you for the bug report.
[1 Sep 2004 21:43] Neil Jackson
still evident in 1.07 beta, I'm afraid.

The query:

SELECT f.id, f.syslogtime, p.syslogpriority, f.ix66time, i.ix66interface,
f.ix66srcIP, f.ix66destIP, f.ix66pktbytes, f.ix66proto, f.ix66tcpflagsU, f.ix66tcpflagsA,
f.ix66tcpflagsP, f.ix66tcpflagsR, f.ix66tcpflagsS, f.ix66tcpflagsF, f.ix66srcport,
f.ix66destport, f.ix66segbytes, f.ix66protomsg, m.ix66fwmsg1, f.ix66fwmsg2, f.ix66fwmsg3
FROM ix66.firewall as f
inner join ix66.syslog_priority_types as p
on f.syslogpriorityid = p.id
inner join ix66.ix66_interface_types as i
on f.ix66interfaceid = i.id
INNER JOIN ix66.ix66_fwmsg1_types AS m
ON f.ix66fwmsg1id = m.id
where f.ix66proto <> 'tcp' and f.ix66proto <> 'udp' and f.ix66proto <> 'gre' and f.ix66proto <> 'icmp'
LIMIT 1000;

when saved out using Save As (the only option that seemed to be available), and using the default 'qdbeury' option, gave me this, in the output file:

S E L E C T   f . i d ,   f . s y s l o g t i m e ,   p . s y s l o g p r i o r i t y ,   f . i x 6 6 t i m e ,   i . i x 6 6 i n t e r f a c e , 
 
 f . i x 6 6 s r c I P ,   f . i x 6 6 d e s t I P ,   f . i x 6 6 p k t b y t e s ,   f . i x 6 6 p r o t o ,   f . i x 6 6 t c p f l a g s U ,   f . i x 6 6 t c p f l a g s A , 
 
 f . i x 6 6 t c p f l a g s P ,   f . i x 6 6 t c p f l a g s R ,   f . i x 6 6 t c p f l a g s S ,   f . i x 6 6 t c p f l a g s F ,   f . i x 6 6 s r c p o r t , 
 
 f . i x 6 6 d e s t p o r t ,   f . i x 6 6 s e g b y t e s ,   f . i x 6 6 p r o t o m s g ,   m . i x 6 6 f w m s g 1 ,   f . i x 6 6 f w m s g 2 ,   f . i x 6 6 f w m s g 3 
 
 F R O M   i x 

As you can see, it's truncated still, and is unicode/double-byte ASCII.

Other issues still evident: 

2. Despite offering '.qdbuery' as the default save file-suffix, the program doesn't append that suffix automatically, if you don't type it in.

3. There's still no visible means of saving out a 'normal' ASCII file of the current query so that it can be used in things other than just MQB. This used to exist, but has gone... please bring it back (begs on bended knee) :-)

Thanks,
[8 Oct 2004 18:41] Michael G. Zinner
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html