【线上】 select * from xxoo where 1=1应用挂掉

select * from xxoo where 1=1
该语句将数据全部查询出来,当数据量特别大的时候,服务器会挂掉

解决方案:

xxxxooo:
  query-safety:
    # 默认的最大查询记录条数
    maxRow: 600
    # 是否展示SQL
    showSql: true


编写安全模块,将所有语句后面添加上limit 600;
如下:

例子:

线上改写前SQL语句:

select * from user where id = 1

会被改写成

select * from user where id = 1 limit 600
 
原文地址:https://www.cnblogs.com/songjn/p/14392156.html