gpt4 book ai didi

php - MAX_JOIN_SIZE 行; SET SQL_BIG_SELECTS=1 - 脚本在 2 年后停止工作

转载 作者:行者123 更新时间:2023-11-30 21:58:56 30 4
gpt4 key购买 nike

Exception -> string(69) "SQLSTATE[HY000]: General error: 1193 Unknown system variable 'OPTION'" Exception -> string(202) "SQLSTATE[42000]: Syntax error or
access violation: 1104 The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if
the SELECT is okay" Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1104 The SELECT
would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay' in
/customers/e/3/b/jkr.no/httpd.www/STS/amob/inc/timer.php:295 Stack trace: #0
/customers/e/3/b/jkr.no/httpd.www/STS/amob/inc/timer.php(295): unknown() #1 /customers/e/3/b/jkr.no/httpd.www/STS/amob/index.php(542):
include('/customers/e/3/...') #2 {main} thrown in /customers/e/3/b/jkr.no/httpd.www/STS/amob/inc/timer.php on line 295

这个脚本已经运行了 2 年。我在事件表中删除了 2000 多行,也许它太大了?

SQL 问题

$hsql = "SELECT h.ID, h.ukeID, h.normal, h.natt, h.FP, h.HP, h.datumID, h.status, h.orderID, 
h.tilleggID, h.yearID, u.ID as userID, u.level as ulevel,
u.navn as fnavn, u.etternavn, t.navn as tnavn, o.ID as oID, o.navn as onavn,
o.pH as opH, o.pB as opB, o.pR as opR, o.pS as opS, o.pP as opP, o.pLE as opLE
FROM timesheet h LEFT JOIN user u ON u.ID = h.userID LEFT JOIN orders o ON
o.ordernr = h.orderID LEFT JOIN tillegg t ON t.tilleggnr = h.tilleggID AND
t.orderID = o.ID".$hsql.$sstr.$yearID." ORDER BY userID ASC, yearID DESC, ukeID DESC, datumID DESC";

第 295 行

foreach($hstmt as $hrow) {

最佳答案

已切换

SET OPTION SQL_BIG_SELECTS=1

SET SESSION SQL_BIG_SELECTS=1

现在可以了!

关于php - MAX_JOIN_SIZE 行; SET SQL_BIG_SELECTS=1 - 脚本在 2 年后停止工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44096131/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com