Bug #25183 Compiler warnings in the sql directory (GCC 4.1)
Submitted: 19 Dec 2006 17:25 Modified: 23 Jan 2007 20:45
Reporter: Marc ALFF Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:5.1 OS:
Assigned to: Marc ALFF CPU Architecture:Any
Tags: rt_q1_2007

[19 Dec 2006 17:25] Marc ALFF
Description:
GCC 4.1 reports the following warnings :

set_var.cc: In member function 'virtual bool sys_var_opt_readonly::update(THD*, set_var*)':
set_var.cc:3861: warning: 'result' may be used uninitialized in this function
filesort.cc: In function 'ha_rows filesort(THD*, TABLE*, SORT_FIELD*, uint, SQL_SELECT*, ha_rows, bool, ha_rows*)':
filesort.cc:108: warning: 'sort_keys' may be used uninitialized in this function
ha_ndbcluster.cc: In function 'void print_share(const char*, NDB_SHARE*)':
ha_ndbcluster.cc:7302: warning: format '%llu' expects type 'long long unsigned int', but argument 7 has type 'ulonglong'
sql_table.cc: In function 'bool mysql_alter_table(THD*, char*, char*, HA_CREATE_INFO*, TABLE_LIST*, List<create_field>&, List<Key>&, uint, ORDER*, bool, ALTER_INFO*, bool)':
sql_table.cc:5307: warning: 'error' may be used uninitialized in this function

In particular, the warnings in set_var.cc and sql_table.cc seems to be real bugs

How to repeat:
Build with GCC 4.1
[19 Dec 2006 22:19] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/17186

ChangeSet@1.2361, 2006-12-19 15:02:37-07:00, malff@weblab.(none) +2 -0
  Bug#25183 (Compiler warnings in the sql directory (GCC 4.1))
  Fixed compiler warnings.
  
  In set_var.cc, the code was not properly returning an error code
  if close_cached_tables() failed.
  
  In sql_tables.cc, the code was not returning properly an error code
  if lock_table_names() failed.
  
  Both cases are bugs, introduced in 5.1 only by recent changes.
[11 Jan 2007 16:05] Tomash Brechko
Reviewed by e-mail.
[23 Jan 2007 20:45] Paul DuBois
No changelog entry needed.