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
 

相关文章:

  • 2022-12-23
  • 2022-02-14
  • 2022-02-13
  • 2022-02-06
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-09
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案