mysql 中由 group by 上的 count(*) 触发的重复键错误

duplicate-key error in mysql triggered by count(*) on group by

大家好,我正在阅读一本关于盲人 sql 注射的无书

本书作者提到如果要在mysql

中触发错误

使用此查询并将其注入目标

1 and (select 1 from (select count(*),concat(/*your malicious query here*/,floor(rand(0)*2)x from users group by x) a)

他说(作者)group by "floor(rand(0)*2)" 上的 count(*) 会导致内部 table 中的重复密钥并显示密钥

我的问题: 首先他为什么把 x 放在那里?

其次什么是内部 table 错误中的重复键以及除此错误之外是什么查询导致它以及 group by "floor(rand(0)*2)" 上的 count(*) 如何导致它发生

x是表达式floor(rand(0)*2)的别名,所以可以在GROUP BY x.

中引用

"duplicate key in an internal table" 听起来像是对 MySQL 在尝试处理此查询时发生的错误的描述。