[Bug]: max_join_size and sql_big_selects do not enforce SELECT row-examination limits
I maintainer di solito rispondono entro 1 giorno
@matrix-meow ci sta già lavorando.
Dal 26/11/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Description
Reproduced on MatrixOne main commit c0cef5c9cce2164fedd201c188bfffe4d2d09a96 (git_version() = c0cef5c) and compared with MySQL 8.0.46.
MatrixOne accepts and reads back max_join_size and sql_big_selects, but does not enforce the SELECT row-examination limit. With max_join_size=1 and sql_big_selects=0, a three-row single-table SELECT, a three-row key JOIN, and a nine-row CROSS JOIN all execute normally. MySQL rejects all three corresponding statements with Error 1104.
This is not limited to JOIN syntax: the basic single-table case also bypasses the guard. A single-table COUNT(*) also executes on MatrixOne; MySQL permits that optimized aggregate too, so the aggregate is documented below as scope information rather than as a compatibility difference.
Minimal reproduction
DROP DATABASE IF EXISTS repro_max_join_size;
CREATE DATABASE repro_max_join_size;
USE repro_max_join_size;
CREATE TABLE t(id INT PRIMARY KEY, v INT);
INSERT INTO t VALUES(1,10),(2,20),(3,30);
SET SESSION sql_big_selects=0;
SET SESSION max_join_size=1;
SELECT @@session.max_join_size, @@session.sql_big_selects;
-- 1, 0
SELECT * FROM t;
-- MatrixOne: returns all three rows
-- MySQL 8.0.46: ERROR 1104 (42000)
SELECT COUNT(*) FROM t;
-- MatrixOne: 3
-- MySQL 8.0.46: 3 (optimized aggregate; not itself a divergence)
SELECT a.id,b.v
FROM t a JOIN t b ON a.id=b.id
ORDER BY a.id;
-- MatrixOne: returns (1,10),(2,20),(3,30)
-- MySQL 8.0.46: ERROR 1104 (42000)
SELECT a.id,b.id
FROM t a CROSS JOIN t b
ORDER BY a.id,b.id;
-- MatrixOne: returns all nine rows
-- MySQL 8.0.46: ERROR 1104 (42000)
SET SESSION sql_big_selects=1;
SELECT a.id,b.v
FROM t a JOIN t b ON a.id=b.id
ORDER BY a.id;
-- control: succeeds
MySQL 8.0.46 produces the following for the single-table statement while the limit is enabled:
ERROR 1104 (42000): 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
Setting sql_big_selects=1 allows the query again, as documented.
Expected behavior
When SQL_BIG_SELECTS=OFF, MatrixOne must reject a SELECT whose estimated row examination exceeds MAX_JOIN_SIZE, using MySQL-compatible Error 1104 semantics. SQL_BIG_SELECTS=ON should bypass this particular limit. These variables must affect admission/planning rather than being writable no-ops.
MySQL documents the interaction here: https://dev.mysql.com/doc/refman/8.0/en/mysql-tips.html#safe-updates
Additional controls
- A key-JOIN restricted to one result row succeeds.
- The three-row key JOIN and nine-row CROSS JOIN both succeed immediately after
sql_big_selectsis set to1. - As a separate session-variable control,
sql_select_limit=2does limit an unqualified three-row SELECT to two rows, and an explicitLIMIT 3overrides it. Thus the result above is specific to the missingmax_join_sizeenforcement.
Duplicate check
Searched max_join_size, sql_big_selects, ER_TOO_BIG_SELECT, and the Error 1104 text in open and closed issues; no existing report of the missing admission check was found.
- Lingua principale
- Go
- Stelle
- 1.9k
- Fork
- 312
- Merge medio
- 22h 59m
- PR unite (30g)
- 736
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di matrixorigin/matrixone
-
kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
matrixorigin/matrixone#33363 ·
I maintainer di solito rispondono entro 1 giorno
-
kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
matrixorigin/matrixone#33362 ·
I maintainer di solito rispondono entro 1 giorno
-
SLEEP rejects NULL and negative durations that MySQL acceptsForse già presa @XuPeng-SH l’ha presa 7 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
matrixorigin/matrixone#32653 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: TestChangeWatchProxy loses its first tenant connection during PingContext in Ubuntu CIForse già presa @XuPeng-SH l’ha presa oggi. Apertakind/bug needs-triage
matrixorigin/matrixone#33371 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: TestDaemonClaimSQLRoundTrip exhausts its shared deadline during the stale claim update in Ubuntu CIForse già presa @XuPeng-SH l’ha presa oggi. Apertakind/bug needs-triage
matrixorigin/matrixone#33370 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di matrixorigin/matrixone
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
pg-sharding/spqr#3314 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
zalando/postgres-operator#3257 ·
I maintainer di solito rispondono entro 2 giorni
-
[inputs.internal] README lists go_version tag on internal_gather instead of internal_agentForse già presa @cvas22 l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
influxdata/telegraf#20264 ·
I maintainer di solito rispondono entro 1 giorno