MAX_JOIN_SIZE = value | DEFAULT 
Don't allow SELECTs that will probably need to examine more than value row combinations or is likely to do more than value disk seeks. By setting this value, you can catch SELECTs where keys are not used properly and that would probably take a long time. Setting this to a value other than DEFAULT will reset the SQL_BIG_SELECTS flag. If you set the SQL_BIG_SELECTS flag again, the SQL_MAX_JOIN_SIZE variable will be ignored. You can set a default value for this variable by starting mysqld with -O max_join_size=#. This option was before named SQL_MAX_JOIN_SIZE. Note that if the result of the query is already in the query cache, the above check will not be made. Instead, MySQL will send the result to the client. Since the query result is already computed and it will not burden the server to send the result to the client. SQL_BIG_SELECTS = 0 | 1 
If set to 0, MySQL will abort if a SELECT is attempted that probably will take a very long time, which is defined as if the number of examined rows is probably going to be bigger than MAX_JOIN_SIZE. This is useful when an inadvisable WHERE statement has been issued. A big query is defined as a SELECT that probably will have to examine more than max_join_size rows. The default value for a new connection is 1 (which will allow all SELECT statements). If you set MAX_JOIN_SIZE to another value than DEFAULT SQL_BIG_SELECTS will be set to 0. 
max_join_size 
The automatic limit for rows in a join when using --safe-updates. (Default value is 1,000,000.) 

解决方案 »

  1.   

    我设置了max_join_size=1073741824还是出错啊
      

  2.   

    SQL_BIG_SELECTS = 0 | 1 
    The default value for a new connection is 1 (which will allow all SELECT statements).
    If you set MAX_JOIN_SIZE to another value than DEFAULT SQL_BIG_SELECTS will be set to 0. 我没有遇到过这种情况,我觉得按照文档,你如果改了值的话,应该在获取连接的时候设置
    set SQL_BIG_SELECTS = 0
      

  3.   

    哦,应该设置成1
    set SQL_BIG_SELECTS = 1
      

  4.   

    不在配置文件中写,到运行SQL语句的时候在设置看行不行
      

  5.   

    mysql是最新版本吗??如果最新版本也有问题就没办法了。
      

  6.   

    换个JDBC试试,如果仍有问题建议重装MySQL.