I want to force MySQL to make sql_select_limit take precedence over limit clause for any query. for example, I set sql_select_limit=10 and I execute a query like "SELECT * FROM table limit 50" I want as a result 10, not 50
CodePudding user response:
https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_sql_select_limit says:
If a
SELECT
has aLIMIT
clause, theLIMIT
takes precedence over the value ofsql_select_limit
.
That's the behavior supported by MySQL Server.
You would have to change the source code of MySQL Server to make it behave differently.
I suggest you write SQL queries as you would want them to behave.