Bug #29973 mysql.cc:2366: error: 'max' was not declared in this scope
Submitted: 23 Jul 2007 8:34 Modified: 23 Jul 2007 11:29
Reporter: littlestar a Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:5.1.21 OS:Linux
Assigned to: CPU Architecture:Any
Tags: gcc 4.2.1

[23 Jul 2007 8:34] littlestar a
Description:
gcc 4.2.1 32bit/64bit.

mysql.cc: In function 'void print_table_data(MYSQL_RES*)':
mysql.cc:2366: error: 'max' was not declared in this scope
mysql.cc:2368: error: 'max' was not declared in this scope
mysql.cc:2389: error: 'min' was not declared in this scope
make[3]: *** [mysql.o] Error 1
make[3]: Leaving directory `/home/xf/mysql-5.1.20/client'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/xf/mysql-5.1.20/client'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/xf/mysql-5.1.20'
make: *** [all] Error 2

How to repeat:
get gcc 4.2.1, build it.

and then build the latest mysql from svn.
[23 Jul 2007 9:24] Sveta Smirnova
Thank you for the report.

Please provide step-by-step actions of how you build MySQL. I mean how you invoke Autotools and configure.
[23 Jul 2007 9:30] littlestar a
1.download gcc-4.2.1, build it with default option.
2.get lastest mysql source from bkf.
3.run ./BUILD/compile-pentium-debug

I can build it ok with gcc-4.1.2.
I only upgrade GCC from gcc-4.1.2 to gcc-4.2.1.
[23 Jul 2007 11:29] Sergei Golubchik
a duplicate of bug#28184