Bug #19276 MyxStatementParser.cpp:276: warning: comparison is always false ...
Submitted: 22 Apr 2006 14:38 Modified: 26 Apr 2006 15:44
Reporter: John Yodsnukis (Basic Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Preview Severity:S2 (Serious)
Version:1.0.6beta svn revision 1275 OS:Linux (Linux (Gentoo on PPC))
Assigned to: Alfredo Kojima CPU Architecture:Any

[22 Apr 2006 14:38] John Yodsnukis
Description:
MyxStatementParser.cpp: In member function `void MyxStatementParser::process(std::istream&, int (*)(const char*, void*), void*, int)':
MyxStatementParser.cpp:276: warning: comparison is always false due to limited range of data type
MyxStatementParser.cpp:301:2: warning: no newline at end of file

How to repeat:
compile from svn.

Suggested fix:
--- mysql-gui-common/library_sql_parser/source/MyxStatementParser.cpp	(revision 1235)
+++ mysql-gui-common/library_sql_parser/source/MyxStatementParser.cpp	(working copy)
@@ -273,7 +273,7 @@
 
   if(!(mode & MYX_SPM_DELIMS_REQUIRED) && (stmt_buffer.length() > 0))
   {
-    if(stmt_buffer[stmt_buffer.length() - 1] == -1) 
+    if(stmt_buffer[stmt_buffer.length() - 1] == (char) -1) 
     {
       stmt_buffer.erase(stmt_buffer.length() - 1);
     }
[26 Apr 2006 15:44] Alfredo Kojima
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