Bug #50206 ER_TOO_BIG_SELECT refers to outmoded system variable name SQL_MAX_JOIN_SIZE
Submitted: 9 Jan 2010 23:49 Modified: 15 Feb 2012 3:07
Reporter: Paul DuBois Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Errors Severity:S3 (Non-critical)
Version:5.0+ OS:Any
Assigned to: CPU Architecture:Any

[9 Jan 2010 23:49] Paul DuBois
Description:
This is a followup to Bug#32250.

ER_TOO_BIG_SELECT refers to SQL_MAX_JOIN_SIZE, which is the old name for MAX_JOIN_SIZE.

sql/share/errmsg.txt:

ER_TOO_BIG_SELECT 42000
        eng "The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay"

The message should be updated to use the preferred name, MAX_JOIN_SIZE.

Subsidiary issue, fix at your discretion: mysql --safe-updates causes a query to be sent to the server that refers to SQL_MAX_JOIN_SIZE. This could also be fixed to update the variable name to MAX_JOIN_SIZE. A reason *not* to fix this is that very old servers understand only SQL_MAX_JOIN_SIZE and not MAX_JOIN_SIZE. I suspect the risk for this is low; MAX_JOIN_SIZE is present at least as far back as MySQL 4.0.2.

How to repeat:
By inspection.

Suggested fix:
Update errmsg.txt, and possibly mysql.cc.

Also, sql/set_var.cc refers to SQL_MAX_JOIN_SIZE thus:

#ifndef TO_BE_DELETED   /* Alias for max_join_size */
static sys_var_thd_ha_rows  sys_sql_max_join_size(&vars, "sql_max_join_size",
                          &SV::max_join_size,
                          fix_max_join_size);
#endif

Therefore, presumably the intent is for this variable to go away sometime, but no action has occurred on that front. It seems to me this would be a good candidate for addition to WL#5185, to ensure that this variable goes away.
[10 Jan 2010 9:13] Valeriy Kravchuk
Thank you for the problem report.
[15 Feb 2012 3:07] Paul DuBois
Cosmetic change. No changelog entry needed.